From a93e1aa8f61a3d0818a7eb1a235c9ef74f2efbfb Mon Sep 17 00:00:00 2001 From: huzheng Date: Thu, 26 Oct 2017 18:40:05 +0800 Subject: [PATCH] HBASE-15410 (addendum) Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT --- .../hadoop/hbase/filter/FilterListWithAND.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterListWithAND.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterListWithAND.java index 9217ff92e33..755dd981a13 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterListWithAND.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterListWithAND.java @@ -23,9 +23,8 @@ import org.apache.hadoop.hbase.Cell; import org.apache.yetus.audience.InterfaceAudience; import java.io.IOException; -import java.util.HashSet; +import java.util.ArrayList; import java.util.List; -import java.util.Set; /** * FilterListWithAND represents an ordered list of filters which will be evaluated with an AND @@ -34,7 +33,7 @@ import java.util.Set; @InterfaceAudience.Private public class FilterListWithAND extends FilterListBase { - private Set seekHintFilter = new HashSet<>(); + private List seekHintFilters = new ArrayList<>(); public FilterListWithAND(List filters) { super(filters); @@ -155,7 +154,7 @@ public class FilterListWithAND extends FilterListBase { ReturnCode rc = ReturnCode.INCLUDE; Cell transformed = transformedCell; this.referenceCell = c; - this.seekHintFilter.clear(); + this.seekHintFilters.clear(); for (int i = 0, n = filters.size(); i < n; i++) { Filter filter = filters.get(i); if (filter.filterAllRemaining()) { @@ -175,11 +174,11 @@ public class FilterListWithAND extends FilterListBase { transformed = filter.transformCell(transformed); } if (localRC == ReturnCode.SEEK_NEXT_USING_HINT) { - seekHintFilter.add(filter); + seekHintFilters.add(filter); } } this.transformedCell = transformed; - if (!seekHintFilter.isEmpty()) { + if (!seekHintFilters.isEmpty()) { return ReturnCode.SEEK_NEXT_USING_HINT; } return rc; @@ -190,7 +189,7 @@ public class FilterListWithAND extends FilterListBase { for (int i = 0, n = filters.size(); i < n; i++) { filters.get(i).reset(); } - seekHintFilter.clear(); + seekHintFilters.clear(); } @Override @@ -259,7 +258,7 @@ public class FilterListWithAND extends FilterListBase { return super.getNextCellHint(currentCell); } Cell maxHint = null; - for (Filter filter : seekHintFilter) { + for (Filter filter : seekHintFilters) { if (filter.filterAllRemaining()) { continue; }