Review Board 1.7.22

HBASE-4071: Support minimum number of versions with TTL

Review Request #1582 - Created Aug. 18, 2011 and submitted

Lars Hofhansl
jgray, stack, tlipcon
Allow enforcing a minimum number of versions when TTL is enable for a store.
The GC logic for both versions and TTL is unified inside the ColumnTrackers.
Ran all tests. I get error (not failures) from two: TestDistributedLogSplitting and TestHTablePool. Both fail with or without my changes.
New tests: TestMinVersions.
Review request changed
Updated (Aug. 23, 2011, 5:13 a.m.)
Added Javadoc to TestMinVersions.
Ship it!
Posted (Aug. 24, 2011, 12:03 a.m.)
One thing only in below... patch looks good to commit... just one question below (I can fix the other thing myself on commit -- the javadoc).
javadoc doesn't match param name -- I can fix on commit.
  1. Argh... One more that I missed. Thanks Stack!
I defer to Jon's review here (he knows this stuff...)
  1. This basically just counts versions up instead of down (see next comment below as to why).
Why this change?
  1. ExplicitColumnTracker used to count versions down and ScanWildcardColumnTracker is counting version up.
    This change goes to together with the previous change (increment vs decrement).
    I did that for two reasons:
    1. When both column trackers follow similar logic it will be easier to change them and to simplify them further in the future (such as extracting a GC policy).
    2. Now the comparison for versions can be:
     if(count >= maxVersions || (count >= minVersions && isExpired(timestamp))
        // Done with versions for this column
    whereas otherwise it would need to be:
     if(count == 0) || ((maxVersion-count) < minVersions && isExpired(timestamp))
        // Done with versions for this column
    Which is harder to read and less intuitive, I think.