コード例 #1
0
 private void regexFilterTests(Filter filter) throws Exception {
   KeyValue kv = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, FULLSTRING_1);
   assertTrue("regexTrue", filter.filterKeyValue(kv) == Filter.ReturnCode.INCLUDE);
   kv = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, FULLSTRING_2);
   assertTrue("regexFalse", filter.filterKeyValue(kv) == Filter.ReturnCode.INCLUDE);
   assertFalse("regexFilterAllRemaining", filter.filterAllRemaining());
   assertFalse("regexFilterNotNull", filter.filterRow());
 }
コード例 #2
0
 private void nullFilterTests(Filter filter) throws Exception {
   ((SingleColumnValueFilter) filter).setFilterIfMissing(true);
   KeyValue kv = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, FULLSTRING_1);
   assertTrue("null1", filter.filterKeyValue(kv) == Filter.ReturnCode.INCLUDE);
   assertFalse("null1FilterRow", filter.filterRow());
   filter.reset();
   kv = new KeyValue(ROW, COLUMN_FAMILY, Bytes.toBytes("qual2"), FULLSTRING_2);
   assertTrue("null2", filter.filterKeyValue(kv) == Filter.ReturnCode.INCLUDE);
   assertTrue("null2FilterRow", filter.filterRow());
 }
コード例 #3
0
ファイル: SkipFilter.java プロジェクト: JichengSong/hbase
 public ReturnCode filterKeyValue(KeyValue v) {
   ReturnCode c = filter.filterKeyValue(v);
   changeFR(c != ReturnCode.INCLUDE);
   return c;
 }