Skip to content

jonathanzong/hypertable-client

Repository files navigation

hypertable-client

A nicer Java Client API for Hypertable, using row-oriented operations in the style of HBase.

What's Wrong with Thrift?

client.table_exists(ns, name);
client.exists_table(ns, name);

Among other things, the Thrift API isn't stylistically consistent with Java conventions (camel case instead of underscores, etc.) and in some cases is needlessly verbose.

Performing operations from a row-oriented perspective makes tasks conceptually easier. The Java client wrapper also provides operations that are either unavailable or annoying in the Thrift API.

Code Example

HypertableClient htc = new HypertableClient("localhost", 38080);

Create a table

TableSchema table = new TableSchema().addColumnFamily("cfam");
htc.createTable("htc_test", table);

Put some values

Put put = new Put("42")
.add("cfam", "cqual1", "val1")
.add("cfam", "cqual2", "val2");

htc.put("htc_test", put);

Scan the table

List<Result> res = htc.scan("htc_test", new Scan("42"));

Access some data

for(Result r: res){
	sopl(r.getFamily("cfam"));
	sopl(r.getValue("cfam", "cqual1"));
}

Highlighted Features

Contribute

  • Fork the project
  • Increase awesomeness of the project
  • Test new awesomeness
  • Commit and send a pull request

About

A nicer Java Client API for Hypertable, using row-oriented operations in the style of HBase.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages