Search in sources :

Example 1 with DruidProcessingModule

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

the class ExportMetadata method getModules.

@Override
protected List<? extends Module> getModules() {
    return ImmutableList.of(// See https://github.com/apache/druid/pull/4429#discussion_r123602930
    new DruidProcessingModule(), new QueryableModule(), new QueryRunnerFactoryModule(), binder -> {
        JsonConfigProvider.bindInstance(binder, Key.get(MetadataStorageConnectorConfig.class), new MetadataStorageConnectorConfig() {

            @Override
            public String getConnectURI() {
                return connectURI;
            }

            @Override
            public String getUser() {
                return user;
            }

            @Override
            public String getPassword() {
                return password;
            }
        });
        JsonConfigProvider.bindInstance(binder, Key.get(MetadataStorageTablesConfig.class), MetadataStorageTablesConfig.fromBase(base));
        JsonConfigProvider.bindInstance(binder, Key.get(DruidNode.class, Self.class), new DruidNode("tools", "localhost", false, -1, null, true, false));
    });
}
Also used : MetadataStorageTablesConfig(org.apache.druid.metadata.MetadataStorageTablesConfig) MetadataStorageConnectorConfig(org.apache.druid.metadata.MetadataStorageConnectorConfig) QueryableModule(org.apache.druid.guice.QueryableModule) DruidProcessingModule(org.apache.druid.guice.DruidProcessingModule) QueryRunnerFactoryModule(org.apache.druid.guice.QueryRunnerFactoryModule) DruidNode(org.apache.druid.server.DruidNode) Self(org.apache.druid.guice.annotations.Self)

Example 2 with DruidProcessingModule

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

the class ResetCluster method getModules.

@Override
protected List<? extends Module> getModules() {
    return ImmutableList.of(// See https://github.com/apache/druid/pull/4429#discussion_r123603498
    new DruidProcessingModule(), new QueryableModule(), new QueryRunnerFactoryModule(), binder -> {
        JsonConfigProvider.bindInstance(binder, Key.get(DruidNode.class, Self.class), new DruidNode("tools", "localhost", false, -1, null, true, false));
        JsonConfigProvider.bind(binder, "druid.indexer.task", TaskConfig.class);
    }, new IndexingServiceTaskLogsModule());
}
Also used : QueryableModule(org.apache.druid.guice.QueryableModule) DruidProcessingModule(org.apache.druid.guice.DruidProcessingModule) QueryRunnerFactoryModule(org.apache.druid.guice.QueryRunnerFactoryModule) DruidNode(org.apache.druid.server.DruidNode) Self(org.apache.druid.guice.annotations.Self) IndexingServiceTaskLogsModule(org.apache.druid.guice.IndexingServiceTaskLogsModule)

Example 3 with DruidProcessingModule

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

the class MovingAverageQueryTest method getRequiredModules.

/**
 * Returns a list of any additional Druid Modules necessary to run the test.
 */
private List<Module> getRequiredModules() {
    List<Module> list = new ArrayList<>();
    list.add(new QueryRunnerFactoryModule());
    list.add(new QueryableModule());
    list.add(new DruidProcessingModule());
    return list;
}
Also used : QueryableModule(org.apache.druid.guice.QueryableModule) DruidProcessingModule(org.apache.druid.guice.DruidProcessingModule) ArrayList(java.util.ArrayList) QueryRunnerFactoryModule(org.apache.druid.guice.QueryRunnerFactoryModule) Module(com.google.inject.Module) QueryableModule(org.apache.druid.guice.QueryableModule) QueryRunnerFactoryModule(org.apache.druid.guice.QueryRunnerFactoryModule) DruidProcessingModule(org.apache.druid.guice.DruidProcessingModule)

Example 4 with DruidProcessingModule

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

the class CliHistorical method getModules.

@Override
protected List<? extends Module> getModules() {
    return ImmutableList.of(new DruidProcessingModule(), new QueryableModule(), new QueryRunnerFactoryModule(), new JoinableFactoryModule(), new HistoricalServiceModule(), binder -> {
        binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/historical");
        binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8083);
        binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(8283);
        binder.bindConstant().annotatedWith(PruneLastCompactionState.class).to(true);
        binder.bind(ResponseContextConfig.class).toInstance(ResponseContextConfig.newConfig(true));
        // register Server before binding ZkCoordinator to ensure HTTP endpoints are available immediately
        LifecycleModule.register(binder, Server.class);
        binder.bind(ServerManager.class).in(LazySingleton.class);
        binder.bind(SegmentManager.class).in(LazySingleton.class);
        binder.bind(ZkCoordinator.class).in(ManageLifecycle.class);
        bindQuerySegmentWalker(binder);
        binder.bind(ServerTypeConfig.class).toInstance(new ServerTypeConfig(ServerType.HISTORICAL));
        binder.bind(JettyServerInitializer.class).to(QueryJettyServerInitializer.class).in(LazySingleton.class);
        binder.bind(QueryCountStatsProvider.class).to(QueryResource.class);
        Jerseys.addResource(binder, QueryResource.class);
        Jerseys.addResource(binder, SegmentListerResource.class);
        Jerseys.addResource(binder, HistoricalResource.class);
        LifecycleModule.register(binder, QueryResource.class);
        if (isZkEnabled) {
            LifecycleModule.register(binder, ZkCoordinator.class);
        }
        JsonConfigProvider.bind(binder, "druid.historical.cache", CacheConfig.class);
        binder.install(new CacheModule());
        bindAnnouncer(binder, DiscoverySideEffectsProvider.create());
        Jerseys.addResource(binder, SelfDiscoveryResource.class);
        LifecycleModule.registerKey(binder, Key.get(SelfDiscoveryResource.class));
    }, new LookupModule());
}
Also used : ServerManager(org.apache.druid.server.coordination.ServerManager) SegmentManager(org.apache.druid.server.SegmentManager) QueryCountStatsProvider(org.apache.druid.server.metrics.QueryCountStatsProvider) SelfDiscoveryResource(org.apache.druid.server.http.SelfDiscoveryResource) QueryRunnerFactoryModule(org.apache.druid.guice.QueryRunnerFactoryModule) CacheModule(org.apache.druid.guice.CacheModule) LookupModule(org.apache.druid.query.lookup.LookupModule) ResponseContextConfig(org.apache.druid.server.ResponseContextConfig) HistoricalServiceModule(org.apache.druid.guice.HistoricalServiceModule) PruneLastCompactionState(org.apache.druid.timeline.PruneLastCompactionState) ZkCoordinator(org.apache.druid.server.coordination.ZkCoordinator) QueryableModule(org.apache.druid.guice.QueryableModule) DruidProcessingModule(org.apache.druid.guice.DruidProcessingModule) JoinableFactoryModule(org.apache.druid.guice.JoinableFactoryModule) ServerTypeConfig(org.apache.druid.guice.ServerTypeConfig)

Example 5 with DruidProcessingModule

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

the class CreateTables method getModules.

@Override
protected List<? extends Module> getModules() {
    return ImmutableList.of(// See https://github.com/apache/druid/pull/4429#discussion_r123602930
    new DruidProcessingModule(), new QueryableModule(), new QueryRunnerFactoryModule(), binder -> {
        JsonConfigProvider.bindInstance(binder, Key.get(MetadataStorageConnectorConfig.class), new MetadataStorageConnectorConfig() {

            @Override
            public String getConnectURI() {
                return connectURI;
            }

            @Override
            public String getUser() {
                return user;
            }

            @Override
            public String getPassword() {
                return password;
            }
        });
        JsonConfigProvider.bindInstance(binder, Key.get(MetadataStorageTablesConfig.class), MetadataStorageTablesConfig.fromBase(base));
        JsonConfigProvider.bindInstance(binder, Key.get(DruidNode.class, Self.class), new DruidNode("tools", "localhost", false, -1, null, true, false));
    });
}
Also used : MetadataStorageTablesConfig(org.apache.druid.metadata.MetadataStorageTablesConfig) MetadataStorageConnectorConfig(org.apache.druid.metadata.MetadataStorageConnectorConfig) QueryableModule(org.apache.druid.guice.QueryableModule) DruidProcessingModule(org.apache.druid.guice.DruidProcessingModule) QueryRunnerFactoryModule(org.apache.druid.guice.QueryRunnerFactoryModule) DruidNode(org.apache.druid.server.DruidNode) Self(org.apache.druid.guice.annotations.Self)

Aggregations

DruidProcessingModule (org.apache.druid.guice.DruidProcessingModule)6 QueryRunnerFactoryModule (org.apache.druid.guice.QueryRunnerFactoryModule)6 QueryableModule (org.apache.druid.guice.QueryableModule)6 Self (org.apache.druid.guice.annotations.Self)3 DruidNode (org.apache.druid.server.DruidNode)3 MetadataStorageConnectorConfig (org.apache.druid.metadata.MetadataStorageConnectorConfig)2 MetadataStorageTablesConfig (org.apache.druid.metadata.MetadataStorageTablesConfig)2 Module (com.google.inject.Module)1 ArrayList (java.util.ArrayList)1 CacheModule (org.apache.druid.guice.CacheModule)1 HistoricalServiceModule (org.apache.druid.guice.HistoricalServiceModule)1 IndexingServiceTaskLogsModule (org.apache.druid.guice.IndexingServiceTaskLogsModule)1 JoinableFactoryModule (org.apache.druid.guice.JoinableFactoryModule)1 ServerTypeConfig (org.apache.druid.guice.ServerTypeConfig)1 LookupModule (org.apache.druid.query.lookup.LookupModule)1 ResponseContextConfig (org.apache.druid.server.ResponseContextConfig)1 SegmentManager (org.apache.druid.server.SegmentManager)1 ServerManager (org.apache.druid.server.coordination.ServerManager)1 ZkCoordinator (org.apache.druid.server.coordination.ZkCoordinator)1 SelfDiscoveryResource (org.apache.druid.server.http.SelfDiscoveryResource)1