Created
July 21, 2010 17:31
-
-
Save spullara/484810 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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