You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2014/02/11 23:08:41 UTC

svn commit: r1567416 - /hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java

Author: tedyu
Date: Tue Feb 11 22:08:41 2014
New Revision: 1567416

URL: http://svn.apache.org/r1567416
Log:
HBASE-10493 InclusiveStopFilter#filterKeyValue() should perform filtering on row key, add test


Modified:
    hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java

Modified: hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java?rev=1567416&r1=1567415&r2=1567416&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java (original)
+++ hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java Tue Feb 11 22:08:41 2014
@@ -285,6 +285,28 @@ public class TestFilterList {
   }
 
   /**
+   * When we do a "MUST_PASS_ONE" (a logical 'OR') of the two filters
+   * we expect to get the same result as the inclusive stop result.
+   * @throws Exception
+   */
+  public void testFilterListWithInclusiveStopFilteMustPassOne() throws Exception {
+    byte[] r1 = Bytes.toBytes("Row1");
+    byte[] r11 = Bytes.toBytes("Row11");
+    byte[] r2 = Bytes.toBytes("Row2");
+
+    FilterList flist = new FilterList(FilterList.Operator.MUST_PASS_ONE);
+    flist.addFilter(new AlwaysNextColFilter());
+    flist.addFilter(new InclusiveStopFilter(r1));
+    flist.filterRowKey(r1, 0, r1.length);
+    assertEquals(flist.filterKeyValue(new KeyValue(r1,r1,r1)), ReturnCode.INCLUDE);
+    assertEquals(flist.filterKeyValue(new KeyValue(r11,r11,r11)), ReturnCode.INCLUDE);
+
+    flist.reset();
+    flist.filterRowKey(r2, 0, r2.length);
+    assertEquals(flist.filterKeyValue(new KeyValue(r2,r2,r2)), ReturnCode.SKIP);
+  }
+
+  /**
    * Test filterKeyValue logic.
    * @throws Exception
    */