hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r793084 - in /hadoop/hbase/trunk: ./ src/java/org/apache/hadoop/hbase/regionserver/
Date Fri, 10 Jul 2009 19:30:40 GMT
Author: stack
Date: Fri Jul 10 19:30:39 2009
New Revision: 793084

URL: http://svn.apache.org/viewvc?rev=793084&view=rev
Log:
HBASE-1643 ScanDeleteTracker takes comparator but it unused

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/GetDeleteTracker.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MinorCompactingStoreScanner.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanDeleteTracker.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=793084&r1=793083&r2=793084&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Fri Jul 10 19:30:39 2009
@@ -462,6 +462,7 @@
                Scan (Jon Gray via Nitay)
    HBASE-1640  Allow passing arguments to jruby script run when run by bin/hbase shell
    HBASE-698   HLog recovery is not performed after master failure
+   HBASE-1643  ScanDeleteTracker takes comparator but it unused
 
   OPTIMIZATIONS
    HBASE-1412  Change values for delete column and column family in KeyValue

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/GetDeleteTracker.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/GetDeleteTracker.java?rev=793084&r1=793083&r2=793084&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/GetDeleteTracker.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/GetDeleteTracker.java
Fri Jul 10 19:30:39 2009
@@ -90,7 +90,7 @@
       int qualifierLength, long timestamp) {
 
     // Check against DeleteFamily
-    if(timestamp <= familyStamp) {
+    if (timestamp <= familyStamp) {
       return true;
     }
 

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java?rev=793084&r1=793083&r2=793084&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java Fri
Jul 10 19:30:39 2009
@@ -54,8 +54,8 @@
     this.comparator = new KVScannerComparator(comparator);
     this.heap = new PriorityQueue<KeyValueScanner>(scanners.length, 
         this.comparator);
-    for(KeyValueScanner scanner : scanners) {
-      if(scanner.peek() != null) {
+    for (KeyValueScanner scanner : scanners) {
+      if (scanner.peek() != null) {
         this.heap.add(scanner);
       }
     }
@@ -102,7 +102,7 @@
     InternalScanner currentAsInternal = (InternalScanner)this.current;
     currentAsInternal.next(result);
     KeyValue pee = this.current.peek();
-    if(pee == null) {
+    if (pee == null) {
       this.current.close();
     } else {
       this.heap.add(this.current);

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MinorCompactingStoreScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MinorCompactingStoreScanner.java?rev=793084&r1=793083&r2=793084&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MinorCompactingStoreScanner.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MinorCompactingStoreScanner.java
Fri Jul 10 19:30:39 2009
@@ -41,7 +41,7 @@
   MinorCompactingStoreScanner(Store store,
                               KeyValueScanner [] scanners) {
     comparator = store.comparator;
-    deleteTracker = new ScanDeleteTracker(store.comparator.getRawComparator());
+    deleteTracker = new ScanDeleteTracker();
     KeyValue firstKv = KeyValue.createFirstOnRow(HConstants.EMPTY_START_ROW);
     for (KeyValueScanner scanner : scanners ) {
       scanner.seek(firstKv);
@@ -53,7 +53,7 @@
   MinorCompactingStoreScanner(String cfName, KeyValue.KVComparator comparator,
                               KeyValueScanner [] scanners) {
     this.comparator = comparator;
-    deleteTracker = new ScanDeleteTracker(comparator.getRawComparator());
+    deleteTracker = new ScanDeleteTracker();
 
     KeyValue firstKv = KeyValue.createFirstOnRow(HConstants.EMPTY_START_ROW);
     for (KeyValueScanner scanner : scanners ) {

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanDeleteTracker.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanDeleteTracker.java?rev=793084&r1=793083&r2=793084&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanDeleteTracker.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanDeleteTracker.java
Fri Jul 10 19:30:39 2009
@@ -47,14 +47,11 @@
   private byte deleteType = 0;
   private long deleteTimestamp = 0L;
 
-  private KeyValue.KeyComparator comparator;
-  
   /**
    * Constructor for ScanDeleteTracker
-   * @param comparator
    */
-  public ScanDeleteTracker(KeyValue.KeyComparator comparator) {
-    this.comparator = comparator;
+  public ScanDeleteTracker() {
+    super();
   }
   
   /**
@@ -71,15 +68,15 @@
   @Override
   public void add(byte[] buffer, int qualifierOffset, int qualifierLength,
       long timestamp, byte type) {
-    if(timestamp > familyStamp) {
-      if(type == KeyValue.Type.DeleteFamily.getCode()) {
+    if (timestamp > familyStamp) {
+      if (type == KeyValue.Type.DeleteFamily.getCode()) {
         familyStamp = timestamp;
         return;
       }
 
-      if(deleteBuffer != null && type < deleteType) {
+      if (deleteBuffer != null && type < deleteType) {
         // same column, so ignore less specific delete
-        if(Bytes.compareTo(deleteBuffer, deleteOffset, deleteLength,
+        if (Bytes.compareTo(deleteBuffer, deleteOffset, deleteLength,
             buffer, qualifierOffset, qualifierLength) == 0){
           return;
         }
@@ -107,17 +104,16 @@
   @Override
   public boolean isDeleted(byte [] buffer, int qualifierOffset,
       int qualifierLength, long timestamp) {
-    if(timestamp < familyStamp) {
+    if (timestamp < familyStamp) {
       return true;
     }
     
-    if(deleteBuffer != null) {
-      // TODO ryan use a specific comparator
+    if (deleteBuffer != null) {
       int ret = Bytes.compareTo(deleteBuffer, deleteOffset, deleteLength,
           buffer, qualifierOffset, qualifierLength);
 
-      if(ret == 0) {
-        if(deleteType == KeyValue.Type.DeleteColumn.getCode()) {
+      if (ret == 0) {
+        if (deleteType == KeyValue.Type.DeleteColumn.getCode()) {
           return true;
         }
         // Delete (aka DeleteVersion)
@@ -158,5 +154,4 @@
   public void update() {
     this.reset();
   }
-
-}
+}
\ No newline at end of file

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java?rev=793084&r1=793083&r2=793084&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java
Fri Jul 10 19:30:39 2009
@@ -24,7 +24,6 @@
 
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.filter.Filter;
 import org.apache.hadoop.hbase.filter.RowFilterInterface;
 import org.apache.hadoop.hbase.filter.Filter.ReturnCode;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -54,15 +53,14 @@
     this.tr = scan.getTimeRange();
     this.oldestStamp = System.currentTimeMillis() - ttl;
     this.rowComparator = rowComparator;
-    // shouldn't this be ScanDeleteTracker?
-    this.deletes =  new ScanDeleteTracker(rowComparator);
+    this.deletes =  new ScanDeleteTracker();
     this.startKey = KeyValue.createFirstOnRow(scan.getStartRow());
     this.stopKey = KeyValue.createFirstOnRow(scan.getStopRow());
     this.filter = scan.getFilter();
     this.oldFilter = scan.getOldFilter();
     
     // Single branch to deal with two types of reads (columns vs all in family)
-    if(columns == null || columns.size() == 0) {
+    if (columns == null || columns.size() == 0) {
       // use a specialized scan for wildcard column tracker.
       this.columns = new ScanWildcardColumnTracker(maxVersions);
     } else {
@@ -166,7 +164,8 @@
       return MatchCode.SKIP;
     }
 
-    if (deletes.isDeleted(bytes, offset, qualLength, timestamp)) {
+    if (!this.deletes.isEmpty() &&
+        deletes.isDeleted(bytes, offset, qualLength, timestamp)) {
       return MatchCode.SKIP;
     }
 

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java?rev=793084&r1=793083&r2=793084&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java Fri
Jul 10 19:30:39 2009
@@ -65,7 +65,7 @@
 
     // Combine all seeked scanners with a heap
     heap = new KeyValueHeap(
-        scanners.toArray(new KeyValueScanner[scanners.size()]), store.comparator);
+      scanners.toArray(new KeyValueScanner[scanners.size()]), store.comparator);
 
     this.store.addChangedReaderObserver(this);
   }



Mime
View raw message