HBase之过滤器
filter ==> SQL 中的Where
filter的执行流程:
过滤器在客户端创建,然后通过RPC发送到服务器上,由服务器执行
基础过滤器:
比较器:
Comparator |
Description |
LongComparator |
Assumes the given value array is a Java Long number and uses Bytes.toLong() to convert it. |
BinaryComparator |
Uses Bytes.compareTo() to compare 当前值与阀值 |
BinaryPrefixComparator |
Bytes.compareTo() 进行匹配,但是从左端开始前缀匹配 |
NullComparator |
判断当前值是否为null |
BitComparator |
Performs a bitwise comparison, providing a BitwiseOp enumeration with AND, OR, and XOR operators. |
RegexStringComparator |
正则表达式匹配 |
SubstringComparator |
子字符串比对 |
- RowFilter 行键过滤器:
|
- FamilyFilter列族过滤器:
|
- ValueFilter值过滤器:
|
|
- DependentColumnFilter 参考列过滤器
|
|
- PrefixFilter 前缀过滤器:
|
- PageFilter 分页过滤器
|
|
- KeyOnlyFilter 行键过滤器
-
FirstKeyOnlyFilter 首次行键过滤器
-
FirstKeyValueMatchingQualifiersFilter
- InclusiveStopFilter 包含结束的过滤器
-
FuzzyRowFilter 模糊行匹配过滤器
-
ColumnCountGetFilter 列计数过滤器
可以使用这个过滤器来限制每行最多取回多少列,当一行的列数到设定的最大值,这个过滤器会停止整个扫描操作。
适合在get方法中使用
import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.ColumnCountGetFilter;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
/**
* ColumnCountGetFilter 列数过滤器
*/
public
class
FilterOfColumnCountGetFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
//限制返回的列数
ColumnCountGetFilter columnCountGetFilter =
new
ColumnCountGetFilter(
3
);
// column=info:age,column=info:height,column=info:name,column=info:phone,column=info:weight,
Get get =
new
Get(Bytes.toBytes(
"224382618261914241"
));
get.setFilter(columnCountGetFilter);
Result result = table.get(get);
System.out.println(
"Result of columnCountGetFilter get: "
);
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
Get get1 =
new
Get(Bytes.toBytes(
"224382618261914241"
));
Result result1 = table.get(get1);
System.out.println(
"Result of get: "
);
for
(Cell cell : result1.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
table.close();
connection.close();
}
}
/**
Result of columnCountGetFilter get:
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
Result of get:
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
Cell: 224382618261914241/info:phone/1472196211427/Put/vlen=11/seqid=0, Value: 13213921424
Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
Cell: 224382618261914241/ship:salary/1472196211594/Put/vlen=4/seqid=0, Value: 5000
**/
-
ColumnPaginationFilter 列分页过滤
HBase 的列可以很多,所以出现了列分页
该过滤器可以对一行的所有列进行分页
limit 限制取回来列数 offset 偏移位就是开始位置 byte[] 字符串/书签偏移从哪里开始分页。构造函数: ColumnPaginationFilter(int limit, int offset) ColumnPaginationFilter(int limit, byte[] columnOffset)
import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.ColumnPaginationFilter;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
/**
* ColumnPageFilter 列分页过滤器
*/
public
class
FilterOColumnPageFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
//限制返回的列数 从第4列开始取 取3列数据
ColumnPaginationFilter columnPaginationFilter =
new
ColumnPaginationFilter(
3
,
4
);
Get get =
new
Get(Bytes.toBytes(
"224382618261914241"
));
get.setFilter(columnPaginationFilter);
Result result = table.get(get);
System.out.println(
"Result of ColumnPageFilter get: "
);
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
//限制返回的列数 从第name列开始取 取3列数据
ColumnPaginationFilter columnPaginationFilter2 =
new
ColumnPaginationFilter(
3
,Bytes.toBytes(
"name"
));
Get get2 =
new
Get(Bytes.toBytes(
"224382618261914241"
));
get2.setFilter(columnPaginationFilter2);
Result result2 = table.get(get2);
System.out.println(
"Result of ColumnPageFilter get: "
);
for
(Cell cell : result2.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
Get get1 =
new
Get(Bytes.toBytes(
"224382618261914241"
));
Result result1 = table.get(get1);
System.out.println(
"Result of get: "
);
for
(Cell cell : result1.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
table.close();
connection.close();
}
}
/**
Result of ColumnPageFilter get:
Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
Result of ColumnPageFilter get:
Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
Cell: 224382618261914241/info:phone/1472196211427/Put/vlen=11/seqid=0, Value: 13213921424
Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
Result of get:
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
Cell: 224382618261914241/info:phone/1472196211427/Put/vlen=11/seqid=0, Value: 13213921424
Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
Cell: 224382618261914241/ship:salary/1472196211594/Put/vlen=4/seqid=0, Value: 5000
**/
-
ColumnPrefixFilter 列前缀过虑器
该过滤器通过对列名称进行前缀匹配过滤import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.ColumnPrefixFilter;
import
org.apache.hadoop.hbase.filter.Filter;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
/**
* ColumnPrefixFilter 列前缀过滤器
*/
public
class
FilterOfColumnPrefixFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
//取列名已ag开头的
Filter columnPrefixFilter =
new
ColumnPrefixFilter(Bytes.toBytes(
"a"
));
Get get =
new
Get(Bytes.toBytes(
"224382618261914241"
));
get.setFilter(columnPrefixFilter);
Result result = table.get(get);
System.out.println(
"Result of columnPrefixFilter get: "
);
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
Get get1 =
new
Get(Bytes.toBytes(
"224382618261914241"
));
Result result1 = table.get(get1);
System.out.println(
"Result of get: "
);
for
(Cell cell : result1.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
table.close();
connection.close();
}
}
/**
Result of columnPrefixFilter get:
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
Result of get:
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
Cell: 224382618261914241/info:phone/1472196211427/Put/vlen=11/seqid=0, Value: 13213921424
Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
Cell: 224382618261914241/ship:salary/1472196211594/Put/vlen=4/seqid=0, Value: 5000
**/
-
MultipleColumnPrefixFilter 多个列前缀过滤器
import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.Filter;
import
org.apache.hadoop.hbase.filter.MultipleColumnPrefixFilter;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
/**
* MultipleColumnPrefixFilter 多个列前缀过滤器
*/
public
class
FilterOfMultipleColumnPrefixFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
//取列名已a开头的 还有已h 开头的
Filter filter =
new
MultipleColumnPrefixFilter(
new
byte
[][] {Bytes.toBytes(
"a"
),Bytes.toBytes(
"h"
)});
Get get =
new
Get(Bytes.toBytes(
"224382618261914241"
));
get.setFilter(filter);
Result result = table.get(get);
System.out.println(
"Result of columnPrefixFilter get: "
);
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
Get get1 =
new
Get(Bytes.toBytes(
"224382618261914241"
));
Result result1 = table.get(get1);
System.out.println(
"Result of get: "
);
for
(Cell cell : result1.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
table.close();
connection.close();
}
}
/**
Result of columnPrefixFilter get:
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
Result of get:
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
Cell: 224382618261914241/info:phone/1472196211427/Put/vlen=11/seqid=0, Value: 13213921424
Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
Cell: 224382618261914241/ship:salary/1472196211594/Put/vlen=4/seqid=0, Value: 5000
**/
-
ColumnRangeFilter 列范围过滤器
import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.ColumnRangeFilter;
import
org.apache.hadoop.hbase.filter.Filter;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
/**
* ColumnRangeFilter 列范围过滤器
*/
public
class
FilterOfColumnRangeFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
//minColumn - minimum value for the column range. If if it's null, there is no lower bound.
//minColumnInclusive - if true, include minColumn in the range. 如果是true 就要包含minColumn
//maxColumn - maximum value for the column range. If it's null,
//maxColumnInclusive - if true, include maxColumn in the range. there is no upper bound.
//从email到phone范围内的所有列 第二个参数为true所以包含了email <br> Filter filter = new ColumnRangeFilter(Bytes.toBytes("email"), true, Bytes.toBytes("phone"), false);
Get get =
new
Get(Bytes.toBytes(
"224382618261914241"
));
get.setFilter(filter);
Result result = table.get(get);
System.out.println(
"Result of ColumnRangeFilter get: "
);
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
Get get1 =
new
Get(Bytes.toBytes(
"224382618261914241"
));
Result result1 = table.get(get1);
System.out.println(
"Result of get: "
);
for
(Cell cell : result1.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
table.close();
connection.close();
}
}
/**
Result of ColumnRangeFilter get:
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
Result of get:
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
Cell: 224382618261914241/info:phone/1472196211427/Put/vlen=11/seqid=0, Value: 13213921424
Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
Cell: 224382618261914241/ship:salary/1472196211594/Put/vlen=4/seqid=0, Value: 5000
2016-08-31 17:53:28,394 INFO [main] client.ConnectionManager$HConnectionImplementati
**/
-
SingleColumnValueFilter 单列值过滤器
用一列的值决定是否一行数据被过滤import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.CompareFilter;
import
org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
import
org.apache.hadoop.hbase.filter.SubstringComparator;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
/**
* SingleColumnValueFilter 单列过滤器
*/
public
class
FilterOfSingleColumnValueFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
// 510824118261011172 column=ship:email, timestamp=1472196213422, aaa@qq.com
SingleColumnValueFilter singleColumnValueFilter =
new
SingleColumnValueFilter(Bytes.toBytes(
"ship"
),Bytes.toBytes(
"email"
), CompareFilter.CompareOp.EQUAL,
new
SubstringComparator(
"aaa@qq.com"
));
singleColumnValueFilter.setFilterIfMissing(
true
);
Scan scan =
new
Scan();
scan.setFilter(singleColumnValueFilter);
ResultScanner results = table.getScanner(scan);
for
(Result result:results){
for
(Cell cell :result.rawCells()){
System.out.println(
"Cell: "
+cell+
",Value:"
+ Bytes.toString(cell.getValueArray(),cell.getValueOffset(), cell.getValueLength()));
}
}
results.close();
// 224382618261914241 column=ship:email, timestamp=1472196211530, aaa@qq.com
Get get =
new
Get(Bytes.toBytes(
"224382618261914241"
));
get.setFilter(singleColumnValueFilter);
Result result = table.get(get);
System.out.println(
"Result of get: "
);
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
Get get1 =
new
Get(Bytes.toBytes(
"510824118261011172"
));
get1.setFilter(singleColumnValueFilter);
Result result1 = table.get(get1);
System.out.println(
"Result of get1: "
);
for
(Cell cell : result1.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
table.close();
connection.close();
}
}
/**
Cell: 510824118261011172/info:age/1472196213020/Put/vlen=2/seqid=0,Value:18
Cell: 510824118261011172/info:height/1472196213056/Put/vlen=3/seqid=0,Value:188
Cell: 510824118261011172/info:name/1472196212942/Put/vlen=8/seqid=0,Value:yangyang
Cell: 510824118261011172/info:phone/1472196213237/Put/vlen=11/seqid=0,Value:18013921626
Cell: 510824118261011172/info:weight/1472196213169/Put/vlen=3/seqid=0,Value:138
Cell: 510824118261011172/ship:addr/1472196213328/Put/vlen=8/seqid=0,Value:shanghai
Cell: 510824118261011172/ship:email/1472196213422/Put/vlen=12/seqid=0,Value:aaa@qq.com
Cell: 510824118261011172/ship:salary/1472196214963/Put/vlen=5/seqid=0,Value:50000
Result of get:
Result of get1:
Cell: 510824118261011172/info:age/1472196213020/Put/vlen=2/seqid=0, Value: 18
Cell: 510824118261011172/info:height/1472196213056/Put/vlen=3/seqid=0, Value: 188
Cell: 510824118261011172/info:name/1472196212942/Put/vlen=8/seqid=0, Value: yangyang
Cell: 510824118261011172/info:phone/1472196213237/Put/vlen=11/seqid=0, Value: 18013921626
Cell: 510824118261011172/info:weight/1472196213169/Put/vlen=3/seqid=0, Value: 138
Cell: 510824118261011172/ship:addr/1472196213328/Put/vlen=8/seqid=0, Value: shanghai
Cell: 510824118261011172/ship:email/1472196213422/Put/vlen=12/seqid=0, Value: aaa@qq.com
Cell: 510824118261011172/ship:salary/1472196214963/Put/vlen=5/seqid=0, Value: 50000
**/
-
SingleColumnValueExcludeFilter 单列排除过滤器
单列排除过滤器继承自SingleColumnValueFilter,过滤的方式还是按照SingleColumnValueFilter去过滤,
但是最后的结果集去除了作为过滤条件的列// 510824118261011172 column=ship:email, timestamp=1472196213422, aaa@qq.com
SingleColumnValueExcludeFilter singleColumnValueExcludeFilter =
new
SingleColumnValueExcludeFilter(Bytes.toBytes(
"ship"
),Bytes.toBytes(
"email"
), CompareFilter.CompareOp.EQUAL,
new
SubstringComparator(
"aaa@qq.com"
));
singleColumnValueExcludeFilter.setFilterIfMissing(
true
);
Scan scan =
new
Scan();
scan.setFilter(singleColumnValueExcludeFilter);
ResultScanner results = table.getScanner(scan);
for
(Result result:results){
for
(Cell cell :result.rawCells()){
System.out.println(
"Cell: "
+cell+
",Value:"
+ Bytes.toString(cell.getValueArray(),cell.getValueOffset(), cell.getValueLength()));
}
}
results.close();
// 224382618261914241 column=ship:email, timestamp=1472196211530, aaa@qq.com
Get get =
new
Get(Bytes.toBytes(
"224382618261914241"
));
get.setFilter(singleColumnValueExcludeFilter);
Result result = table.get(get);
System.out.println(
"Result of get: "
);
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
Get get1 =
new
Get(Bytes.toBytes(
"510824118261011172"
));
get1.setFilter(singleColumnValueExcludeFilter);
Result result1 = table.get(get1);
System.out.println(
"Result of get1: "
);
for
(Cell cell : result1.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
/**
* Cell: 510824118261011172/info:age/1472196213020/Put/vlen=2/seqid=0,Value:18
Cell: 510824118261011172/info:height/1472196213056/Put/vlen=3/seqid=0,Value:188
Cell: 510824118261011172/info:name/1472196212942/Put/vlen=8/seqid=0,Value:yangyang
Cell: 510824118261011172/info:phone/1472196213237/Put/vlen=11/seqid=0,Value:18013921626
Cell: 510824118261011172/info:weight/1472196213169/Put/vlen=3/seqid=0,Value:138
Cell: 510824118261011172/ship:addr/1472196213328/Put/vlen=8/seqid=0,Value:shanghai
Cell: 510824118261011172/ship:salary/1472196214963/Put/vlen=5/seqid=0,Value:50000
Result of get:
Result of get1:
Cell: 510824118261011172/info:age/1472196213020/Put/vlen=2/seqid=0, Value: 18
Cell: 510824118261011172/info:height/1472196213056/Put/vlen=3/seqid=0, Value: 188
Cell: 510824118261011172/info:name/1472196212942/Put/vlen=8/seqid=0, Value: yangyang
Cell: 510824118261011172/info:phone/1472196213237/Put/vlen=11/seqid=0, Value: 18013921626
Cell: 510824118261011172/info:weight/1472196213169/Put/vlen=3/seqid=0, Value: 138
Cell: 510824118261011172/ship:addr/1472196213328/Put/vlen=8/seqid=0, Value: shanghai
Cell: 510824118261011172/ship:salary/1472196214963/Put/vlen=5/seqid=0, Value: 50000
*/
- TimestampsFilter 时间过滤器
使用时间戳的值来过滤值import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.Filter;
import
org.apache.hadoop.hbase.filter.TimestampsFilter;
import
java.io.IOException;
import
java.util.ArrayList;
import
java.util.List;
/**
* TimestampsFilter 时间过滤器
*/
public
class
FilterOfTimestampsFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
List<Long> ts =
new
ArrayList<Long>();
ts.add(
new
Long(
"1472196195270"
));
ts.add(
new
Long(
"1472196212480"
));
ts.add(
new
Long(
15
));
Filter filter =
new
TimestampsFilter(ts);
Scan scan1 =
new
Scan();
scan1.setFilter(filter);
ResultScanner scanner1 = table.getScanner(scan1);
for
(Result result:scanner1){
System.out.println(result);
}
scanner1.close();
Scan scan2 =
new
Scan();
scan2.setFilter(filter);
//加了时间范围 故意多加了1s 1472196212480+1=1472196212481
scan2.setTimeRange(1472196195271L, 1472196212481L);
ResultScanner scanner2 = table.getScanner(scan2);
System.out.println(
"Add time range:"
);
for
(Result result : scanner2) {
System.out.println(result);
}
scanner2.close();
}
}
/**
keyvalues={524382618264914241/ship:addr/1472196195270/Put/vlen=7/seqid=0}
keyvalues={813782218261011172/info:name/1472196212480/Put/vlen=8/seqid=0}
Add time range:
keyvalues={813782218261011172/info:name/1472196212480/Put/vlen=8/seqid=0}
**/
-
RandomRowFilter 随机行过滤器
import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.Filter;
import
org.apache.hadoop.hbase.filter.RandomRowFilter;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
/**
* RandomRowFilter 随机行过滤器
*/
public
class
FilterOfRandomRowFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
//该构造参数0-1之间,如果为负数全部过滤,大于1全部通过 0.2f表的该行数据20%的概率通过
Filter filter =
new
RandomRowFilter(
0
.2f);
Scan scan =
new
Scan();
scan.setFilter(filter);
ResultScanner results = table.getScanner(scan);
for
(Result result:results) {
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
}
table.close();
connection.close();
}
}
/**
Cell: 510824118261011172/info:age/1472196213020/Put/vlen=2/seqid=0, Value: 18
Cell: 510824118261011172/info:height/1472196213056/Put/vlen=3/seqid=0, Value: 188
Cell: 510824118261011172/info:name/1472196212942/Put/vlen=8/seqid=0, Value: yangyang
Cell: 510824118261011172/info:phone/1472196213237/Put/vlen=11/seqid=0, Value: 18013921626
Cell: 510824118261011172/info:weight/1472196213169/Put/vlen=3/seqid=0, Value: 138
Cell: 510824118261011172/ship:addr/1472196213328/Put/vlen=8/seqid=0, Value: shanghai
Cell: 510824118261011172/ship:email/1472196213422/Put/vlen=12/seqid=0, Value: aaa@qq.com
Cell: 510824118261011172/ship:salary/1472196214963/Put/vlen=5/seqid=0, Value: 50000
**/
- Decorating Filters 装饰过滤器或附加过滤器
-
SkipFilter 跳过过滤器 根据构造器中的过滤器为基准跳过行
import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.*;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
/**
* SkipFilter 跳过(忽略)过滤器
* similarface
* aaa@qq.com
*/
public
class
FilterOfSkipFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
//510824118261011172 column=info:height, timestamp=1472196213056, value=188
//673782618261019142 column=info:weight, timestamp=1472196211841, value=188
//如果列值中含有188这个数值,那么这列将会跳过
Filter filter =
new
ValueFilter(CompareFilter.CompareOp.NOT_EQUAL,
new
BinaryComparator(Bytes.toBytes(
"188"
)));
Scan scan =
new
Scan();
scan.setFilter(filter);
ResultScanner results = table.getScanner(scan);
for
(Result result:results) {
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
}
Scan scan1 =
new
Scan();
//skipfilter的构造参数时filter
// filter==>如果列值中含有188这个数值,那么这列将会跳过 filter2==>就是如果列值中含有188这个数值那么整个行都会被跳过 表示不会出现[510824118261011172,673782618261019142]
Filter filter2 =
new
SkipFilter(filter);
scan1.setFilter(filter2);
ResultScanner scanner2= table.getScanner(scan1);
for
(Result result:scanner2){
for
(Cell cell : result.rawCells()) {
System.out.println(
"SKIP Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
}
results.close();
scanner2.close();
table.close();
connection.close();
}
}
/**
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
Cell: 224382618261914241/info:phone/1472196211427/Put/vlen=11/seqid=0, Value: 13213921424
Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
Cell: 224382618261914241/ship:salary/1472196211594/Put/vlen=4/seqid=0, Value: 5000
Cell: 510824118261011172/info:age/1472196213020/Put/vlen=2/seqid=0, Value: 18
Cell: 510824118261011172/info:name/1472196212942/Put/vlen=8/seqid=0, Value: yangyang
Cell: 510824118261011172/info:phone/1472196213237/Put/vlen=11/seqid=0, Value: 18013921626
Cell: 510824118261011172/info:weight/1472196213169/Put/vlen=3/seqid=0, Value: 138
Cell: 510824118261011172/ship:addr/1472196213328/Put/vlen=8/seqid=0, Value: shanghai
Cell: 510824118261011172/ship:email/1472196213422/Put/vlen=12/seqid=0, Value: aaa@qq.com
Cell: 510824118261011172/ship:salary/1472196214963/Put/vlen=5/seqid=0, Value: 50000
Cell: 524382618264914241/info:age/1472196193913/Put/vlen=2/seqid=0, Value: 30
Cell: 524382618264914241/info:height/1472196194783/Put/vlen=3/seqid=0, Value: 168
Cell: 524382618264914241/info:name/1472196193255/Put/vlen=8/seqid=0, Value: zhangsan
Cell: 524382618264914241/info:phone/1472196195125/Put/vlen=11/seqid=0, Value: 13212321424
Cell: 524382618264914241/info:weight/1472196194970/Put/vlen=3/seqid=0, Value: 168
Cell: 524382618264914241/ship:addr/1472196195270/Put/vlen=7/seqid=0, Value: beijing
Cell: 524382618264914241/ship:email/1472196195371/Put/vlen=13/seqid=0, Value: aaa@qq.com
Cell: 524382618264914241/ship:salary/1472196195485/Put/vlen=4/seqid=0, Value: 3000
Cell: 673782618261019142/info:age/1472196211733/Put/vlen=2/seqid=0, Value: 19
Cell: 673782618261019142/info:height/1472196211761/Put/vlen=3/seqid=0, Value: 178
Cell: 673782618261019142/info:name/1472196211678/Put/vlen=7/seqid=0, Value: zhaoliu
Cell: 673782618261019142/info:phone/1472196211956/Put/vlen=11/seqid=0, Value: 17713921424
Cell: 673782618261019142/ship:addr/1472196212059/Put/vlen=8/seqid=0, Value: shenzhen
Cell: 673782618261019142/ship:email/1472196212176/Put/vlen=12/seqid=0, Value: aaa@qq.comina.com
Cell: 673782618261019142/ship:salary/1472196212284/Put/vlen=4/seqid=0, Value: 8000
Cell: 813782218261011172/info:age/1472196212550/Put/vlen=2/seqid=0, Value: 19
Cell: 813782218261011172/info:height/1472196212605/Put/vlen=3/seqid=0, Value: 158
Cell: 813782218261011172/info:name/1472196212480/Put/vlen=8/seqid=0, Value: wangmazi
Cell: 813782218261011172/info:phone/1472196212713/Put/vlen=11/seqid=0, Value: 12713921424
Cell: 813782218261011172/info:weight/1472196212651/Put/vlen=3/seqid=0, Value: 118
Cell: 813782218261011172/ship:addr/1472196212762/Put/vlen=4/seqid=0, Value: xian
Cell: 813782218261011172/ship:email/1472196212802/Put/vlen=12/seqid=0, Value: aaa@qq.com
Cell: 813782218261011172/ship:salary/1472196212840/Put/vlen=5/seqid=0, Value: 10000
SKIP Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
SKIP Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
SKIP Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
SKIP Cell: 224382618261914241/info:phone/1472196211427/Put/vlen=11/seqid=0, Value: 13213921424
SKIP Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
SKIP Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
SKIP Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
SKIP Cell: 224382618261914241/ship:salary/1472196211594/Put/vlen=4/seqid=0, Value: 5000
SKIP Cell: 524382618264914241/info:age/1472196193913/Put/vlen=2/seqid=0, Value: 30
SKIP Cell: 524382618264914241/info:height/1472196194783/Put/vlen=3/seqid=0, Value: 168
SKIP Cell: 524382618264914241/info:name/1472196193255/Put/vlen=8/seqid=0, Value: zhangsan
SKIP Cell: 524382618264914241/info:phone/1472196195125/Put/vlen=11/seqid=0, Value: 13212321424
SKIP Cell: 524382618264914241/info:weight/1472196194970/Put/vlen=3/seqid=0, Value: 168
SKIP Cell: 524382618264914241/ship:addr/1472196195270/Put/vlen=7/seqid=0, Value: beijing
SKIP Cell: 524382618264914241/ship:email/1472196195371/Put/vlen=13/seqid=0, Value: aaa@qq.com
SKIP Cell: 524382618264914241/ship:salary/1472196195485/Put/vlen=4/seqid=0, Value: 3000
SKIP Cell: 813782218261011172/info:age/1472196212550/Put/vlen=2/seqid=0, Value: 19
SKIP Cell: 813782218261011172/info:height/1472196212605/Put/vlen=3/seqid=0, Value: 158
SKIP Cell: 813782218261011172/info:name/1472196212480/Put/vlen=8/seqid=0, Value: wangmazi
SKIP Cell: 813782218261011172/info:phone/1472196212713/Put/vlen=11/seqid=0, Value: 12713921424
SKIP Cell: 813782218261011172/info:weight/1472196212651/Put/vlen=3/seqid=0, Value: 118
SKIP Cell: 813782218261011172/ship:addr/1472196212762/Put/vlen=4/seqid=0, Value: xian
SKIP Cell: 813782218261011172/ship:email/1472196212802/Put/vlen=12/seqid=0, Value: aaa@qq.com
SKIP Cell: 813782218261011172/ship:salary/1472196212840/Put/vlen=5/seqid=0, Value: 10000
**/
-
WhileMatchFilter 当匹配到就中断扫描
import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.*;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
/**
* WhileMatchFilter 全匹配过滤器 [当匹配到就中断扫描]
* similarface
* aaa@qq.com
*/
public
class
FilterOfWhileMatchFilter {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
//匹配 510824118261011172 的行
Filter filter1=
new
RowFilter(CompareFilter.CompareOp.NOT_EQUAL,
new
BinaryComparator(Bytes.toBytes(
"510824118261011172"
)));
Scan scan =
new
Scan();
scan.setFilter(filter1);
ResultScanner results = table.getScanner(scan);
for
(Result result:results) {
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
}
// 匹配 510824118261011172 的行马上中断本次扫描操作
Filter filter2 =
new
WhileMatchFilter(filter1);
Scan scan1 =
new
Scan();
scan1.setFilter(filter2);
ResultScanner scanner2= table.getScanner(scan1);
for
(Result result:scanner2){
for
(Cell cell : result.rawCells()) {
System.out.println(
"WhileMatchFilter Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
}
results.close();
scanner2.close();
table.close();
connection.close();
}
}
/**
Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
...
Cell: 524382618264914241/ship:addr/1472196195270/Put/vlen=7/seqid=0, Value: beijing
Cell: 524382618264914241/ship:email/1472196195371/Put/vlen=13/seqid=0, Value: aaa@qq.com
...
Cell: 813782218261011172/ship:salary/1472196212840/Put/vlen=5/seqid=0, Value: 10000
WhileMatchFilter Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
...
WhileMatchFilter Cell: 224382618261914241/ship:salary/1472196211594/Put/vlen=4/seqid=0, Value: 5000
**/
-
FilterList 过滤列表[多个过滤器一起起作用]
import
org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.hbase.Cell;
import
org.apache.hadoop.hbase.HBaseConfiguration;
import
org.apache.hadoop.hbase.TableName;
import
org.apache.hadoop.hbase.client.*;
import
org.apache.hadoop.hbase.filter.*;
import
org.apache.hadoop.hbase.util.Bytes;
import
java.io.IOException;
import
java.util.ArrayList;
import
java.util.List;
/**
* FilterList 过滤器列表[多个过滤器组合在一起]
* similarface
* aaa@qq.com
*/
public
class
FilterOfFilterList {
public
static
void
main(String args[])
throws
IOException{
Configuration configuration = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(
"user"
));
List<Filter> filters =
new
ArrayList<Filter>();
Filter filter1=
new
RowFilter(CompareFilter.CompareOp.GREATER_OR_EQUAL,
new
BinaryComparator(Bytes.toBytes(
"524382618264914241"
)));
filters.add(filter1);
Filter filter2=
new
RowFilter(CompareFilter.CompareOp.LESS_OR_EQUAL,
new
BinaryComparator(Bytes.toBytes(
"813782218261011172"
)));
filters.add(filter2);
//列名过滤器
Filter filter3=
new
QualifierFilter(CompareFilter.CompareOp.EQUAL,
new
RegexStringComparator(
"age"
));
filters.add(filter3);
//行键 Between "524382618264914241" and "813782218261011172" and column="age"
FilterList filterList1 =
new
FilterList(filters);
Scan scan =
new
Scan();
scan.setFilter(filterList1);
ResultScanner results = table.getScanner(scan);
for
(Result result:results) {
for
(Cell cell : result.rawCells()) {
System.out.println(
"Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
}
results.close();
//行键 Between "524382618264914241" or "813782218261011172" or column="age"
FilterList filterList2 =
new
FilterList(FilterList.Operator.MUST_PASS_ONE,filters);
scan.setFilter(filterList2);
ResultScanner scanner2= table.getScanner(scan);
for
(Result result:scanner2){
for
(Cell cell : result.rawCells()) {
System.out.println(
"MUST_PASS_ONE Cell: "
+ cell +
", Value: "
+
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
}
}
scanner2.close();
table.close();
connection.close();
}
}
/**
Cell: 524382618264914241/info:age/1472196193913/Put/vlen=2/seqid=0, Value: 30
Cell: 673782618261019142/info:age/1472196211733/Put/vlen=2/seqid=0, Value: 19
Cell: 813782218261011172/info:age/1472196212550/Put/vlen=2/seqid=0, Value: 19
MUST_PASS_ONE Cell: 224382618261914241/info:age/1472196211169/Put/vlen=2/seqid=0, Value: 24
MUST_PASS_ONE Cell: 224382618261914241/info:height/1472196211234/Put/vlen=3/seqid=0, Value: 158
MUST_PASS_ONE Cell: 224382618261914241/info:name/1472196211088/Put/vlen=4/seqid=0, Value: lisi
MUST_PASS_ONE Cell: 224382618261914241/info:phone/1472196211427/Put/vlen=11/seqid=0, Value: 13213921424
MUST_PASS_ONE Cell: 224382618261914241/info:weight/1472196211386/Put/vlen=3/seqid=0, Value: 128
MUST_PASS_ONE Cell: 224382618261914241/ship:addr/1472196211487/Put/vlen=7/seqid=0, Value: chengdu
MUST_PASS_ONE Cell: 224382618261914241/ship:email/1472196211530/Put/vlen=11/seqid=0, Value: aaa@qq.com
MUST_PASS_ONE Cell: 224382618261914241/ship:salary/1472196211594/Put/vlen=4/seqid=0, Value: 5000
MUST_PASS_ONE Cell: 510824118261011172/info:age/1472196213020/Put/vlen=2/seqid=0, Value: 18
MUST_PASS_ONE Cell: 510824118261011172/info:height/1472196213056/Put/vlen=3/seqid=0, Value: 188
MUST_PASS_ONE Cell: 510824118261011172/info:name/1472196212942/Put/vlen=8/seqid=0, Value: yangyang
MUST_PASS_ONE Cell: 510824118261011172/info:phone/1472196213237/Put/vlen=11/seqid=0, Value: 18013921626
MUST_PASS_ONE Cell: 510824118261011172/info:weight/1472196213169/Put/vlen=3/seqid=0, Value: 138
MUST_PASS_ONE Cell: 510824118261011172/ship:addr/1472196213328/Put/vlen=8/seqid=0, Value: shanghai
MUST_PASS_ONE Cell: 510824118261011172/ship:email/1472196213422/Put/vlen=12/seqid=0, Value: aaa@qq.com
MUST_PASS_ONE Cell: 510824118261011172/ship:salary/1472196214963/Put/vlen=5/seqid=0, Value: 50000
MUST_PASS_ONE Cell: 524382618264914241/info:age/1472196193913/Put/vlen=2/seqid=0, Value: 30
MUST_PASS_ONE Cell: 524382618264914241/info:height/1472196194783/Put/vlen=3/seqid=0, Value: 168
MUST_PASS_ONE Cell: 524382618264914241/info:name/1472196193255/Put/vlen=8/seqid=0, Value: zhangsan
MUST_PASS_ONE Cell: 524382618264914241/info:phone/1472196195125/Put/vlen=11/seqid=0, Value: 13212321424
MUST_PASS_ONE Cell: 524382618264914241/info:weight/1472196194970/Put/vlen=3/seqid=0, Value: 168
MUST_PASS_ONE Cell: 524382618264914241/ship:addr/1472196195270/Put/vlen=7/seqid=0, Value: beijing
MUST_PASS_ONE Cell: 524382618264914241/ship:email/1472196195371/Put/vlen=13/seqid=0, Value: aaa@qq.com
MUST_PASS_ONE Cell: 524382618264914241/ship:salary/1472196195485/Put/vlen=4/seqid=0, Value: 3000
MUST_PASS_ONE Cell: 673782618261019142/info:age/1472196211733/Put/vlen=2/seqid=0, Value: 19
MUST_PASS_ONE Cell: 673782618261019142/info:height/1472196211761/Put/vlen=3/seqid=0, Value: 178
MUST_PASS_ONE Cell: 673782618261019142/info:name/1472196211678/Put/vlen=7/seqid=0, Value: zhaoliu
MUST_PASS_ONE Cell: 673782618261019142/info:phone/1472196211956/Put/vlen=11/seqid=0, Value: 17713921424
MUST_PASS_ONE Cell: 673782618261019142/info:weight/1472196211841/Put/vlen=3/seqid=0, Value: 188
MUST_PASS_ONE Cell: 673782618261019142/ship:addr/1472196212059/Put/vlen=8/seqid=0, Value: shenzhen
MUST_PASS_ONE Cell: 673782618261019142/ship:email/1472196212176/Put/vlen=12/seqid=0, Value: aaa@qq.com
MUST_PASS_ONE Cell: 673782618261019142/ship:salary/1472196212284/Put/vlen=4/seqid=0, Value: 8000
MUST_PASS_ONE Cell: 813782218261011172/info:age/1472196212550/Put/vlen=2/seqid=0, Value: 19
MUST_PASS_ONE Cell: 813782218261011172/info:height/1472196212605/Put/vlen=3/seqid=0, Value: 158
MUST_PASS_ONE Cell: 813782218261011172/info:name/1472196212480/Put/vlen=8/seqid=0, Value: wangmazi
MUST_PASS_ONE Cell: 813782218261011172/info:phone/1472196212713/Put/vlen=11/seqid=0, Value: 12713921424
MUST_PASS_ONE Cell: 813782218261011172/info:weight/1472196212651/Put/vlen=3/seqid=0, Value: 118
MUST_PASS_ONE Cell: 813782218261011172/ship:addr/1472196212762/Put/vlen=4/seqid=0, Value: xian
MUST_PASS_ONE Cell: 813782218261011172/ship:email/1472196212802/Put/vlen=12/seqid=0, Value: aaa@qq.com
MUST_PASS_ONE Cell: 813782218261011172/ship:salary/1472196212840/Put/vlen=5/seqid=0, Value: 10000
**/
- Custom Filters
- Custom Filter Loading