Balaji
Balaji

Reputation: 757

Hbase 0.92.1 Secondary Index Example

I am working on million Rows and columns in hbase 0.92.1. Now, I want to know how to create secondary index using Co-processor. Give some examples program for this.
Kindly give the program which supports hbase 0.92.1.

Upvotes: 2

Views: 1605

Answers (2)

Shengjie
Shengjie

Reputation: 12786

As far as I know, prior to 0.20, in Hbase API, you'd have HTableDescriptor which is writable still, so you can call HtabelDescriptor.addIndex() to create indices against the columns. Example can be found here.

Then indexing starts moving to IHbase see the Jira story here.

To answer your question, in 0.92.1, I don't think there is anything out of box yet, you will have to write the coprocessor yourself, But There is a jira story for coprocessor secondary index you might want to watch the progress:)

meanwhile you can try idxColumnDescriptor here, also looking at the test TestIdxColumnDescriptor.java might help.

Upvotes: 1

eclark
eclark

Reputation: 688

There's no single great way to do secondary indexing with HBase. The way you will approach the problem will be dictated by your data and your use case. Some good discussion of secondary indexing is located here

Upvotes: 2

Related Questions