diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java index 4988dc8..1494a19 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java @@ -129,7 +129,7 @@ public abstract class FilterBase extends Filter { } /** - * This method is deprecated and you should override Cell getNextKeyHint(Cell) instead. + * This method is deprecated use getNextCellHint instead. */ @Override @Deprecated @@ -144,9 +144,7 @@ public abstract class FilterBase extends Filter { * @inheritDoc */ public Cell getNextCellHint(Cell currentKV) throws IOException { - // Old filters based off of this class will override KeyValue getNextKeyHint(KeyValue). - // Thus to maintain compatibility we need to call the old version. - return getNextKeyHint(KeyValueUtil.ensureKeyValue(currentKV)); + return null; } /** diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java index 51b2a66..2cc9446 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java @@ -100,7 +100,7 @@ final public class FilterWrapper extends Filter { } /** - * This method is deprecated and you should override Cell getNextKeyHint(Cell) instead. + * This method is deprecated use getNextCellHint instead. */ @Override @Deprecated @@ -108,14 +108,9 @@ final public class FilterWrapper extends Filter { return KeyValueUtil.ensureKeyValue(this.filter.getNextCellHint((Cell)currentKV)); } - /** - * Old filter wrapper descendants will implement KV getNextKeyHint(KV) so we should call it. - */ @Override public Cell getNextCellHint(Cell currentKV) throws IOException { - // Old filters based off of this class will override KeyValue getNextKeyHint(KeyValue). - // Thus to maintain compatibility we need to call the old version. - return this.getNextKeyHint(KeyValueUtil.ensureKeyValue(currentKV)); + return this.filter.getNextCellHint(currentKV); } @Override diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java index 118811d..4512f6d 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java @@ -126,9 +126,9 @@ public class FuzzyRowFilter extends FilterBase { // SHOULD NEVER happen // TODO: is there a better way than throw exception? (stop the scanner?) throw new IllegalStateException("No next row key that satisfies fuzzy exists when" + - " getNextKeyHint() is invoked." + + " getNextCellHint() is invoked." + " Filter: " + this.toString() + - " currentKV: " + currentKV.toString()); + " Cell: " + currentKV.toString()); } return KeyValueUtil.createFirstOnRow(nextRowKey); diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java index 205c7f8..44456c8 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java @@ -528,7 +528,7 @@ public class ScanQueryMatcher { return this.filter; } - public Cell getNextKeyHint(Cell kv) throws IOException { + public Cell getNextCellHint(Cell kv) throws IOException { if (filter == null) { return null; } else { diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java index 1ef3e91..bc47c38 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java @@ -565,7 +565,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner case SEEK_NEXT_USING_HINT: // TODO convert resee to Cell? - Cell nextKV = matcher.getNextKeyHint(cell); + Cell nextKV = matcher.getNextCellHint(cell); if (nextKV != null) { seekAsDirection(nextKV); } else { diff --git hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index d3ce165..fd5cb19 100644 --- hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -464,22 +464,22 @@ public class TestFilterList { // Should take the min if given two hints FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } )); - assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextKeyHint(null), + assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextCellHint(null), minKeyValue)); // Should have no hint if any filter has no hint filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList( new Filter [] { filterMinHint, filterMaxHint, filterNoHint } )); - assertNull(filterList.getNextKeyHint(null)); + assertNull(filterList.getNextCellHint(null)); filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterNoHint, filterMaxHint } )); - assertNull(filterList.getNextKeyHint(null)); + assertNull(filterList.getNextCellHint(null)); // Should give max hint if its the only one filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMaxHint, filterMaxHint } )); - assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextKeyHint(null), + assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextCellHint(null), maxKeyValue)); // MUST PASS ALL @@ -488,13 +488,13 @@ public class TestFilterList { filterList = new FilterList(Operator.MUST_PASS_ALL, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } )); filterList.filterKeyValue(null); - assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextKeyHint(null), + assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextCellHint(null), minKeyValue)); filterList = new FilterList(Operator.MUST_PASS_ALL, Arrays.asList(new Filter [] { filterMaxHint, filterMinHint } )); filterList.filterKeyValue(null); - assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextKeyHint(null), + assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextCellHint(null), maxKeyValue)); // Should have first hint even if a filter has no hint @@ -502,17 +502,17 @@ public class TestFilterList { Arrays.asList( new Filter [] { filterNoHint, filterMinHint, filterMaxHint } )); filterList.filterKeyValue(null); - assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextKeyHint(null), + assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextCellHint(null), minKeyValue)); filterList = new FilterList(Operator.MUST_PASS_ALL, Arrays.asList(new Filter [] { filterNoHint, filterMaxHint } )); filterList.filterKeyValue(null); - assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextKeyHint(null), + assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextCellHint(null), maxKeyValue)); filterList = new FilterList(Operator.MUST_PASS_ALL, Arrays.asList(new Filter [] { filterNoHint, filterMinHint } )); filterList.filterKeyValue(null); - assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextKeyHint(null), + assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextCellHint(null), minKeyValue)); }