HBASE-2270 Improve how we handle recursive calls in ExplicitColumnTracker

and WildcardColumnTracker



git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@929332 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2010-03-30 22:56:21 +00:00
parent 843bfd31b7
commit 7784ad0762
3 changed files with 15 additions and 23 deletions

View File

@ -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

View File

@ -83,7 +83,6 @@ public class ExplicitColumnTracker implements ColumnTracker {
* @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 implements ColumnTracker {
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 implements ColumnTracker {
// 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);
}
/**

View File

@ -89,9 +89,7 @@ public class WildcardColumnTracker implements ColumnTracker {
* @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 implements ColumnTracker {
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 implements ColumnTracker {
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 implements ColumnTracker {
} else {
this.column = columns.get(index);
}
//return checkColumn(bytes, offset, length);
recursive = true;
// Recursive case
continue;
}
@ -234,8 +229,7 @@ public class WildcardColumnTracker implements ColumnTracker {
} else {
this.newColumn = newColumns.get(newIndex);
}
//return checkColumn(bytes, offset, length);
recursive = true;
// Recursive case
continue;
}
@ -245,11 +239,7 @@ public class WildcardColumnTracker implements ColumnTracker {
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);
}
/**