Search in sources :

Example 6 with ConfigurationTable

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);
}
Also used : ConfigurationTable(co.cask.cdap.data2.util.hbase.ConfigurationTable) HBaseDDLExecutorFactory(co.cask.cdap.data2.util.hbase.HBaseDDLExecutorFactory) HBaseTableUtilFactory(co.cask.cdap.data2.util.hbase.HBaseTableUtilFactory) LocationFactory(org.apache.twill.filesystem.LocationFactory) BeforeClass(org.junit.BeforeClass)

Aggregations

ConfigurationTable (co.cask.cdap.data2.util.hbase.ConfigurationTable)5 HBaseDDLExecutorFactory (co.cask.cdap.data2.util.hbase.HBaseDDLExecutorFactory)4 BeforeClass (org.junit.BeforeClass)4 HBaseTableUtilFactory (co.cask.cdap.data2.util.hbase.HBaseTableUtilFactory)3 LocationFactory (org.apache.twill.filesystem.LocationFactory)3 CConfiguration (co.cask.cdap.common.conf.CConfiguration)1 ConfigModule (co.cask.cdap.common.guice.ConfigModule)1 DiscoveryRuntimeModule (co.cask.cdap.common.guice.DiscoveryRuntimeModule)1 LocationRuntimeModule (co.cask.cdap.common.guice.LocationRuntimeModule)1 NamespaceClientUnitTestModule (co.cask.cdap.common.guice.NamespaceClientUnitTestModule)1 ZKClientModule (co.cask.cdap.common.guice.ZKClientModule)1 DataFabricModules (co.cask.cdap.data.runtime.DataFabricModules)1 DataSetsModules (co.cask.cdap.data.runtime.DataSetsModules)1 SystemDatasetRuntimeModule (co.cask.cdap.data.runtime.SystemDatasetRuntimeModule)1 TransactionMetricsModule (co.cask.cdap.data.runtime.TransactionMetricsModule)1 QueueClientFactory (co.cask.cdap.data2.queue.QueueClientFactory)1 QueueAdmin (co.cask.cdap.data2.transaction.queue.QueueAdmin)1 TableId (co.cask.cdap.data2.util.TableId)1 HBaseTableUtil (co.cask.cdap.data2.util.hbase.HBaseTableUtil)1 NoOpNotificationFeedManager (co.cask.cdap.notifications.feeds.service.NoOpNotificationFeedManager)1