use of org.apache.druid.guice.RouterProcessingModule 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());
}
Aggregations