HBase Filter介绍及执行流程
HBASE过滤器介绍:
所有的过滤器都在服务端生效,叫做谓语下推(predicate push down),这样可以保证被过滤掉的数据不会被传送到客户端。
注意:
基于字符串的比较器,如RegexStringComparator和SubstringComparator,比基于字节的比较器更慢,更消耗资源。因为每次比较时它们都需要将给定的值转化为String.截取字符串子串和正则式的处理也需要花费额外的时间。
过滤器本来的目的是为了筛掉无用的信息,所有基于CompareFilter的过滤处理过程是返回匹配的值。
Interface for row and column filters directly applied within the regionserver. A filter can expect the following call sequence:
- reset() : reset the filter state before filtering a new row.
- filterAllRemaining(): true means row scan is over; false means keep going.
- filterRowKey(byte[],int,int): true means drop this row; false means include.
- filterKeyValue(Cell): decides whether to include or exclude this KeyValue. See Filter.ReturnCode.
- transform(KeyValue): if the KeyValue is included, let the filter transform the KeyValue.
- filterRowCells(List): allows direct modification of the final list to be submitted
- filterRow(): last chance to drop entire row based on the sequence of filter calls. Eg: filter a row if it doesn't contain a specified column.
Filter instances are created one per region/scan. This abstract class replaces the old RowFilterInterface. When implementing your own filters, consider inheriting FilterBase to help you reduce boilerplate.
过滤器实例在每次region/scan时被创建,并且使用抽象类代替了原来的接口。如果你需要实现自定义的过滤器,考虑直接继承FilterBase,来避免许多重复的结构代码。
过滤器执行流程
过滤器属性和它们之间的兼容性

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
hbase:用于实现版本文件及配置同步的两个shell脚本
复制master节点上的版本内容到所有slaves节点上 注意: 1:版本目录做了软链接,如 ln -s hbase-0.94.6 hbase 2: 要根据实际情况,将/usr/local/修改为hbase所在的目录 #!/bin/bash # copy a new release of HBase from the masternode to all slave nodes # Rsyncs HBase files across all slaves. Must run on master. # Assumes all files are located in /usr/local if [ "$#" != "2" ]; then echo "usage: $(basename $0) <dir-name> <ln-name>" echo " example: $(basename $0) hbase-0.1 hbase" exit 1 fi SRC_PATH="/usr/local/$1/conf/regionservers" for srv in ...
- 下一篇
ZeroCopyLiteralByteString cannot access superclass
问题描述 在HBase上运行MapReduce作业时,报如下异常:IllegalAccessError: class com.google.protobuf.HBaseZeroCopyByteString cannot access its superclass com.google.protobuf.LiteralByteString 使用HBase环境如下:CDH5.0.1, HBase版本:0.96.1 问题原因 This isssue occurs because of an optimization introduced inHBASE-9867that inadvertently introduced a classloader dependency. This affects both jobs using the-libjarsoption and "fat jar," jobs which package their runtime dependencies in a nested lib folder. 这个问题的发生是由于优化了HBASE-9867引...
相关文章
文章评论
共有0条评论来说两句吧...