Search in sources :

Example 6 with NotificationServiceRuntimeModule

use of co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule in project cdap by caskdata.

the class JobQueueDebugger method createInjector.

private static Injector createInjector() throws Exception {
    CConfiguration cConf = CConfiguration.create();
    if (cConf.getBoolean(Constants.Security.Authorization.ENABLED)) {
        System.out.println(String.format("Disabling authorization for %s.", JobQueueDebugger.class.getSimpleName()));
        cConf.setBoolean(Constants.Security.Authorization.ENABLED, false);
    }
    // Note: login has to happen before any objects that need Kerberos credentials are instantiated.
    SecurityUtil.loginForMasterService(cConf);
    return Guice.createInjector(new ConfigModule(cConf, HBaseConfiguration.create()), new IOModule(), new ZKClientModule(), new LocationRuntimeModule().getDistributedModules(), new DiscoveryRuntimeModule().getDistributedModules(), new ViewAdminModules().getDistributedModules(), new StreamAdminModules().getDistributedModules(), new NotificationFeedClientModule(), new TwillModule(), new ExploreClientModule(), new DataFabricModules().getDistributedModules(), new ServiceStoreModules().getDistributedModules(), new DataSetsModules().getDistributedModules(), new AppFabricServiceRuntimeModule().getDistributedModules(), new ProgramRunnerRuntimeModule().getDistributedModules(), new SystemDatasetRuntimeModule().getDistributedModules(), new NotificationServiceRuntimeModule().getDistributedModules(), new MetricsClientRuntimeModule().getDistributedModules(), new MetricsStoreModule(), new KafkaClientModule(), new NamespaceStoreModule().getDistributedModules(), new AuthorizationModule(), new AuthorizationEnforcementModule().getMasterModule(), new SecureStoreModules().getDistributedModules(), new MessagingClientModule(), new AbstractModule() {

        @Override
        protected void configure() {
            bind(HBaseTableUtil.class).toProvider(HBaseTableUtilFactory.class);
            bind(Store.class).annotatedWith(Names.named("defaultStore")).to(DefaultStore.class).in(Singleton.class);
            // This is needed because the LocalApplicationManager
            // expects a dsframework injection named datasetMDS
            bind(DatasetFramework.class).annotatedWith(Names.named("datasetMDS")).to(DatasetFramework.class).in(Singleton.class);
        }
    });
}
Also used : IOModule(co.cask.cdap.common.guice.IOModule) MessagingClientModule(co.cask.cdap.messaging.guice.MessagingClientModule) MetricsStoreModule(co.cask.cdap.metrics.guice.MetricsStoreModule) ConfigModule(co.cask.cdap.common.guice.ConfigModule) NamespaceStoreModule(co.cask.cdap.store.guice.NamespaceStoreModule) NotificationServiceRuntimeModule(co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule) MetricsClientRuntimeModule(co.cask.cdap.metrics.guice.MetricsClientRuntimeModule) ViewAdminModules(co.cask.cdap.data.view.ViewAdminModules) ZKClientModule(co.cask.cdap.common.guice.ZKClientModule) KafkaClientModule(co.cask.cdap.common.guice.KafkaClientModule) HBaseTableUtilFactory(co.cask.cdap.data2.util.hbase.HBaseTableUtilFactory) SystemDatasetRuntimeModule(co.cask.cdap.data.runtime.SystemDatasetRuntimeModule) DiscoveryRuntimeModule(co.cask.cdap.common.guice.DiscoveryRuntimeModule) AuthorizationModule(co.cask.cdap.app.guice.AuthorizationModule) TwillModule(co.cask.cdap.app.guice.TwillModule) DataSetsModules(co.cask.cdap.data.runtime.DataSetsModules) SecureStoreModules(co.cask.cdap.security.guice.SecureStoreModules) LocationRuntimeModule(co.cask.cdap.common.guice.LocationRuntimeModule) CConfiguration(co.cask.cdap.common.conf.CConfiguration) AbstractModule(com.google.inject.AbstractModule) StreamAdminModules(co.cask.cdap.data.stream.StreamAdminModules) ProgramRunnerRuntimeModule(co.cask.cdap.app.guice.ProgramRunnerRuntimeModule) ExploreClientModule(co.cask.cdap.explore.guice.ExploreClientModule) Singleton(com.google.inject.Singleton) NotificationFeedClientModule(co.cask.cdap.notifications.feeds.client.NotificationFeedClientModule) DataFabricModules(co.cask.cdap.data.runtime.DataFabricModules) ServiceStoreModules(co.cask.cdap.app.guice.ServiceStoreModules) AppFabricServiceRuntimeModule(co.cask.cdap.app.guice.AppFabricServiceRuntimeModule) AuthorizationEnforcementModule(co.cask.cdap.security.authorization.AuthorizationEnforcementModule)

Example 7 with NotificationServiceRuntimeModule

use of co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule in project cdap by caskdata.

the class InMemoryNotificationTest method start.

@BeforeClass
public static void start() throws Exception {
    Injector injector = Guice.createInjector(Iterables.concat(getCommonModules(), ImmutableList.of(new NotificationServiceRuntimeModule().getInMemoryModules(), new NotificationFeedServiceRuntimeModule().getInMemoryModules())));
    startServices(injector);
}
Also used : Injector(com.google.inject.Injector) NotificationFeedServiceRuntimeModule(co.cask.cdap.notifications.feeds.guice.NotificationFeedServiceRuntimeModule) NotificationServiceRuntimeModule(co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule) BeforeClass(org.junit.BeforeClass)

Example 8 with NotificationServiceRuntimeModule

use of co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule in project cdap by caskdata.

the class StandaloneMain method createPersistentModules.

private static List<Module> createPersistentModules(CConfiguration cConf, Configuration hConf) {
    cConf.setIfUnset(Constants.CFG_DATA_LEVELDB_DIR, Constants.DEFAULT_DATA_LEVELDB_DIR);
    cConf.set(Constants.CFG_DATA_INMEMORY_PERSISTENCE, Constants.InMemoryPersistenceType.LEVELDB.name());
    // configure all services except for router and auth to bind to 127.0.0.1
    String localhost = InetAddress.getLoopbackAddress().getHostAddress();
    cConf.set(Constants.Service.MASTER_SERVICES_BIND_ADDRESS, localhost);
    cConf.set(Constants.Transaction.Container.ADDRESS, localhost);
    cConf.set(Constants.Dataset.Executor.ADDRESS, localhost);
    cConf.set(Constants.Stream.ADDRESS, localhost);
    cConf.set(Constants.Metrics.ADDRESS, localhost);
    cConf.set(Constants.Metrics.SERVER_ADDRESS, localhost);
    cConf.set(Constants.MetricsProcessor.ADDRESS, localhost);
    cConf.set(Constants.LogSaver.ADDRESS, localhost);
    cConf.set(Constants.Explore.SERVER_ADDRESS, localhost);
    cConf.set(Constants.Metadata.SERVICE_BIND_ADDRESS, localhost);
    cConf.set(Constants.Preview.ADDRESS, localhost);
    return ImmutableList.of(new ConfigModule(cConf, hConf), new IOModule(), new ZKClientModule(), new KafkaClientModule(), new MetricsHandlerModule(), new DiscoveryRuntimeModule().getStandaloneModules(), new LocationRuntimeModule().getStandaloneModules(), new ProgramRunnerRuntimeModule().getStandaloneModules(), new DataFabricModules(StandaloneMain.class.getName()).getStandaloneModules(), new DataSetsModules().getStandaloneModules(), new DataSetServiceModules().getStandaloneModules(), new MetricsClientRuntimeModule().getStandaloneModules(), new LoggingModules().getStandaloneModules(), new LogReaderRuntimeModules().getStandaloneModules(), new RouterModules().getStandaloneModules(), new SecurityModules().getStandaloneModules(), new SecureStoreModules().getStandaloneModules(), new StreamServiceRuntimeModule().getStandaloneModules(), new ExploreRuntimeModule().getStandaloneModules(), new ServiceStoreModules().getStandaloneModules(), new ExploreClientModule(), new NotificationFeedServiceRuntimeModule().getStandaloneModules(), new NotificationServiceRuntimeModule().getStandaloneModules(), new ViewAdminModules().getStandaloneModules(), new StreamAdminModules().getStandaloneModules(), new NamespaceStoreModule().getStandaloneModules(), new MetadataServiceModule(), new RemoteSystemOperationsServiceModule(), new AuditModule().getStandaloneModules(), new AuthorizationModule(), new AuthorizationEnforcementModule().getStandaloneModules(), new PreviewHttpModule(), new MessagingServerRuntimeModule().getStandaloneModules(), new AppFabricServiceRuntimeModule().getStandaloneModules(), new OperationalStatsModule());
}
Also used : IOModule(co.cask.cdap.common.guice.IOModule) DataSetServiceModules(co.cask.cdap.data.runtime.DataSetServiceModules) ConfigModule(co.cask.cdap.common.guice.ConfigModule) NamespaceStoreModule(co.cask.cdap.store.guice.NamespaceStoreModule) PreviewHttpModule(co.cask.cdap.app.preview.PreviewHttpModule) MessagingServerRuntimeModule(co.cask.cdap.messaging.guice.MessagingServerRuntimeModule) MetricsClientRuntimeModule(co.cask.cdap.metrics.guice.MetricsClientRuntimeModule) NotificationServiceRuntimeModule(co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule) SecurityModules(co.cask.cdap.security.guice.SecurityModules) RemoteSystemOperationsServiceModule(co.cask.cdap.gateway.handlers.meta.RemoteSystemOperationsServiceModule) ViewAdminModules(co.cask.cdap.data.view.ViewAdminModules) ZKClientModule(co.cask.cdap.common.guice.ZKClientModule) KafkaClientModule(co.cask.cdap.common.guice.KafkaClientModule) StreamServiceRuntimeModule(co.cask.cdap.data.stream.service.StreamServiceRuntimeModule) DiscoveryRuntimeModule(co.cask.cdap.common.guice.DiscoveryRuntimeModule) AuthorizationModule(co.cask.cdap.app.guice.AuthorizationModule) OperationalStatsModule(co.cask.cdap.operations.guice.OperationalStatsModule) LogReaderRuntimeModules(co.cask.cdap.logging.guice.LogReaderRuntimeModules) DataSetsModules(co.cask.cdap.data.runtime.DataSetsModules) SecureStoreModules(co.cask.cdap.security.guice.SecureStoreModules) LocationRuntimeModule(co.cask.cdap.common.guice.LocationRuntimeModule) MetadataServiceModule(co.cask.cdap.metadata.MetadataServiceModule) ExploreRuntimeModule(co.cask.cdap.explore.guice.ExploreRuntimeModule) RouterModules(co.cask.cdap.gateway.router.RouterModules) LoggingModules(co.cask.cdap.logging.guice.LoggingModules) StreamAdminModules(co.cask.cdap.data.stream.StreamAdminModules) MetricsHandlerModule(co.cask.cdap.metrics.guice.MetricsHandlerModule) ProgramRunnerRuntimeModule(co.cask.cdap.app.guice.ProgramRunnerRuntimeModule) ExploreClientModule(co.cask.cdap.explore.guice.ExploreClientModule) NotificationFeedServiceRuntimeModule(co.cask.cdap.notifications.feeds.guice.NotificationFeedServiceRuntimeModule) AuditModule(co.cask.cdap.data2.audit.AuditModule) DataFabricModules(co.cask.cdap.data.runtime.DataFabricModules) ServiceStoreModules(co.cask.cdap.app.guice.ServiceStoreModules) AuthorizationEnforcementModule(co.cask.cdap.security.authorization.AuthorizationEnforcementModule) AppFabricServiceRuntimeModule(co.cask.cdap.app.guice.AppFabricServiceRuntimeModule)

Example 9 with NotificationServiceRuntimeModule

use of co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule in project cdap by caskdata.

the class AppFabricTestModule method configure.

@Override
protected void configure() {
    install(new DataFabricModules().getInMemoryModules());
    install(new DataSetsModules().getStandaloneModules());
    install(new TransactionExecutorModule());
    install(new DataSetServiceModules().getInMemoryModules());
    install(new ConfigModule(cConf, hConf, sConf));
    install(new IOModule());
    install(new DiscoveryRuntimeModule().getInMemoryModules());
    install(new AppFabricServiceRuntimeModule().getInMemoryModules());
    install(new ServiceStoreModules().getInMemoryModules());
    install(new PrivateModule() {

        @Override
        protected void configure() {
            bind(Scheduler.class).annotatedWith(Assisted.class).toInstance(createNoopScheduler());
        }
    });
    install(new ProgramRunnerRuntimeModule().getInMemoryModules());
    install(new NonCustomLocationUnitTestModule().getModule());
    install(new LoggingModules().getInMemoryModules());
    install(new LogReaderRuntimeModules().getInMemoryModules());
    install(new MetricsHandlerModule());
    install(new MetricsClientRuntimeModule().getInMemoryModules());
    install(new ExploreClientModule());
    install(new NotificationFeedServiceRuntimeModule().getInMemoryModules());
    install(new NotificationServiceRuntimeModule().getInMemoryModules());
    install(new ConfigStoreModule().getInMemoryModule());
    install(new ViewAdminModules().getInMemoryModules());
    install(new StreamAdminModules().getInMemoryModules());
    install(new StreamServiceRuntimeModule().getInMemoryModules());
    install(new NamespaceStoreModule().getStandaloneModules());
    install(new MetadataServiceModule());
    install(new RemoteSystemOperationsServiceModule());
    install(new AuthorizationModule());
    install(new AuthorizationEnforcementModule().getStandaloneModules());
    install(new SecureStoreModules().getInMemoryModules());
    install(new MessagingServerRuntimeModule().getInMemoryModules());
}
Also used : IOModule(co.cask.cdap.common.guice.IOModule) DataSetServiceModules(co.cask.cdap.data.runtime.DataSetServiceModules) ConfigModule(co.cask.cdap.common.guice.ConfigModule) Scheduler(co.cask.cdap.internal.app.runtime.schedule.Scheduler) NamespaceStoreModule(co.cask.cdap.store.guice.NamespaceStoreModule) MessagingServerRuntimeModule(co.cask.cdap.messaging.guice.MessagingServerRuntimeModule) MetricsClientRuntimeModule(co.cask.cdap.metrics.guice.MetricsClientRuntimeModule) NotificationServiceRuntimeModule(co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule) RemoteSystemOperationsServiceModule(co.cask.cdap.gateway.handlers.meta.RemoteSystemOperationsServiceModule) ViewAdminModules(co.cask.cdap.data.view.ViewAdminModules) TransactionExecutorModule(co.cask.cdap.data.runtime.TransactionExecutorModule) StreamServiceRuntimeModule(co.cask.cdap.data.stream.service.StreamServiceRuntimeModule) DiscoveryRuntimeModule(co.cask.cdap.common.guice.DiscoveryRuntimeModule) ConfigStoreModule(co.cask.cdap.config.guice.ConfigStoreModule) AuthorizationModule(co.cask.cdap.app.guice.AuthorizationModule) PrivateModule(com.google.inject.PrivateModule) LogReaderRuntimeModules(co.cask.cdap.logging.guice.LogReaderRuntimeModules) DataSetsModules(co.cask.cdap.data.runtime.DataSetsModules) SecureStoreModules(co.cask.cdap.security.guice.SecureStoreModules) MetadataServiceModule(co.cask.cdap.metadata.MetadataServiceModule) NonCustomLocationUnitTestModule(co.cask.cdap.common.guice.NonCustomLocationUnitTestModule) LoggingModules(co.cask.cdap.logging.guice.LoggingModules) StreamAdminModules(co.cask.cdap.data.stream.StreamAdminModules) ProgramRunnerRuntimeModule(co.cask.cdap.app.guice.ProgramRunnerRuntimeModule) MetricsHandlerModule(co.cask.cdap.metrics.guice.MetricsHandlerModule) ExploreClientModule(co.cask.cdap.explore.guice.ExploreClientModule) NotificationFeedServiceRuntimeModule(co.cask.cdap.notifications.feeds.guice.NotificationFeedServiceRuntimeModule) DataFabricModules(co.cask.cdap.data.runtime.DataFabricModules) AppFabricServiceRuntimeModule(co.cask.cdap.app.guice.AppFabricServiceRuntimeModule) ServiceStoreModules(co.cask.cdap.app.guice.ServiceStoreModules) AuthorizationEnforcementModule(co.cask.cdap.security.authorization.AuthorizationEnforcementModule)

Example 10 with NotificationServiceRuntimeModule

use of co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule in project cdap by caskdata.

the class ExploreDisabledTest method createInMemoryModules.

private static List<Module> createInMemoryModules(CConfiguration configuration, Configuration hConf) {
    configuration.set(Constants.CFG_DATA_INMEMORY_PERSISTENCE, Constants.InMemoryPersistenceType.MEMORY.name());
    configuration.setBoolean(Constants.Explore.EXPLORE_ENABLED, false);
    configuration.set(Constants.Explore.LOCAL_DATA_DIR, new File(System.getProperty("java.io.tmpdir"), "hive").getAbsolutePath());
    return ImmutableList.of(new ConfigModule(configuration, hConf), new IOModule(), new DiscoveryRuntimeModule().getInMemoryModules(), new NonCustomLocationUnitTestModule().getModule(), new DataFabricModules().getInMemoryModules(), new DataSetsModules().getStandaloneModules(), new DataSetServiceModules().getInMemoryModules(), new MetricsClientRuntimeModule().getInMemoryModules(), new ExploreRuntimeModule().getInMemoryModules(), new ExploreClientModule(), new ViewAdminModules().getInMemoryModules(), new StreamAdminModules().getInMemoryModules(), new NotificationServiceRuntimeModule().getInMemoryModules(), new NamespaceClientRuntimeModule().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule(), new AbstractModule() {

        @Override
        protected void configure() {
            bind(NotificationFeedManager.class).to(NoOpNotificationFeedManager.class);
            bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
            bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
        }
    });
}
Also used : IOModule(co.cask.cdap.common.guice.IOModule) NamespaceClientRuntimeModule(co.cask.cdap.common.namespace.guice.NamespaceClientRuntimeModule) DataSetServiceModules(co.cask.cdap.data.runtime.DataSetServiceModules) UnsupportedUGIProvider(co.cask.cdap.security.impersonation.UnsupportedUGIProvider) ConfigModule(co.cask.cdap.common.guice.ConfigModule) AuthenticationContextModules(co.cask.cdap.security.auth.context.AuthenticationContextModules) DataSetsModules(co.cask.cdap.data.runtime.DataSetsModules) ExploreRuntimeModule(co.cask.cdap.explore.guice.ExploreRuntimeModule) NonCustomLocationUnitTestModule(co.cask.cdap.common.guice.NonCustomLocationUnitTestModule) MetricsClientRuntimeModule(co.cask.cdap.metrics.guice.MetricsClientRuntimeModule) NotificationServiceRuntimeModule(co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule) DefaultOwnerAdmin(co.cask.cdap.security.impersonation.DefaultOwnerAdmin) AuthorizationTestModule(co.cask.cdap.security.authorization.AuthorizationTestModule) ViewAdminModules(co.cask.cdap.data.view.ViewAdminModules) AbstractModule(com.google.inject.AbstractModule) StreamAdminModules(co.cask.cdap.data.stream.StreamAdminModules) ExploreClientModule(co.cask.cdap.explore.guice.ExploreClientModule) NoOpNotificationFeedManager(co.cask.cdap.notifications.feeds.service.NoOpNotificationFeedManager) File(java.io.File) DiscoveryRuntimeModule(co.cask.cdap.common.guice.DiscoveryRuntimeModule) DataFabricModules(co.cask.cdap.data.runtime.DataFabricModules) AuthorizationEnforcementModule(co.cask.cdap.security.authorization.AuthorizationEnforcementModule)

Aggregations

NotificationServiceRuntimeModule (co.cask.cdap.notifications.guice.NotificationServiceRuntimeModule)14 ConfigModule (co.cask.cdap.common.guice.ConfigModule)11 DiscoveryRuntimeModule (co.cask.cdap.common.guice.DiscoveryRuntimeModule)11 DataSetsModules (co.cask.cdap.data.runtime.DataSetsModules)11 ExploreClientModule (co.cask.cdap.explore.guice.ExploreClientModule)11 AuthorizationEnforcementModule (co.cask.cdap.security.authorization.AuthorizationEnforcementModule)11 DataFabricModules (co.cask.cdap.data.runtime.DataFabricModules)10 StreamAdminModules (co.cask.cdap.data.stream.StreamAdminModules)10 ViewAdminModules (co.cask.cdap.data.view.ViewAdminModules)10 MetricsClientRuntimeModule (co.cask.cdap.metrics.guice.MetricsClientRuntimeModule)10 AbstractModule (com.google.inject.AbstractModule)10 IOModule (co.cask.cdap.common.guice.IOModule)9 DataSetServiceModules (co.cask.cdap.data.runtime.DataSetServiceModules)8 AppFabricServiceRuntimeModule (co.cask.cdap.app.guice.AppFabricServiceRuntimeModule)7 AuthorizationModule (co.cask.cdap.app.guice.AuthorizationModule)7 ServiceStoreModules (co.cask.cdap.app.guice.ServiceStoreModules)7 NotificationFeedServiceRuntimeModule (co.cask.cdap.notifications.feeds.guice.NotificationFeedServiceRuntimeModule)7 SecureStoreModules (co.cask.cdap.security.guice.SecureStoreModules)7 NamespaceStoreModule (co.cask.cdap.store.guice.NamespaceStoreModule)7 ProgramRunnerRuntimeModule (co.cask.cdap.app.guice.ProgramRunnerRuntimeModule)6