use of com.nearinfinity.honeycomb.Store in project honeycomb by altamiracorp.
the class StoreFactoryTest method testDefaultTablespaceIsUsed.
@Test
public void testDefaultTablespaceIsUsed() {
StoreFactory factory = createFactory();
Store returnedStore = factory.createStore(tableName);
assertEquals(returnedStore, this.store);
}
use of com.nearinfinity.honeycomb.Store in project honeycomb by altamiracorp.
the class HandlerProxy method dropTable.
/**
* Drop the table with the given specifications. The table is not open when
* this is called.
*
* @param tableName Name of the table to be dropped
*/
public void dropTable(String tableName) {
Verify.isNotNullOrEmpty(tableName);
Store store = storeFactory.createStore(tableName);
Table table = store.openTable(tableName);
table.deleteAllRows();
Util.closeQuietly(table);
store.deleteTable(tableName);
}
use of com.nearinfinity.honeycomb.Store in project honeycomb by altamiracorp.
the class HBaseModule method configure.
@Override
protected void configure() {
final MapBinder<AdapterType, Store> storeMapBinder = MapBinder.newMapBinder(binder(), AdapterType.class, Store.class);
storeMapBinder.addBinding(AdapterType.HBASE).to(HBaseStore.class);
install(new FactoryModuleBuilder().implement(Table.class, HBaseTable.class).build(HBaseTableFactory.class));
bind(HTableProvider.class).toInstance(hTableProvider);
bind(HTableInterface.class).toProvider(hTableProvider);
bind(Long.class).annotatedWith(Names.named(ConfigConstants.WRITE_BUFFER)).toInstance(configuration.getLong(ConfigConstants.WRITE_BUFFER, ConfigConstants.DEFAULT_WRITE_BUFFER));
bind(String.class).annotatedWith(Names.named(ConfigConstants.COLUMN_FAMILY)).toInstance(configuration.get(ConfigConstants.COLUMN_FAMILY));
}
use of com.nearinfinity.honeycomb.Store in project honeycomb by altamiracorp.
the class HandlerProxy method renameTable.
/**
* Updates the existing SQL table name representation in the underlying
* {@link Store} implementation to the specified new table name. The table
* is not open when this is called.
*
* @param originalName The existing name of the table, not null or empty
* @param newName The new table name to represent, not null or empty
*/
public void renameTable(final String originalName, final String newName) {
Verify.isNotNullOrEmpty(originalName, "Original table name must have value.");
Verify.isNotNullOrEmpty(newName, "New table name must have value.");
checkArgument(!originalName.equals(newName), "New table name must be different than original.");
Store store = storeFactory.createStore(originalName);
store.renameTable(originalName, newName);
tableName = newName;
}
Aggregations