Hbase的常见filter

内置filter

Hbase的常见filter

自定义filter

需要继承FilterBase类并实现以下办法

//根据row key过滤row。如果需要被过滤掉,返回true;需要返回给客户端,返回false
boolean filterRowKey(Cell cell)	
//ReturnCode在Filter接口中定义的枚举类型,决定是否要包括该cell对象
ReturnCode filterKeyValue(Cell v)	
(A way to filter based on the column family, column qualifier and/or the column value)
//方法传入通过filterKeyValue的对象列表,然后在这里对列表里的元素进行任何转换或运算
void filterRowCells(List<Cell> ignored)	
//如果需要过滤掉某些行,那么返回true则过滤掉上面方法正在计算的行
boolean filterRow()
//在过滤器里构建逻辑来提前停止一次扫描。
//例如:在扫描很多行时,在行键、列限定符、单元值里找指定东西时,一旦找到目标,就不必关心剩下的行,可使用这个方法过滤	
boolean filterAllRemaining()	

filter的使用