您好,登錄后才能下訂單哦!
一、FilterList
// 通過將operator參數設置為Operator.MUST_PASS_ONE,達到list中各filter為"或"的關系 or // 默認operator參數的值為Operator.MUST_PASS_ALL,即list中各filter為"并"的關系 and FilterList f=new FilterList(FilterList.Operator.MUST_PASS_ONE);
二、幾大Filter
1、Comparision Filters
1.1 RowFilter √
1.2 FamilyFilter √
1.3 QualifierFilter √
1.4 ValueFilter √
1.5 DependentColumnFilter ×
2、Dedicated Filters
2.1 SingleColumnValueFilter ×
2.2 SingleColumnValueExcludeFilter ×
2.3 PrefixFilter ×
2.4 PageFilter ×
2.5 KeyOnlyFilter ×
2.6 FirstKeyOnlyFilter ×
2.7 TimestampsFilter ×
2.8 RandomRowFilter ×
3、Decorating Filters
3.1 SkipFilter ×
3.2 WhileMatchFilters ×
1.1 RowFilter
格式:RowFilter(CompareFilter.CompareOp rowCompareOp, ByteArrayComparable rowComparator)
參數一 Operator Description
LESS 小于
LESS_OR_EQUAL 小于等于
EQUAL 等于
NOT_EQUAL 不等于
GREATER_OR_EQUAL 大于等于
GREATER 大于
NO_OP 排除所有
參數二 ByteArrayComparable 可用
BinaryComparator, BinaryPrefixComparator, BitComparator, LongComparator, NullComparator, RegexStringComparator, SubstringComparator
例子:Filter filter=new RowFilter(CompareOp.EQUAL, new BinaryComparator(Bytes.toBytes(RowKey))
相關的過濾方法使用:
提取rowkey以01結尾數據--正則表達式
Filter filter = new RowFilter(CompareFilter.CompareOp.EQUAL,new RegexStringComparator(".*01$"));
提取rowkey以包含201407的數據
Filter filter = new RowFilter(CompareFilter.CompareOp.EQUAL,new SubstringComparator("201407"));
提取rowkey以123開頭的數據
Filter filter = new RowFilter(CompareFilter.CompareOp.EQUAL,new BinaryPrefixComparator("123".getBytes()));
提取rowkey小于等于row010的行
Filter filter1 = new RowFilter(CompareFilter.CompareOp.LESS_OR_EQUAL,new BinaryComparator("row010".getBytes()));
1.2 FamilyFilter(同上)
1.3 QualifierFilter(同上)--------當列為數字,不管用了?why--------
1.4 ValueFilter(同上)
1.5 DependentColumnFilter 未完待續!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。