@Override protected List<? extends com.google.inject.Module> getModules() { return ImmutableList.of( // It's unknown if those modules are required in DruidJsonValidator. // Maybe some of those modules could be removed. // See https://github.com/apache/incubator-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); } ); }
@Override protected void configure() { bindConstant().annotatedWith(ApiVersion.class).to("1.0"); bind(new TypeLiteral<Function<Server, Map<String, String>>>() { }).to(ServerToMap.class); }
@Override public void configure(Binder binder) binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/tool"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(9999); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); binder.bind(DruidProcessingConfig.class).toInstance( new DruidProcessingConfig()
@Override protected void configure() { bindConstant().annotatedWith(Provider.class).to("rackspace"); bind(new TypeLiteral<Supplier<URI>>() { }).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity"))); install(new FactoryModuleBuilder().implement(ZoneIdToURISupplier.class, ZoneIdToURIFromAccessForTypeAndVersion.class).build(ZoneIdToURISupplier.Factory.class)); }
@Override public void configure(Binder binder) binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/tool"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(9999); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); binder.bind(DruidProcessingConfig.class).toInstance( new DruidProcessingConfig()
@Override protected void configure() { bindConstant().annotatedWith(Provider.class).to("keystone"); install(new FactoryModuleBuilder().implement(ImplicitRegionIdSupplier.class, V1DefaultRegionIdSupplier.class) .build(V1DefaultRegionIdSupplier.Factory.class)); }
@Override protected List<? extends Module> getModules() { return ImmutableList.of( new DruidProcessingModule(), new QueryableModule(), new QueryRunnerFactoryModule(), new RealtimeModule(), binder -> { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/realtime"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8084); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(8284); binder.bind(DataSegmentPusher.class).to(NoopDataSegmentPusher.class).in(LazySingleton.class); binder.bind(DataSegmentAnnouncer.class).to(NoopDataSegmentAnnouncer.class).in(LazySingleton.class); binder.bind(InventoryView.class).to(NoopInventoryView.class).in(LazySingleton.class); binder.bind(ServerView.class).to(NoopServerView.class).in(LazySingleton.class); }, new ChatHandlerServerModule(properties), new LookupModule() ); }
@Override public void configure(Binder binder) { binder.bind(FlowConfigsResourceHandler.class) .annotatedWith(Names.named(FlowConfigsResource.INJECT_FLOW_CONFIG_RESOURCE_HANDLER)) .toInstance(GobblinServiceManager.this.resourceHandler); binder.bind(FlowConfigsResourceHandler.class) .annotatedWith(Names.named(FlowConfigsV2Resource.FLOW_CONFIG_GENERATOR_INJECT_NAME)) .toInstance(GobblinServiceManager.this.v2ResourceHandler); binder.bindConstant() .annotatedWith(Names.named(FlowConfigsResource.INJECT_READY_TO_USE)) .to(Boolean.TRUE); binder.bind(RequesterService.class) .annotatedWith(Names.named(FlowConfigsResource.INJECT_REQUESTER_SERVICE)) .toInstance(new NoopRequesterService(config)); } });
/** Bind classes that are specific to the cluster connection @param binder @param config */ private void bindCassandraClient(Binder binder, ClusterConfiguration config) { binder.bind(ClusterConfiguration.class).toInstance(config); binder.bind(CassandraClient.class).to(CassandraClientImpl.class); binder.bindConstant().annotatedWith(Names.named("request_retry_count")).to(config.getRequestRetryCount()); binder.bindConstant().annotatedWith(Names.named("cluster_name")).to(config.getClusterName()); binder.bind(KairosRetryPolicy.class); }
@Override protected List<? extends Module> getModules() { return ImmutableList.of( binder -> { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/internal-hadoop-indexer"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); // bind metadata storage config based on HadoopIOConfig MetadataStorageUpdaterJobSpec metadataSpec = getHadoopDruidIndexerConfig().getSchema() .getIOConfig() .getMetadataUpdateSpec(); binder.bind(new TypeLiteral<Supplier<MetadataStorageConnectorConfig>>() {}) .toInstance(metadataSpec); binder.bind(MetadataStorageTablesConfig.class).toInstance(metadataSpec.getMetadataStorageTablesConfig()); binder.bind(IndexerMetadataStorageCoordinator.class).to(IndexerSQLMetadataStorageCoordinator.class).in( LazySingleton.class ); } ); }
@Override protected List<? extends Module> getModules() { return ImmutableList.of( new DruidProcessingModule(), new QueryableModule(), new QueryRunnerFactoryModule(), new RealtimeModule(), binder -> { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/realtime"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8084); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(8284); }, new ChatHandlerServerModule(properties), new LookupModule() ); } }
@Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/test/memcached"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); binder.bind(MemcachedCacheConfig.class).toInstance(config); binder.bind(Cache.class).toProvider(MemcachedProviderWithConfig.class).in(ManageLifecycle.class); } }
@Override public void configure(Binder 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(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.builder(NodeType.ROUTER).build() ); } },
@Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/test/memcached"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); binder.bind(Cache.class).toProvider(CacheProvider.class); JsonConfigProvider.bind(binder, uuid, CacheProvider.class); } }
@Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/test"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); JsonConfigProvider.bind(binder, configPrefix, clazz); } };
@Override public void configure(Binder binder) binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/middlemanager"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8091); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(8291);
@Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/test"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); // See IndexingServiceModuleHelper JsonConfigProvider.bind(binder, indexerPropertyString, IndexerZkConfig.class); JsonConfigProvider.bind(binder, zkServiceConfigString, ZkPathsConfig.class); } };
@Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("hybridTest"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(-1); binder.install(new CacheModule(prefix)); } }
.annotatedWith(Names.named("serviceName")) .to(IndexingServiceSelectorConfig.DEFAULT_SERVICE_NAME); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8090); binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(8290);
new QueryRunnerFactoryModule(), 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);