Search in sources :

Example 1 with QueryableModule

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

the class CliRouter method getModules.

@Override
protected List<? extends Module> getModules() {
    return ImmutableList.of(new RouterProcessingModule(), new QueryableModule(), new QueryRunnerFactoryModule(), new JettyHttpClientModule("druid.router.http", Router.class), JettyHttpClientModule.global(), binder -> {
        binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/router");
        binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8888);
        binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(9088);
        JsonConfigProvider.bind(binder, "druid.router", TieredBrokerConfig.class);
        JsonConfigProvider.bind(binder, "druid.router.avatica.balancer", AvaticaConnectionBalancer.class);
        JsonConfigProvider.bind(binder, "druid.router.managementProxy", ManagementProxyConfig.class);
        binder.bind(QuerySegmentWalker.class).to(NoopQuerySegmentWalker.class).in(LazySingleton.class);
        binder.bind(CoordinatorRuleManager.class);
        LifecycleModule.register(binder, CoordinatorRuleManager.class);
        binder.bind(TieredBrokerHostSelector.class).in(ManageLifecycle.class);
        binder.bind(QueryHostFinder.class).in(LazySingleton.class);
        binder.bind(new TypeLiteral<List<TieredBrokerSelectorStrategy>>() {
        }).toProvider(TieredBrokerSelectorStrategiesProvider.class).in(LazySingleton.class);
        binder.bind(QueryCountStatsProvider.class).to(AsyncQueryForwardingServlet.class).in(LazySingleton.class);
        binder.bind(JettyServerInitializer.class).to(RouterJettyServerInitializer.class).in(LazySingleton.class);
        Jerseys.addResource(binder, RouterResource.class);
        LifecycleModule.register(binder, RouterResource.class);
        LifecycleModule.register(binder, Server.class);
        DiscoveryModule.register(binder, Self.class);
        bindAnnouncer(binder, DiscoverySideEffectsProvider.create());
        Jerseys.addResource(binder, SelfDiscoveryResource.class);
        LifecycleModule.registerKey(binder, Key.get(SelfDiscoveryResource.class));
    }, new LookupSerdeModule());
}
Also used : AsyncQueryForwardingServlet(org.apache.druid.server.AsyncQueryForwardingServlet) LookupSerdeModule(org.apache.druid.query.lookup.LookupSerdeModule) TieredBrokerSelectorStrategiesProvider(org.apache.druid.server.router.TieredBrokerSelectorStrategiesProvider) SelfDiscoveryResource(org.apache.druid.server.http.SelfDiscoveryResource) QueryRunnerFactoryModule(org.apache.druid.guice.QueryRunnerFactoryModule) Router(org.apache.druid.server.router.Router) TieredBrokerHostSelector(org.apache.druid.server.router.TieredBrokerHostSelector) RouterProcessingModule(org.apache.druid.guice.RouterProcessingModule) QueryableModule(org.apache.druid.guice.QueryableModule) NoopQuerySegmentWalker(org.apache.druid.server.NoopQuerySegmentWalker) JettyHttpClientModule(org.apache.druid.guice.http.JettyHttpClientModule) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) QueryHostFinder(org.apache.druid.server.router.QueryHostFinder)

Example 2 with QueryableModule

use of org.apache.druid.guice.QueryableModule 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 3 with QueryableModule

use of org.apache.druid.guice.QueryableModule 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 4 with QueryableModule

use of org.apache.druid.guice.QueryableModule 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 5 with QueryableModule

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

the class CliBroker method getModules.

@Override
protected List<? extends Module> getModules() {
    return ImmutableList.of(new BrokerProcessingModule(), new QueryableModule(), new QueryRunnerFactoryModule(), new SegmentWranglerModule(), new JoinableFactoryModule(), new BrokerServiceModule(), binder -> {
        binder.bindConstant().annotatedWith(Names.named("serviceName")).to(TieredBrokerConfig.DEFAULT_BROKER_SERVICE_NAME);
        binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8082);
        binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(8282);
        binder.bindConstant().annotatedWith(PruneLoadSpec.class).to(true);
        binder.bind(ResponseContextConfig.class).toInstance(ResponseContextConfig.newConfig(false));
        binder.bind(CachingClusteredClient.class).in(LazySingleton.class);
        LifecycleModule.register(binder, BrokerServerView.class);
        binder.bind(TimelineServerView.class).to(BrokerServerView.class).in(LazySingleton.class);
        JsonConfigProvider.bind(binder, "druid.broker.cache", CacheConfig.class);
        binder.install(new CacheModule());
        JsonConfigProvider.bind(binder, "druid.broker.select", TierSelectorStrategy.class);
        JsonConfigProvider.bind(binder, "druid.broker.select.tier.custom", CustomTierSelectorStrategyConfig.class);
        JsonConfigProvider.bind(binder, "druid.broker.balancer", ServerSelectorStrategy.class);
        JsonConfigProvider.bind(binder, "druid.broker.retryPolicy", RetryQueryRunnerConfig.class);
        JsonConfigProvider.bind(binder, "druid.broker.segment", BrokerSegmentWatcherConfig.class);
        JsonConfigProvider.bind(binder, "druid.broker.internal.query.config", BrokerInternalQueryConfig.class);
        binder.bind(QuerySegmentWalker.class).to(ClientQuerySegmentWalker.class).in(LazySingleton.class);
        binder.bind(JettyServerInitializer.class).to(QueryJettyServerInitializer.class).in(LazySingleton.class);
        binder.bind(BrokerQueryResource.class).in(LazySingleton.class);
        Jerseys.addResource(binder, BrokerQueryResource.class);
        binder.bind(QueryCountStatsProvider.class).to(BrokerQueryResource.class).in(LazySingleton.class);
        Jerseys.addResource(binder, BrokerResource.class);
        Jerseys.addResource(binder, ClientInfoResource.class);
        LifecycleModule.register(binder, BrokerQueryResource.class);
        Jerseys.addResource(binder, HttpServerInventoryViewResource.class);
        LifecycleModule.register(binder, Server.class);
        binder.bind(SegmentManager.class).in(LazySingleton.class);
        binder.bind(ZkCoordinator.class).in(ManageLifecycle.class);
        binder.bind(ServerTypeConfig.class).toInstance(new ServerTypeConfig(ServerType.BROKER));
        Jerseys.addResource(binder, HistoricalResource.class);
        Jerseys.addResource(binder, SegmentListerResource.class);
        if (isZkEnabled) {
            LifecycleModule.register(binder, ZkCoordinator.class);
        }
        bindAnnouncer(binder, DiscoverySideEffectsProvider.withLegacyAnnouncer());
        Jerseys.addResource(binder, SelfDiscoveryResource.class);
        LifecycleModule.registerKey(binder, Key.get(SelfDiscoveryResource.class));
    }, new LookupModule(), new SqlModule());
}
Also used : CachingClusteredClient(org.apache.druid.client.CachingClusteredClient) SegmentManager(org.apache.druid.server.SegmentManager) SegmentWranglerModule(org.apache.druid.guice.SegmentWranglerModule) BrokerServerView(org.apache.druid.client.BrokerServerView) 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) BrokerServiceModule(org.apache.druid.guice.BrokerServiceModule) ZkCoordinator(org.apache.druid.server.coordination.ZkCoordinator) QueryableModule(org.apache.druid.guice.QueryableModule) PruneLoadSpec(org.apache.druid.timeline.PruneLoadSpec) BrokerQueryResource(org.apache.druid.server.BrokerQueryResource) JoinableFactoryModule(org.apache.druid.guice.JoinableFactoryModule) ClientQuerySegmentWalker(org.apache.druid.server.ClientQuerySegmentWalker) BrokerProcessingModule(org.apache.druid.guice.BrokerProcessingModule) SqlModule(org.apache.druid.sql.guice.SqlModule) ServerTypeConfig(org.apache.druid.guice.ServerTypeConfig)

Aggregations

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