use of org.apache.metron.hbase.HTableProvider in project metron by apache.
the class GetProfile method getTableProvider.
/**
* Create the TableProvider to use when accessing HBase.
* @param global The global configuration.
*/
private TableProvider getTableProvider(Map<String, Object> global) {
String clazzName = PROFILER_HBASE_TABLE_PROVIDER.get(global, String.class);
TableProvider provider;
try {
@SuppressWarnings("unchecked") Class<? extends TableProvider> clazz = (Class<? extends TableProvider>) Class.forName(clazzName);
provider = clazz.getConstructor().newInstance();
} catch (Exception e) {
provider = new HTableProvider();
}
return provider;
}
use of org.apache.metron.hbase.HTableProvider in project metron by apache.
the class SimpleHBaseConfigTest method test.
@Test
public void test() {
SimpleHBaseConfig shc = new SimpleHBaseConfig();
shc.withHBaseCF(cf);
shc.withHBaseTable(table);
provider = new HTableProvider();
Assert.assertEquals(cf, shc.getHBaseCF());
Assert.assertEquals(table, shc.getHBaseTable());
}
Aggregations