Review Board 1.7.22


HBASE-4536 - Allow CF to retain deleted rows

Review Request #2178 - Created Oct. 4, 2011 and submitted

Lars Hofhansl
trunk
HBASE-4536
Reviewers
hbase
jgray, tedyu
hbase
HBase timerange Gets and Scans allow to do "timetravel" in HBase. I.e. look at the state of the data at any point in the past, provided the data is still around.
This did not work for deletes, however. Deletes would always mask all puts in the past.
This change adds a flag that can be on HColumnDescriptor to enable retention of deleted rows.
These rows are still subject to TTL and/or VERSIONS.

This changes the following:
1. There is a new flag on HColumnDescriptor enabling that behavior.
2. Allow gets/scans with a timerange to retrieve rows hidden by a delete marker, if the timerange does not include the delete marker.
3. Do not unconditionally collect all deleted rows during a compaction.
4. Allow a "raw" Scan, which retrieves all delete markers and deleted rows.

The change is small'ish, but the logic is intricate, so please review carefully.
All tests pass now.
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
Revision 1178891 New Change
[20] 302 lines
[+20] [+] public class HColumnDescriptor implements WritableComparable<HColumnDescriptor> {
303
      // TODO: Allow maxVersion of 0 to be the way you say "Keep all versions".
303
      // TODO: Allow maxVersion of 0 to be the way you say "Keep all versions".
304
      // Until there is support, consider 0 or < 0 -- a configuration error.
304
      // Until there is support, consider 0 or < 0 -- a configuration error.
305
      throw new IllegalArgumentException("Maximum versions must be positive");
305
      throw new IllegalArgumentException("Maximum versions must be positive");
306
    }
306
    }
307

    
   
307

   
308
    if (minVersions > 0) {

   
309
      if (timeToLive == HConstants.FOREVER) {

   
310
        throw new IllegalArgumentException("Minimum versions requires TTL.");

   
311
      }

   
312
      if (minVersions > maxVersions) {
308
    if (minVersions > maxVersions) {
313
        throw new IllegalArgumentException("Minimum versions must be <= "+
309
      throw new IllegalArgumentException("Minimum versions must be <= "
314
            "maximum versions.");
310
          + "maximum versions.");
315
      }

   
316
    }
311
    }
317

    
   
312

   
318
    setMaxVersions(maxVersions);
313
    setMaxVersions(maxVersions);
319
    setMinVersions(minVersions);
314
    setMinVersions(minVersions);
320
    setInMemory(inMemory);
315
    setInMemory(inMemory);
[+20] [20] 481 lines
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/ColumnTracker.java
Revision 1178891 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java
Revision 1178891 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java
Revision 1178891 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/ScanWildcardColumnTracker.java
Revision 1178891 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
Revision 1178891 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestExplicitColumnTracker.java
Revision 1178891 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
Revision 1178891 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWildcardColumnTracker.java
Revision 1178891 New Change
 
  1. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java: Loading...
  2. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/ColumnTracker.java: Loading...
  3. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java: Loading...
  4. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java: Loading...
  5. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/ScanWildcardColumnTracker.java: Loading...
  6. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java: Loading...
  7. http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestExplicitColumnTracker.java: Loading...
  8. http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java: Loading...
  9. http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWildcardColumnTracker.java: Loading...