Search in sources :

Example 11 with MetricStore

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();
}
Also used : DatasetFramework(io.cdap.cdap.data2.dataset2.DatasetFramework) MetricStore(io.cdap.cdap.api.metrics.MetricStore) Injector(com.google.inject.Injector) TransactionManager(org.apache.tephra.TransactionManager) SystemDatasetInstantiator(io.cdap.cdap.data.dataset.SystemDatasetInstantiator) SingleThreadDatasetCache(io.cdap.cdap.data2.dataset2.SingleThreadDatasetCache) CConfiguration(io.cdap.cdap.common.conf.CConfiguration) TransactionExecutorFactory(io.cdap.cdap.data2.transaction.TransactionExecutorFactory) BeforeClass(org.junit.BeforeClass)

Aggregations

MetricStore (io.cdap.cdap.api.metrics.MetricStore)11 Test (org.junit.Test)6 MetricsCollectionService (io.cdap.cdap.api.metrics.MetricsCollectionService)5 ProfileId (io.cdap.cdap.proto.id.ProfileId)4 ProgramRunId (io.cdap.cdap.proto.id.ProgramRunId)4 TransactionManager (org.apache.tephra.TransactionManager)4 BeforeClass (org.junit.BeforeClass)4 Injector (com.google.inject.Injector)3 CConfiguration (io.cdap.cdap.common.conf.CConfiguration)3 LocationFactory (org.apache.twill.filesystem.LocationFactory)3 MetricDataQuery (io.cdap.cdap.api.metrics.MetricDataQuery)2 SystemDatasetInstantiator (io.cdap.cdap.data.dataset.SystemDatasetInstantiator)2 DatasetService (io.cdap.cdap.data2.datafabric.dataset.service.DatasetService)2 DatasetOpExecutorService (io.cdap.cdap.data2.datafabric.dataset.service.executor.DatasetOpExecutorService)2 DatasetFramework (io.cdap.cdap.data2.dataset2.DatasetFramework)2 SingleThreadDatasetCache (io.cdap.cdap.data2.dataset2.SingleThreadDatasetCache)2 TransactionExecutorFactory (io.cdap.cdap.data2.transaction.TransactionExecutorFactory)2 ArrayList (java.util.ArrayList)2 LoggerContext (ch.qos.logback.classic.LoggerContext)1 Service (com.google.common.util.concurrent.Service)1