hindexHBase 二級索引
hindex 是華為公司開發(fā)的純 Java 編寫的 HBase 二級索引,兼容 Apache HBase 0.94.8。
當(dāng)前的特性如下:
多個表索引
多個列索引
基于部分列值的索引
使用索引掃描等于和范圍條件
批量加載數(shù)據(jù)來索引表(索引完成批量加載)
工作原理
HBase 二級索引是 100% 服務(wù)端實現(xiàn)的。
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);
未來會實現(xiàn)的功能:
動態(tài)添加和刪除索引
集成 HBase Shell 的二級索引管理
優(yōu)化范圍掃描
HBCK 工具支持二級索引表
WAL 優(yōu)化二級索引條目
使得掃描評估情報可導(dǎo)入導(dǎo)出
評論
圖片
表情
