Index: core/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java =================================================================== --- core/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java (revision 916402) +++ core/src/main/java/org/apache/hadoop/hbase/regionserver/ExplicitColumnTracker.java (working copy) @@ -83,7 +83,6 @@ * @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 @@ 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,11 @@ // 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); } /** Index: core/src/main/java/org/apache/hadoop/hbase/regionserver/WildcardColumnTracker.java =================================================================== --- core/src/main/java/org/apache/hadoop/hbase/regionserver/WildcardColumnTracker.java (revision 916402) +++ core/src/main/java/org/apache/hadoop/hbase/regionserver/WildcardColumnTracker.java (working copy) @@ -89,7 +89,6 @@ * @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 @@ -121,9 +120,8 @@ 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 +156,8 @@ this.column = null; return MatchCode.INCLUDE; } + // recursive case this.column = columns.get(index); - //return checkColumn(bytes, offset, length); - recursive = true; continue; } @@ -199,8 +196,7 @@ } else { this.column = columns.get(index); } - //return checkColumn(bytes, offset, length); - recursive = true; + // Recursive case continue; } @@ -234,8 +230,7 @@ } else { this.newColumn = newColumns.get(newIndex); } - //return checkColumn(bytes, offset, length); - recursive = true; + // Recursive case continue; } @@ -245,11 +240,7 @@ 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); } /**