Search in sources :

Example 1 with JettyHttpClientModule

use of org.apache.druid.guice.http.JettyHttpClientModule 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)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 List (java.util.List)1 QueryRunnerFactoryModule (org.apache.druid.guice.QueryRunnerFactoryModule)1 QueryableModule (org.apache.druid.guice.QueryableModule)1 RouterProcessingModule (org.apache.druid.guice.RouterProcessingModule)1 JettyHttpClientModule (org.apache.druid.guice.http.JettyHttpClientModule)1 LookupSerdeModule (org.apache.druid.query.lookup.LookupSerdeModule)1 AsyncQueryForwardingServlet (org.apache.druid.server.AsyncQueryForwardingServlet)1 NoopQuerySegmentWalker (org.apache.druid.server.NoopQuerySegmentWalker)1 SelfDiscoveryResource (org.apache.druid.server.http.SelfDiscoveryResource)1 QueryHostFinder (org.apache.druid.server.router.QueryHostFinder)1 Router (org.apache.druid.server.router.Router)1 TieredBrokerHostSelector (org.apache.druid.server.router.TieredBrokerHostSelector)1 TieredBrokerSelectorStrategiesProvider (org.apache.druid.server.router.TieredBrokerSelectorStrategiesProvider)1