hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [2/3] 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 22:12:36 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 ead106324474d2faff11b4e1779e575aec67b59c.

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/c7dc0da8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c7dc0da8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c7dc0da8

Branch: refs/heads/branch-1
Commit: c7dc0da849e543cc5205f54eb69c5d75bd442f73
Parents: 8d77c1e
Author: Sean Busbey <busbey@apache.org>
Authored: Fri Oct 6 14:04:00 2017 -0500
Committer: Sean Busbey <busbey@apache.org>
Committed: Mon Oct 9 17:06:09 2017 -0500

----------------------------------------------------------------------
 .../apache/hadoop/hbase/filter/FilterList.java  | 32 ++++----------------
 .../hadoop/hbase/filter/TestFilterList.java     |  4 +--
 2 files changed, 8 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c7dc0da8/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 74736db..ddbd4a7 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,15 +22,12 @@ 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.CellUtil;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.Cell;
-import org.apache.hadoop.hbase.CellComparator;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValueUtil;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
@@ -72,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 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,
@@ -210,7 +207,7 @@ final public class FilterList extends Filter {
         prevCellList.set(i, null);
       }
     }
-    seekHintFilter.clear();
+    seekHintFilter = null;
   }
 
   @Override
@@ -317,7 +314,6 @@ final public class FilterList extends Filter {
     justification="Intentional")
   public ReturnCode filterKeyValue(Cell v) throws IOException {
     this.referenceKV = v;
-    seekHintFilter.clear();
 
     // Accumulates successive transformation of every filter that includes the Cell:
     Cell transformed = v;
@@ -349,12 +345,10 @@ final public class FilterList extends Filter {
           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);
@@ -404,10 +398,6 @@ final public class FilterList extends Filter {
       }
     }
 
-    if (!seekHintFilter.isEmpty()) {
-      return ReturnCode.SEEK_NEXT_USING_HINT;
-    }
-
     // Save the transformed Cell for transform():
     this.transformedKV = transformed;
 
@@ -532,17 +522,7 @@ final public class FilterList extends Filter {
   public Cell getNextCellHint(Cell currentKV) throws IOException {
     Cell keyHint = null;
     if (operator == Operator.MUST_PASS_ALL) {
-      for (Filter filter : seekHintFilter) {
-        if (filter.filterAllRemaining()) continue;
-        Cell curKeyHint = filter.getNextCellHint(currentKV);
-        if (keyHint == null) {
-          keyHint = curKeyHint;
-          continue;
-        }
-        if (KeyValue.COMPARATOR.compare(keyHint, curKeyHint) < 0) {
-          keyHint = curKeyHint;
-        }
-      }
+      if (seekHintFilter != null) keyHint = seekHintFilter.getNextCellHint(currentKV);
       return keyHint;
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/c7dc0da8/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 024785e..994adff 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
@@ -485,7 +485,7 @@ public class TestFilterList {
         Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } ));
     filterList.filterKeyValue(null);
     assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextKeyHint(null),
-        maxKeyValue));
+        minKeyValue));
 
     filterList = new FilterList(Operator.MUST_PASS_ALL,
         Arrays.asList(new Filter [] { filterMaxHint, filterMinHint } ));
@@ -499,7 +499,7 @@ public class TestFilterList {
             new Filter [] { filterNoHint, filterMinHint, filterMaxHint } ));
     filterList.filterKeyValue(null);
     assertEquals(0, KeyValue.COMPARATOR.compare(filterList.getNextKeyHint(null),
-        maxKeyValue));
+        minKeyValue));
     filterList = new FilterList(Operator.MUST_PASS_ALL,
         Arrays.asList(new Filter [] { filterNoHint, filterMaxHint } ));
     filterList.filterKeyValue(null);


Mime
View raw message