FiltersinHBase(orintrarowscanningpartII)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了FiltersinHBase(orintrarowscanningpartII),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3158字,纯文字阅读大概需要5分钟。
内容图文
![FiltersinHBase(orintrarowscanningpartII)](/upload/InfoBanner/zyjiaocheng/558/f27337fe2a9a4b05ba3501f5e69791b1.jpg)
Filters in HBase are a somewhat obscure and under-documented feature. (Even us committers are often not aware of their usefulness - see HBASE-5229, and HBASE-4256... Or maybe it's just me...). Intras row scanning can be done using ColumnRa
Filters in HBase are a somewhat obscure and under-documented feature. (Even us committers are often not aware of their usefulness - see HBASE-5229, and HBASE-4256... Or maybe it's just me...).Intras row scanning can be done using ColumnRangeFilter. Other filters such as ColumnPrefixFilter or MultipleColumnPrefixFilter might also be handy for this. All three filters have in common that they can provide scanners (see scanning in hbase) with what I will call "seek hints". These hints allow a scanner to seek to the next column, the next row, or an arbitrary next cell determined by the filter. This is far more efficient than having a dumb filter that is passed each cell and determines whether the cell is included in the result or not.
Many other filters also provide these "seek hints". The exception here are filters that filter on column values, as there is no inherent ordering between column values; these filters need to look at the value for each column.
For example check out this code in MultipleColumnPrefixFilter (ASF 2.0 license):
TreeSet<byte []> lesserOrEqualPrefixes =
(TreeSet<byte []>) sortedPrefixes.headSet(qualifier, true);
if (lesserOrEqualPrefixes.size() != 0) {
byte [] largestPrefixSmallerThanQualifier = lesserOrEqualPrefixes.last();
if (Bytes.startsWith(qualifier, largestPrefixSmallerThanQualifier)) {
return ReturnCode.INCLUDE;
}
if (lesserOrEqualPrefixes.size() == sortedPrefixes.size()) {
return ReturnCode.NEXT_ROW;
} else {
hint = sortedPrefixes.higher(largestPrefixSmallerThanQualifier);
return ReturnCode.SEEK_NEXT_USING_HINT;
}
} else {
hint = sortedPrefixes.first();
return ReturnCode.SEEK_NEXT_USING_HINT;
}
(the
See how this code snippet allows the filter to
- seek to the next row if all prefixes are know to be less or equal the current qualifier (and the largest didn't match the passed column qualifier). Note that a single seek to the next row can potentially skip millions of columns with a single seek operation.
- seek to the next larger prefix if there are more prefixes, but the current does not match the qualifier.
- seek to the first prefix (the smallest) if none the prefixes are less or equal to the current qualifier.
I'm in the process of adding more information for these Filter to the HBase
原文地址:Filters in HBase (or intra row scanning part II), 感谢原作者分享。
内容总结
以上是互联网集市为您收集整理的FiltersinHBase(orintrarowscanningpartII)全部内容,希望文章能够帮你解决FiltersinHBase(orintrarowscanningpartII)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。