use of org.apache.druid.guice.QueryRunnerFactoryModule 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());
}
use of org.apache.druid.guice.QueryRunnerFactoryModule 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));
});
}
use of org.apache.druid.guice.QueryRunnerFactoryModule in project druid by druid-io.
the class DruidJsonValidator method getModules.
@Override
protected List<? extends com.google.inject.Module> getModules() {
return ImmutableList.of(// See https://github.com/apache/druid/pull/4429#discussion_r123603498
new DruidProcessingModule(), new QueryableModule(), new QueryRunnerFactoryModule(), binder -> {
binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/validator");
binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0);
binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1);
});
}
Aggregations