use of io.cdap.cdap.api.metrics.MetricStore in project cdap by caskdata.
the class WorkerProgramRunnerTest method beforeClass.
@BeforeClass
public static void beforeClass() {
// we are only gonna do long-running transactions here. Set the tx timeout to a ridiculously low value.
// that will test that the long-running transactions actually bypass that timeout.
CConfiguration conf = CConfiguration.create();
conf.setInt(TxConstants.Manager.CFG_TX_TIMEOUT, 1);
conf.setInt(TxConstants.Manager.CFG_TX_CLEANUP_INTERVAL, 2);
Injector injector = AppFabricTestHelper.getInjector(conf);
txService = injector.getInstance(TransactionManager.class);
txExecutorFactory = injector.getInstance(TransactionExecutorFactory.class);
dsFramework = injector.getInstance(DatasetFramework.class);
datasetCache = new SingleThreadDatasetCache(new SystemDatasetInstantiator(dsFramework, WorkerProgramRunnerTest.class.getClassLoader(), null), injector.getInstance(TransactionSystemClient.class), NamespaceId.DEFAULT, DatasetDefinition.NO_ARGUMENTS, null, null);
metricStore = injector.getInstance(MetricStore.class);
txService.startAndWait();
}
Aggregations