Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java
- index 8ba1ccb..353b13d 100644
- --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java
- +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java
- @@ -21,7 +21,9 @@ package org.apache.hadoop.hbase.filter;
- import java.io.IOException;
- import java.util.ArrayList;
- import java.util.Arrays;
- +import java.util.HashSet;
- import java.util.List;
- +import java.util.Set;
- import org.apache.hadoop.hbase.Cell;
- import org.apache.hadoop.hbase.CellComparator;
- @@ -67,7 +69,7 @@ final public class FilterList extends Filter {
- private static final int MAX_LOG_FILTERS = 5;
- private Operator operator = Operator.MUST_PASS_ALL;
- private List<Filter> filters = new ArrayList<Filter>();
- - private Filter seekHintFilter = null;
- + private Set<Filter> seekHintFilter = new HashSet<>();
- /** Reference Cell used by {@link #transformCell(Cell)} for validation purpose. */
- private Cell referenceCell = null;
- @@ -173,7 +175,7 @@ final public class FilterList extends Filter {
- for (int i = 0; i < listize; i++) {
- filters.get(i).reset();
- }
- - seekHintFilter = null;
- + seekHintFilter.clear();
- }
- @Override
- @@ -269,10 +271,15 @@ final public class FilterList extends Filter {
- transformed = filter.transformCell(transformed);
- continue;
- case SEEK_NEXT_USING_HINT:
- - seekHintFilter = filter;
- - return code;
- + seekHintFilter.add(filter);
- + continue;
- default:
- - return code;
- + if (seekHintFilter.isEmpty()) {
- + return code;
- + }
- + }
- + if (!seekHintFilter.isEmpty()) {
- + return ReturnCode.SEEK_NEXT_USING_HINT;
- }
- } else if (operator == Operator.MUST_PASS_ONE) {
- if (filter.filterAllRemaining()) {
- @@ -416,7 +423,16 @@ final public class FilterList extends Filter {
- public Cell getNextCellHint(Cell currentCell) throws IOException {
- Cell keyHint = null;
- if (operator == Operator.MUST_PASS_ALL) {
- - keyHint = seekHintFilter.getNextCellHint(currentCell);
- + for (Filter filter : seekHintFilter) {
- + Cell curKeyHint = filter.getNextCellHint(currentCell);
- + if (keyHint == null) {
- + keyHint = curKeyHint;
- + continue;
- + }
- + if (CellComparator.COMPARATOR.compare(keyHint, curKeyHint) < 0) {
- + keyHint = curKeyHint;
- + }
- + }
- return keyHint;
- }
Advertisement
Add Comment
Please, Sign In to add comment