Search in sources :

Example 1 with AnnouncerModule

use of org.apache.druid.guice.AnnouncerModule in project druid by druid-io.

the class Initialization method makeInjectorWithModules.

public static Injector makeInjectorWithModules(final Set<NodeRole> nodeRoles, final Injector baseInjector, final Iterable<? extends Module> modules) {
    final ModuleList defaultModules = new ModuleList(baseInjector, nodeRoles);
    defaultModules.addModules(// New modules should be added after Log4jShutterDownerModule
    new Log4jShutterDownerModule(), new DruidAuthModule(), new LifecycleModule(), TLSCertificateCheckerModule.class, EmitterModule.class, HttpClientModule.global(), HttpClientModule.escalatedGlobal(), new HttpClientModule("druid.broker.http", Client.class), new HttpClientModule("druid.broker.http", EscalatedClient.class), new CuratorModule(), new AnnouncerModule(), new MetricsModule(), new SegmentWriteOutMediumModule(), new ServerModule(), new DruidProcessingConfigModule(), new StorageNodeModule(), new JettyServerModule(), new ExpressionModule(), new DiscoveryModule(), new ServerViewModule(), new MetadataConfigModule(), new DerbyMetadataStorageDruidModule(), new JacksonConfigManagerModule(), new IndexingServiceDiscoveryModule(), new CoordinatorDiscoveryModule(), new LocalDataStorageDruidModule(), new FirehoseModule(), new JavaScriptModule(), new AuthenticatorModule(), new AuthenticatorMapperModule(), new EscalatorModule(), new AuthorizerModule(), new AuthorizerMapperModule(), new StartupLoggingModule(), new ExternalStorageAccessSecurityModule());
    ModuleList actualModules = new ModuleList(baseInjector, nodeRoles);
    actualModules.addModule(DruidSecondaryModule.class);
    for (Object module : modules) {
        actualModules.addModule(module);
    }
    Module intermediateModules = Modules.override(defaultModules.getModules()).with(actualModules.getModules());
    ModuleList extensionModules = new ModuleList(baseInjector, nodeRoles);
    final ExtensionsConfig config = baseInjector.getInstance(ExtensionsConfig.class);
    for (DruidModule module : Initialization.getFromExtensions(config, DruidModule.class)) {
        extensionModules.addModule(module);
    }
    return Guice.createInjector(Modules.override(intermediateModules).with(extensionModules.getModules()));
}
Also used : CuratorModule(org.apache.druid.curator.CuratorModule) IndexingServiceDiscoveryModule(org.apache.druid.guice.IndexingServiceDiscoveryModule) DiscoveryModule(org.apache.druid.curator.discovery.DiscoveryModule) CoordinatorDiscoveryModule(org.apache.druid.guice.CoordinatorDiscoveryModule) ServerViewModule(org.apache.druid.guice.ServerViewModule) EscalatorModule(org.apache.druid.guice.security.EscalatorModule) JettyServerModule(org.apache.druid.server.initialization.jetty.JettyServerModule) JettyServerModule(org.apache.druid.server.initialization.jetty.JettyServerModule) ServerModule(org.apache.druid.guice.ServerModule) AuthenticatorMapperModule(org.apache.druid.server.initialization.AuthenticatorMapperModule) FirehoseModule(org.apache.druid.guice.FirehoseModule) LocalDataStorageDruidModule(org.apache.druid.guice.LocalDataStorageDruidModule) DerbyMetadataStorageDruidModule(org.apache.druid.metadata.storage.derby.DerbyMetadataStorageDruidModule) Client(org.apache.druid.guice.annotations.Client) EscalatedClient(org.apache.druid.guice.annotations.EscalatedClient) ExtensionsConfig(org.apache.druid.guice.ExtensionsConfig) JacksonConfigManagerModule(org.apache.druid.guice.JacksonConfigManagerModule) LifecycleModule(org.apache.druid.guice.LifecycleModule) ExternalStorageAccessSecurityModule(org.apache.druid.server.initialization.ExternalStorageAccessSecurityModule) AuthorizerModule(org.apache.druid.guice.security.AuthorizerModule) IndexingServiceDiscoveryModule(org.apache.druid.guice.IndexingServiceDiscoveryModule) ExpressionModule(org.apache.druid.guice.ExpressionModule) LocalDataStorageDruidModule(org.apache.druid.guice.LocalDataStorageDruidModule) StartupLoggingModule(org.apache.druid.guice.StartupLoggingModule) SegmentWriteOutMediumModule(org.apache.druid.segment.writeout.SegmentWriteOutMediumModule) DerbyMetadataStorageDruidModule(org.apache.druid.metadata.storage.derby.DerbyMetadataStorageDruidModule) DruidProcessingConfigModule(org.apache.druid.guice.DruidProcessingConfigModule) EscalatedClient(org.apache.druid.guice.annotations.EscalatedClient) MetadataConfigModule(org.apache.druid.guice.MetadataConfigModule) CoordinatorDiscoveryModule(org.apache.druid.guice.CoordinatorDiscoveryModule) AuthorizerMapperModule(org.apache.druid.server.initialization.AuthorizerMapperModule) DruidAuthModule(org.apache.druid.guice.security.DruidAuthModule) MetricsModule(org.apache.druid.server.metrics.MetricsModule) AnnouncerModule(org.apache.druid.guice.AnnouncerModule) StorageNodeModule(org.apache.druid.guice.StorageNodeModule) AuthenticatorModule(org.apache.druid.guice.security.AuthenticatorModule) Module(com.google.inject.Module) ExpressionModule(org.apache.druid.guice.ExpressionModule) DruidAuthModule(org.apache.druid.guice.security.DruidAuthModule) LifecycleModule(org.apache.druid.guice.LifecycleModule) StartupLoggingModule(org.apache.druid.guice.StartupLoggingModule) JacksonConfigManagerModule(org.apache.druid.guice.JacksonConfigManagerModule) AuthorizerMapperModule(org.apache.druid.server.initialization.AuthorizerMapperModule) AuthenticatorMapperModule(org.apache.druid.server.initialization.AuthenticatorMapperModule) TLSCertificateCheckerModule(org.apache.druid.server.security.TLSCertificateCheckerModule) IndexingServiceDiscoveryModule(org.apache.druid.guice.IndexingServiceDiscoveryModule) AuthenticatorModule(org.apache.druid.guice.security.AuthenticatorModule) HttpClientModule(org.apache.druid.guice.http.HttpClientModule) LocalDataStorageDruidModule(org.apache.druid.guice.LocalDataStorageDruidModule) DiscoveryModule(org.apache.druid.curator.discovery.DiscoveryModule) JettyServerModule(org.apache.druid.server.initialization.jetty.JettyServerModule) MetricsModule(org.apache.druid.server.metrics.MetricsModule) SegmentWriteOutMediumModule(org.apache.druid.segment.writeout.SegmentWriteOutMediumModule) FirehoseModule(org.apache.druid.guice.FirehoseModule) DerbyMetadataStorageDruidModule(org.apache.druid.metadata.storage.derby.DerbyMetadataStorageDruidModule) StorageNodeModule(org.apache.druid.guice.StorageNodeModule) MetadataConfigModule(org.apache.druid.guice.MetadataConfigModule) JavaScriptModule(org.apache.druid.guice.JavaScriptModule) ServerViewModule(org.apache.druid.guice.ServerViewModule) CoordinatorDiscoveryModule(org.apache.druid.guice.CoordinatorDiscoveryModule) CuratorModule(org.apache.druid.curator.CuratorModule) AnnouncerModule(org.apache.druid.guice.AnnouncerModule) DruidSecondaryModule(org.apache.druid.guice.DruidSecondaryModule) EscalatorModule(org.apache.druid.guice.security.EscalatorModule) ExternalStorageAccessSecurityModule(org.apache.druid.server.initialization.ExternalStorageAccessSecurityModule) DruidProcessingConfigModule(org.apache.druid.guice.DruidProcessingConfigModule) ServerModule(org.apache.druid.guice.ServerModule) EmitterModule(org.apache.druid.server.emitter.EmitterModule) AuthorizerModule(org.apache.druid.guice.security.AuthorizerModule) HttpClientModule(org.apache.druid.guice.http.HttpClientModule) JavaScriptModule(org.apache.druid.guice.JavaScriptModule)

Aggregations

Module (com.google.inject.Module)1 CuratorModule (org.apache.druid.curator.CuratorModule)1 DiscoveryModule (org.apache.druid.curator.discovery.DiscoveryModule)1 AnnouncerModule (org.apache.druid.guice.AnnouncerModule)1 CoordinatorDiscoveryModule (org.apache.druid.guice.CoordinatorDiscoveryModule)1 DruidProcessingConfigModule (org.apache.druid.guice.DruidProcessingConfigModule)1 DruidSecondaryModule (org.apache.druid.guice.DruidSecondaryModule)1 ExpressionModule (org.apache.druid.guice.ExpressionModule)1 ExtensionsConfig (org.apache.druid.guice.ExtensionsConfig)1 FirehoseModule (org.apache.druid.guice.FirehoseModule)1 IndexingServiceDiscoveryModule (org.apache.druid.guice.IndexingServiceDiscoveryModule)1 JacksonConfigManagerModule (org.apache.druid.guice.JacksonConfigManagerModule)1 JavaScriptModule (org.apache.druid.guice.JavaScriptModule)1 LifecycleModule (org.apache.druid.guice.LifecycleModule)1 LocalDataStorageDruidModule (org.apache.druid.guice.LocalDataStorageDruidModule)1 MetadataConfigModule (org.apache.druid.guice.MetadataConfigModule)1 ServerModule (org.apache.druid.guice.ServerModule)1 ServerViewModule (org.apache.druid.guice.ServerViewModule)1 StartupLoggingModule (org.apache.druid.guice.StartupLoggingModule)1 StorageNodeModule (org.apache.druid.guice.StorageNodeModule)1