use of co.cask.cdap.data2.util.hbase.ConfigurationTable in project cdap by caskdata.
the class HBaseMessageTableTestRun method setupBeforeClass.
@BeforeClass
public static void setupBeforeClass() throws Exception {
hConf = HBASE_TEST_BASE.getConfiguration();
hConf.set(HBaseTableUtil.CFG_HBASE_TABLE_COMPRESSION, HBaseTableUtil.CompressionType.NONE.name());
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
cConf.set(Constants.CFG_HDFS_NAMESPACE, cConf.get(Constants.CFG_LOCAL_DATA_DIR));
cConf.set(Constants.CFG_HDFS_USER, System.getProperty("user.name"));
tableUtil = new HBaseTableUtilFactory(cConf).get();
ddlExecutor = new HBaseDDLExecutorFactory(cConf, hConf).get();
ddlExecutor.createNamespaceIfNotExists(tableUtil.getHBaseNamespace(NamespaceId.SYSTEM));
LocationFactory locationFactory = getInjector().getInstance(LocationFactory.class);
tableFactory = new HBaseTableFactory(cConf, hConf, tableUtil, locationFactory);
ConfigurationTable configTable = new ConfigurationTable(hConf);
configTable.write(ConfigurationTable.Type.DEFAULT, cConf);
}
Aggregations