hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r929332 - in /hadoop/hbase/trunk: CHANGES.txt core/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java core/src/main/java/org/apache/hadoop/hbase/regionserver/WildcardColumnTracker.java
Date Tue, 30 Mar 2010 22:56:21 GMT
Author: jdcryans
Date: Tue Mar 30 22:56:21 2010
New Revision: 929332

URL: http://svn.apache.org/viewvc?rev=929332&view=rev
Log:
HBASE-2270  Improve how we handle recursive calls in ExplicitColumnTracker   
            and WildcardColumnTracker


Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/WildcardColumnTracker.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=929332&r1=929331&r2=929332&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Tue Mar 30 22:56:21 2010
@@ -472,6 +472,8 @@ Release 0.21.0 - Unreleased
    HBASE-2374  TableInputFormat - Configurable parameter to add column families
                (Kay Kay via Stack)
    HBASE-2388  Give a very explicit message when we figure a big GC pause
+   HBASE-2270  Improve how we handle recursive calls in ExplicitColumnTracker 
+               and WildcardColumnTracker
 
   NEW FEATURES
    HBASE-1961  HBase EC2 scripts

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java?rev=929332&r1=929331&r2=929332&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java
Tue Mar 30 22:56:21 2010
@@ -83,7 +83,6 @@ public class ExplicitColumnTracker imple
    * @return MatchCode telling QueryMatcher what action to take
    */
   public MatchCode checkColumn(byte [] bytes, int offset, int length) {
-    boolean recursive = false;
     do {
       // No more columns left, we are done with this query
       if(this.columns.size() == 0) {
@@ -114,6 +113,12 @@ public class ExplicitColumnTracker imple
         return MatchCode.INCLUDE;
       }
 
+
+      if (ret > 0) {
+         // Specified column is smaller than the current, skip to next column.
+        return MatchCode.SKIP;
+      }
+
       // Specified column is bigger than current column
       // Move down current column and check again
       if(ret <= -1) {
@@ -121,15 +126,10 @@ public class ExplicitColumnTracker imple
           // No more to match, do not include, done with storefile
           return MatchCode.NEXT; // done_row
         }
+        // This is the recursive case.
         this.column = this.columns.get(this.index);
-        recursive = true;
-        continue;
       }
-    } while(recursive);
-
-    // Specified column is smaller than current column
-    // Skip
-    return MatchCode.SKIP; // skip to next column, with hint?
+    } while(true);
   }
   
   /**

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/WildcardColumnTracker.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/WildcardColumnTracker.java?rev=929332&r1=929331&r2=929332&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/WildcardColumnTracker.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/WildcardColumnTracker.java
Tue Mar 30 22:56:21 2010
@@ -89,9 +89,7 @@ public class WildcardColumnTracker imple
    * @return MatchCode telling QueryMatcher what action to take
    */
   public MatchCode checkColumn(byte [] bytes, int offset, int length) {
-    boolean recursive = false;
     do {
-
       // Nothing to match against, add to new and include
       if(this.column == null && this.newColumn == null) {
         newColumns.add(new ColumnCount(bytes, offset, length, 1));
@@ -121,9 +119,8 @@ public class WildcardColumnTracker imple
             this.newColumn = newColumns.get(newIndex);
             return MatchCode.INCLUDE;
           }
+          // recursive case
           this.newColumn = newColumns.get(newIndex);
-          //return checkColumn(bytes, offset, length);
-          recursive = true;
           continue;
         }
 
@@ -158,9 +155,8 @@ public class WildcardColumnTracker imple
             this.column = null;
             return MatchCode.INCLUDE;
           }
+          // recursive case
           this.column = columns.get(index);
-          //return checkColumn(bytes, offset, length);
-          recursive = true;
           continue;
         }
 
@@ -199,8 +195,7 @@ public class WildcardColumnTracker imple
             } else {
               this.column = columns.get(index);
             }
-            //return checkColumn(bytes, offset, length);
-            recursive = true;
+            // Recursive case
             continue;
           }
 
@@ -234,8 +229,7 @@ public class WildcardColumnTracker imple
           } else {
             this.newColumn = newColumns.get(newIndex);
           }
-          //return checkColumn(bytes, offset, length);
-          recursive = true;
+          // Recursive case
           continue;
         }
 
@@ -245,11 +239,7 @@ public class WildcardColumnTracker imple
         newColumns.add(new ColumnCount(bytes, offset, length, 1));
         return MatchCode.INCLUDE;
       }
-    } while(recursive);
-
-    // No match happened, add to new and include
-    newColumns.add(new ColumnCount(bytes, offset, length, 1));
-    return MatchCode.INCLUDE;    
+    } while(true);
   }
   
   /**



Mime
View raw message