use of co.cask.cdap.common.namespace.guice.NamespaceClientRuntimeModule in project cdap by caskdata.
the class NotificationTest method getCommonModules.
protected static List<Module> getCommonModules() throws Exception {
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
return ImmutableList.of(new ConfigModule(cConf), new DiscoveryRuntimeModule().getInMemoryModules(), new DataSetsModules().getStandaloneModules(), new DataSetServiceModules().getInMemoryModules(), new NonCustomLocationUnitTestModule().getModule(), new MetricsClientRuntimeModule().getInMemoryModules(), new ExploreClientModule(), new MessagingServerRuntimeModule().getInMemoryModules(), new DataFabricModules().getInMemoryModules(), new NamespaceClientRuntimeModule().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule(), new AbstractModule() {
@Override
protected void configure() {
bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
bind(OwnerAdmin.class).to(NoOpOwnerAdmin.class);
}
});
}
use of co.cask.cdap.common.namespace.guice.NamespaceClientRuntimeModule in project cdap by caskdata.
the class MetricsProcessorServiceTestBase method getAdditionalModules.
@Override
protected List<Module> getAdditionalModules() {
List<Module> list = new ArrayList<>();
list.add(new DataSetsModules().getStandaloneModules());
list.add(new IOModule());
list.add(Modules.override(new NonCustomLocationUnitTestModule().getModule(), new DataFabricModules().getInMemoryModules(), new DataSetServiceModules().getInMemoryModules(), new ExploreClientModule(), new NamespaceClientRuntimeModule().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule()).with(new AbstractModule() {
@Override
protected void configure() {
bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
bind(OwnerAdmin.class).to(NoOpOwnerAdmin.class);
bind(MetricDatasetFactory.class).to(DefaultMetricDatasetFactory.class).in(Scopes.SINGLETON);
bind(MetricStore.class).to(DefaultMetricStore.class).in(Scopes.SINGLETON);
}
}));
return list;
}
use of co.cask.cdap.common.namespace.guice.NamespaceClientRuntimeModule 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);
return Guice.createInjector(new ConfigModule(cConf), new ZKClientModule(), new DiscoveryRuntimeModule().getInMemoryModules(), new KafkaClientModule(), new LocationRuntimeModule().getInMemoryModules(), new DistributedLogFrameworkModule(new MockTwillContext()), new DataSetsModules().getInMemoryModules(), new TransactionModules().getInMemoryModules(), new TransactionExecutorModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new NamespaceClientRuntimeModule().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getNoOpModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);
bind(UGIProvider.class).to(CurrentUGIProvider.class);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
}
});
}
Aggregations