diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java index 5e646cd..4f06845 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java @@ -208,9 +208,6 @@ public abstract class Filter { */ abstract public boolean filterRow() throws IOException; - @Deprecated // use Cell GetNextKeyHint(final Cell) - abstract public KeyValue getNextKeyHint(final KeyValue currentKV) throws IOException; - /** * If the filter returns the match code SEEK_NEXT_USING_HINT, then it should also tell which is * the next key it must seek to. After receiving the match code SEEK_NEXT_USING_HINT, the 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..f79f363 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,24 +129,13 @@ public abstract class FilterBase extends Filter { } /** - * This method is deprecated and you should override Cell getNextKeyHint(Cell) instead. - */ - @Override - @Deprecated - public KeyValue getNextKeyHint(KeyValue currentKV) throws IOException { - return null; - } - - /** * Filters that are not sure which key must be next seeked to, can inherit * this implementation that, by default, returns a null Cell. * * @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/FilterList.java hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 41c09ce..401d71e 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -395,12 +395,6 @@ final public class FilterList extends Filter { } @Override - @Deprecated - public KeyValue getNextKeyHint(KeyValue currentKV) throws IOException { - return KeyValueUtil.ensureKeyValue(getNextCellHint((Cell)currentKV)); - } - - @Override public Cell getNextCellHint(Cell currentKV) throws IOException { Cell keyHint = null; if (operator == Operator.MUST_PASS_ALL) { 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..e0d0241 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 @@ -99,23 +99,9 @@ final public class FilterWrapper extends Filter { return this.filter.filterRow(); } - /** - * This method is deprecated and you should override Cell getNextKeyHint(Cell) instead. - */ - @Override - @Deprecated - public KeyValue getNextKeyHint(KeyValue currentKV) throws IOException { - 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)); }