Search in sources :

Example 1 with DistributedLogFrameworkModule

use of io.cdap.cdap.logging.guice.DistributedLogFrameworkModule in project cdap by caskdata.

the class DistributedLogFrameworkTest method createInjector.

private Injector createInjector() throws IOException {
    CConfiguration cConf = CConfiguration.copy(KAFKA_TESTER.getCConf());
    cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
    // The event delay cannot be too small, otherwise the events will be out of order, especially on slow machine
    cConf.setLong(Constants.Logging.PIPELINE_EVENT_DELAY_MS, 2000);
    cConf.setLong("log.process.pipeline.checkpoint.interval.ms", 2000);
    MockTwillContext mockTwillContext = new MockTwillContext();
    return Guice.createInjector(new ConfigModule(cConf), new ZKClientModule(), new InMemoryDiscoveryModule(), new KafkaClientModule(), new LocalLocationModule(), new DistributedLogFrameworkModule(mockTwillContext.getInstanceId(), mockTwillContext.getInstanceCount()), new DataSetsModules().getInMemoryModules(), new TransactionModules().getInMemoryModules(), new TransactionExecutorModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new NamespaceAdminTestModule(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getNoOpModule(), new StorageModule(), new AbstractModule() {

        @Override
        protected void configure() {
            bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);
            bind(UGIProvider.class).to(CurrentUGIProvider.class);
            bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
        }
    });
}
Also used : MockTwillContext(io.cdap.cdap.common.test.MockTwillContext) InMemoryDiscoveryModule(io.cdap.cdap.common.guice.InMemoryDiscoveryModule) StorageModule(io.cdap.cdap.data.runtime.StorageModule) NamespaceAdminTestModule(io.cdap.cdap.common.guice.NamespaceAdminTestModule) ConfigModule(io.cdap.cdap.common.guice.ConfigModule) AuthenticationContextModules(io.cdap.cdap.security.auth.context.AuthenticationContextModules) DataSetsModules(io.cdap.cdap.data.runtime.DataSetsModules) NoOpMetricsCollectionService(io.cdap.cdap.common.metrics.NoOpMetricsCollectionService) DefaultOwnerAdmin(io.cdap.cdap.security.impersonation.DefaultOwnerAdmin) CConfiguration(io.cdap.cdap.common.conf.CConfiguration) AuthorizationTestModule(io.cdap.cdap.security.authorization.AuthorizationTestModule) AbstractModule(com.google.inject.AbstractModule) TransactionModules(org.apache.tephra.runtime.TransactionModules) ZKClientModule(io.cdap.cdap.common.guice.ZKClientModule) TransactionExecutorModule(io.cdap.cdap.data.runtime.TransactionExecutorModule) LocalLocationModule(io.cdap.cdap.common.guice.LocalLocationModule) KafkaClientModule(io.cdap.cdap.common.guice.KafkaClientModule) DistributedLogFrameworkModule(io.cdap.cdap.logging.guice.DistributedLogFrameworkModule) CurrentUGIProvider(io.cdap.cdap.security.impersonation.CurrentUGIProvider) SystemDatasetRuntimeModule(io.cdap.cdap.data.runtime.SystemDatasetRuntimeModule) AuthorizationEnforcementModule(io.cdap.cdap.security.authorization.AuthorizationEnforcementModule)

Aggregations

AbstractModule (com.google.inject.AbstractModule)1 CConfiguration (io.cdap.cdap.common.conf.CConfiguration)1 ConfigModule (io.cdap.cdap.common.guice.ConfigModule)1 InMemoryDiscoveryModule (io.cdap.cdap.common.guice.InMemoryDiscoveryModule)1 KafkaClientModule (io.cdap.cdap.common.guice.KafkaClientModule)1 LocalLocationModule (io.cdap.cdap.common.guice.LocalLocationModule)1 NamespaceAdminTestModule (io.cdap.cdap.common.guice.NamespaceAdminTestModule)1 ZKClientModule (io.cdap.cdap.common.guice.ZKClientModule)1 NoOpMetricsCollectionService (io.cdap.cdap.common.metrics.NoOpMetricsCollectionService)1 MockTwillContext (io.cdap.cdap.common.test.MockTwillContext)1 DataSetsModules (io.cdap.cdap.data.runtime.DataSetsModules)1 StorageModule (io.cdap.cdap.data.runtime.StorageModule)1 SystemDatasetRuntimeModule (io.cdap.cdap.data.runtime.SystemDatasetRuntimeModule)1 TransactionExecutorModule (io.cdap.cdap.data.runtime.TransactionExecutorModule)1 DistributedLogFrameworkModule (io.cdap.cdap.logging.guice.DistributedLogFrameworkModule)1 AuthenticationContextModules (io.cdap.cdap.security.auth.context.AuthenticationContextModules)1 AuthorizationEnforcementModule (io.cdap.cdap.security.authorization.AuthorizationEnforcementModule)1 AuthorizationTestModule (io.cdap.cdap.security.authorization.AuthorizationTestModule)1 CurrentUGIProvider (io.cdap.cdap.security.impersonation.CurrentUGIProvider)1 DefaultOwnerAdmin (io.cdap.cdap.security.impersonation.DefaultOwnerAdmin)1