hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [2/6] hbase git commit: Revert "HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT"
Date Mon, 09 Oct 2017 21:51:23 GMT
Revert "HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList
return SEEK_NEXT_USING_HINT"

This reverts commit df34300cd3f89c1efdea43b0b2ecb64c317e1a34.

Backing out filterlist regression, see HBASE-18957. Work continuing branch for HBASE-18410.

Signed-off-by: Peter Somogyi <psomogyi@cloudera.com>
Signed-off-by: Michael Stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4eea0d92
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4eea0d92
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4eea0d92

Branch: refs/heads/master
Commit: 4eea0d923e37180b25d89db676aed2f699f5e0ba
Parents: 183b3e3
Author: Sean Busbey <busbey@apache.org>
Authored: Fri Oct 6 11:19:53 2017 -0500
Committer: Sean Busbey <busbey@apache.org>
Committed: Mon Oct 9 16:49:20 2017 -0500

----------------------------------------------------------------------
 .../apache/hadoop/hbase/filter/FilterList.java  | 31 ++++----------------
 .../hadoop/hbase/filter/TestFilterList.java     |  6 ++--
 2 files changed, 9 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/4eea0d92/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java
----------------------------------------------------------------------
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 1e80a7e..33d5b45 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
@@ -22,9 +22,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
-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 +65,7 @@ final public class FilterList extends FilterBase {
   private static final int MAX_LOG_FILTERS = 5;
   private Operator operator = Operator.MUST_PASS_ALL;
   private final List<Filter> filters;
-  private Set<Filter> seekHintFilter = new HashSet<>();
+  private Filter seekHintFilter = null;
 
   /**
    * Save previous return code and previous cell for every filter in filter list. For MUST_PASS_ONE,
@@ -236,7 +234,7 @@ final public class FilterList extends FilterBase {
         prevCellList.set(i, null);
       }
     }
-    seekHintFilter.clear();
+    seekHintFilter = null;
   }
 
   @Override
@@ -360,7 +358,6 @@ final public class FilterList extends FilterBase {
       return ReturnCode.INCLUDE;
     }
     this.referenceCell = c;
-    seekHintFilter.clear();
 
     // Accumulates successive transformation of every filter that includes the Cell:
     Cell transformed = c;
@@ -392,12 +389,10 @@ final public class FilterList extends FilterBase {
           transformed = filter.transformCell(transformed);
           continue;
         case SEEK_NEXT_USING_HINT:
-          seekHintFilter.add(filter);
-          continue;
+          seekHintFilter = filter;
+          return code;
         default:
-          if (seekHintFilter.isEmpty()) {
-            return code;
-          }
+          return code;
         }
       } else if (operator == Operator.MUST_PASS_ONE) {
         Cell prevCell = this.prevCellList.get(i);
@@ -447,10 +442,6 @@ final public class FilterList extends FilterBase {
       }
     }
 
-    if (!seekHintFilter.isEmpty()) {
-      return ReturnCode.SEEK_NEXT_USING_HINT;
-    }
-
     // Save the transformed Cell for transform():
     this.transformedCell = transformed;
 
@@ -574,17 +565,7 @@ final public class FilterList extends FilterBase {
     }
     Cell keyHint = null;
     if (operator == Operator.MUST_PASS_ALL) {
-      for (Filter filter : seekHintFilter) {
-        if (filter.filterAllRemaining()) continue;
-        Cell curKeyHint = filter.getNextCellHint(currentCell);
-        if (keyHint == null) {
-          keyHint = curKeyHint;
-          continue;
-        }
-        if (CellComparator.COMPARATOR.compare(keyHint, curKeyHint) < 0) {
-          keyHint = curKeyHint;
-        }
-      }
+      if (seekHintFilter != null) keyHint = seekHintFilter.getNextCellHint(currentCell);
       return keyHint;
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/4eea0d92/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java
index f20a9ba..90f95a5 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java
@@ -502,7 +502,7 @@ public class TestFilterList {
     FilterList filterList = new FilterList(Operator.MUST_PASS_ONE,
         Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } ));
     assertEquals(0, CellComparator.COMPARATOR.compare(filterList.getNextCellHint(null),
-      minKeyValue));
+        minKeyValue));
 
     // Should have no hint if any filter has no hint
     filterList = new FilterList(Operator.MUST_PASS_ONE,
@@ -526,7 +526,7 @@ public class TestFilterList {
         Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } ));
     filterList.filterKeyValue(null);
     assertEquals(0, CellComparator.COMPARATOR.compare(filterList.getNextCellHint(null),
-        maxKeyValue));
+        minKeyValue));
 
     filterList = new FilterList(Operator.MUST_PASS_ALL,
         Arrays.asList(new Filter [] { filterMaxHint, filterMinHint } ));
@@ -540,7 +540,7 @@ public class TestFilterList {
             new Filter [] { filterNoHint, filterMinHint, filterMaxHint } ));
     filterList.filterKeyValue(null);
     assertEquals(0, CellComparator.COMPARATOR.compare(filterList.getNextCellHint(null),
-        maxKeyValue));
+        minKeyValue));
     filterList = new FilterList(Operator.MUST_PASS_ALL,
         Arrays.asList(new Filter [] { filterNoHint, filterMaxHint } ));
     filterList.filterKeyValue(null);


Mime
View raw message