Skip to content

Instantly share code, notes, and snippets.

@spullara
Created July 21, 2010 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spullara/484810 to your computer and use it in GitHub Desktop.
Save spullara/484810 to your computer and use it in GitHub Desktop.
static class UserHABModule implements Module {
static final byte[] COLUMN_FAMILY = Bytes.toBytes("profile");
static final byte[] TABLE = Bytes.toBytes("test_user");
static final byte[] SCHEMA_TABLE = Bytes.toBytes("test_schema");
public static final HBaseAdmin admin;
static {
try {
admin = new HBaseAdmin(new HBaseConfiguration());
} catch (MasterNotRunningException e) {
throw new RuntimeException(e);
}
}
@Override
public void configure(Binder binder) {
binder.bind(byte[].class).annotatedWith(Names.named("schema"))
.toInstance(SCHEMA_TABLE);
binder.bind(String.class).annotatedWith(Names.named("solr"))
.toInstance("http://localhost:8983/solr/user");
binder.bind(HAB.CreateType.class)
.toInstance(HAB.CreateType.SEQUENTIAL);
binder.bind(HTablePool.class).toInstance(new HTablePool());
binder.bind(HBaseAdmin.class).toInstance(admin);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment