`
danix800
  • 浏览: 30423 次
  • 性别: Icon_minigender_1
  • 来自: 南京
文章分类
社区版块
存档分类
最新评论

HBase secondary Index

 
阅读更多

hbase-indexed (HBaseIdx)

HBase secondary index using coprocessors

There are several projects providing secondary index for HBase. This is just one of them.

The HBase community has been talking about secondary index using coprocessors for a period of time, but no much progress has been made. This project is the product of my non-busy time.

Features:

0.92 is supported.
region level index.
all index management hooked to coprocessors.
memstore not indexed.
inverted index on byte array.
index stored in HFile.
scan with Filter.

So why this one while there are several choices?

Like IndexedHBase (IHBase), HBaseIdx indexes all rows on region level. RegionObserver per HRegion provides extension point for all those required index management operations. It is non- intrusive extension. There is a EndPoint provided for manually indexing a specific region, too.

Tables that need secondary index can be created with a utility class. You just tell the columns need indexing.

 

HColumnDescriptor colDesc = new HColumnDescriptor(fam1);
IndexedTableUtils.addIndexDescriptor(colDesc,
        new IndexDescriptor(qual1));
IndexedTableUtils.addIndexDescriptor(colDesc,
        new IndexDescriptor(qual2));
HTableDescriptor htd = new HTableDescriptor(tableName);
htd.addFamily(colDesc);

hAdmin.createTable(htd);
 

The indexes are only built when a region flushes (like IHBase), and indexes are written to HFiles.

Indexed scans are based on SingleColumnValueFilter. If a column is indexed, and an attribute of scan is set, HBaseIdx can query on the index HFiles for speeding up.

 

HTable table = ...
Scan scan = new Scan();
Filter f1 = new SingleColumnValueFilter(fam1, qual1,
        CompareOp.EQUAL, Bytes.toBytes(val1));
Filter f1 = new SingleColumnValueFilter(fam1, qual2,
        CompareOp.EQUAL, Bytes.toBytes(val2));
Filter f = new FilterList(Operator.MUST_PASS_ALL, f1, f2);
scan.setFilter(f);
IndexedTableUtils.setIndexedScan(scan, true);

ResultScanner scanner = table.getScanner(scan);
Result r;
while((r = scanner.next()) != null) {
    // ...
}
 

Only BinaryComparator and BinaryPrefixComparator are supported. For the default BinaryComparator, all CompareOp are valid.

分享到:
评论

相关推荐

    hbase创建二级索引

    public class IndexBuilder3 extends Configured{ public static class MapperIndex extends TableMapper,Put>{ private String tableName; private String columnFamily; private String[] qualifiers;...

    HBase_Secondary_Index

    hbase构建二级索引指南,详细介绍了hbase的二级索引的实现机制

    hbase 2级索引

    基于Solr的HBase多条件查询原理很简单,将HBase表中涉及条件过滤的字段和rowkey在Solr中建立索引,通过Solr的多条件查询快速获得符合过滤条件的rowkey值,拿到这些rowkey之后在HBASE中通过指定rowkey进行查询。

    HbaseTemplate 操作hbase

    java 利用 sping-data-hadoop HbaseTemplate 操作hbase find get execute 等方法 可以直接运行

    pinpoint的hbase初始化脚本hbase-create.hbase

    搭建pinpoint需要的hbase初始化脚本hbase-create.hbase

    Hbase 二级索引方案

    于是,针对 HBase Secondary Indexing 的方案出现了。 Solr Solr 是一个独立的企业级搜索应用服务器,是 Apache Lucene 项目的开源企业搜索平台, 其主要功能包括全文检索、命中标示、分面搜索、动态聚类、数据库...

    lysecondindex

    这个怎么运作HBase Secondary Index是具有协处理器的100%服务器端实现,可将索引数据保存在单独的表中。 索引是按区域划分的,并且自定义负载平衡器将索引表区域与实际表区域共置一处。 服务器读取在表创建过程中...

    HBase数据库设计.doc

    1. HBase有哪些基本的特征? 1 HBase特征: 1 2. HBase相对于关系数据库能解决的问题是什么? 2 HBase与关系数据的区别? 2 HBase与RDBMS的区别? 2 3. HBase的数据模式是怎么样的?即有哪些元素?如何存储?等 3 1...

    hbaseSecondaryIndex:hbase二级索引实现

    hbaseSecondaryIndex是一个hbase二级索引的实现,基于solr+hbase coprocessor框架为hbase提供索引表支持。 此工程可打包为一个hbase的插件,通用方便。 这篇文档的目的是为了向您介绍hbaseSecondaryIndex的基本使用...

    HBase(hbase-2.4.9-bin.tar.gz)

    HBase(hbase-2.4.9-bin.tar.gz)是一个分布式的、面向列的开源数据库,该技术来源于 Fay Chang 所撰写的Google论文“Bigtable:一个结构化数据的分布式存储系统”。就像Bigtable利用了Google文件系统(File System...

    HBase学习利器:HBase实战

    HBase开发实战,HBase学习利器:HBase实战

    Hbase资源整理集合

    HBase 官方文档.pdf HBase的操作和编程.pdf HBase Cpressr优化与实验 郭磊涛.pdf null【HBase】Data Migratin frm Gri t Clu Cmputing - Natural Sienes .pdf 分布式数据库HBase快照的设计与实现.pdf 【HBase】...

    hbase-sdk是基于hbase-client和hbase-thrift的原生API封装的一款轻量级的HBase ORM框架

    hbase-sdk是基于hbase-client和hbase-thrift的原生API封装的一款轻量级的HBase ORM框架。 针对HBase各版本API(1.x~2.x)间的差异,在其上剥离出了一层统一的抽象。并提供了以类SQL的方式来读写HBase表中的数据。对...

    HBase开启审计日志

    HBase开启审计日志

    java大数据作业_3HBase

    1. 请用java集合的代码描述HBase的表结构 2. 请简述HBase中数据写入最后导致Region分裂的全过程 3. 如果设计一个笔记的表,表中要求有笔记的属性和笔记的内容,怎么做 4. HBase部署时如何指定多个zookeeper 5. HBase...

    hbase资料api

    HBASE

    hbase-2.3.5单机一键部署工具

    注意:zookeeper3.4.13和hbase2.3.5都是采用docker-compose方式部署 原文链接:https://blog.csdn.net/m0_37814112/article/details/120915194 说明:使用外部zookeeper3.4.13之hbase2.3.5一键部署工具,支持部署、...

    HBase3.0参考指南

    HBase3.0参考指南 This is the official reference guide for the HBase version it ships with. Herein you will find either the definitive documentation on an HBase topic as of its standing when the ...

    hbase 资源合集 hbase 企业应用开发实战 权威指南 hbase 实战 hbase 应用架构

    hbase 资源合集 hbase 企业应用开发实战 权威指南 hbase 实战 hbase 应用架构

    Hbase基本用法简介

    Hbase shell 、Hbase api、Hbase 配置

Global site tag (gtag.js) - Google Analytics