hindex 介绍
hindex 是华为公司开发的纯 Java 编写的 HBase 二级索引,兼容 Apache HBase 0.94.8。
当前的特性如下:
-
多个表索引
-
多个列索引
-
基于部分列值的索引
-
使用索引扫描等于和范围条件
-
批量加载数据来索引表(索引完成批量加载)
工作原理
HBase 二级索引是 100% 服务端实现的。
Put 操作
E.g.:
Table –> tab1 column family –> cf
Index –> idx1, cf1:c1 and idx2, cf1:c2
Index table –> tab1_idx (user table name with suffix “_idx” )
扫描操作
使用
IndexedHTableDescriptor htd = new IndexedHTableDescriptor(usertableName); IndexSpecification iSpec = new IndexSpecification(indexName); HColumnDescriptor hcd = new HColumnDescriptor(columnFamily); iSpec.addindexColumn(hcd, indexColumnQualifier, ValueType.String, 10); htd.addFamily(hcd); htd.addindex(iSpec); admin.createTable(htd);
未来会实现的功能:
hindex 官网
https://github.com/Huawei-Hadoop/hindex
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。