@Override public void configure(Binder binder) { configBinder(binder).bindConfig(DbResourceGroupConfig.class); binder.bind(ResourceGroupsDao.class).toProvider(MysqlDaoProvider.class).in(Scopes.SINGLETON); binder.bind(DbResourceGroupConfigurationManager.class).in(Scopes.SINGLETON); binder.bind(ResourceGroupConfigurationManager.class).to(DbResourceGroupConfigurationManager.class).in(Scopes.SINGLETON); newExporter(binder).export(DbResourceGroupConfigurationManager.class).withGeneratedName(); } }
@Override public void configure(Binder binder) { driftClientBinder(binder) .bindDriftClient(PrestoThriftService.class) .withExceptionClassifier(t -> { if (t instanceof PrestoThriftServiceException) { boolean retryable = ((PrestoThriftServiceException) t).isRetryable(); return new ExceptionClassification(Optional.of(retryable), HostStatus.NORMAL); } return NORMAL_EXCEPTION; }); binder.bind(ThriftConnector.class).in(Scopes.SINGLETON); binder.bind(ThriftMetadata.class).in(Scopes.SINGLETON); binder.bind(ThriftSplitManager.class).in(Scopes.SINGLETON); binder.bind(ThriftPageSourceProvider.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(ThriftConnectorConfig.class); binder.bind(ThriftSessionProperties.class).in(Scopes.SINGLETON); binder.bind(ThriftIndexProvider.class).in(Scopes.SINGLETON); binder.bind(ThriftConnectorStats.class).in(Scopes.SINGLETON); newExporter(binder).export(ThriftConnectorStats.class) .as(generatedNameOf(ThriftConnectorStats.class, connectorId)); }
@Override public void configure(Binder binder) { binder.disableCircularProxies(); binder.bind(NodeInfo.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(NodeConfig.class); newExporter(binder).export(NodeInfo.class).withGeneratedName(); } }
@Override public void configure(Binder binder) { binder.bind(AccessControlManager.class).in(Scopes.SINGLETON); binder.bind(AccessControl.class).to(AccessControlManager.class).in(Scopes.SINGLETON); newExporter(binder).export(AccessControlManager.class).withGeneratedName(); } }
@Override public void configure(Binder binder) { binder.install(new MBeanModule()); // bind the configuration configBinder(binder).bindConfig(H2EmbeddedDataSourceConfig.class, annotation, propertyPrefix); // Bind the datasource binder.bind(DataSource.class).annotatedWith(annotation).toProvider(new H2EmbeddedDataSourceProvider(annotation)).in(Scopes.SINGLETON); newExporter(binder).export(DataSource.class).annotatedWith(annotation).withGeneratedName(); // Bind aliases Key<DataSource> key = Key.get(DataSource.class, annotation); for (Class<? extends Annotation> alias : aliases) { binder.bind(DataSource.class).annotatedWith(alias).to(key); } }
@Override public void configure() { // bind the configuration bindConfig(binder).annotatedWith(annotation).prefixedWith(name).to(HttpClientConfig.class); // bind the client binder.bind(HttpClient.class).annotatedWith(annotation).toProvider(new HttpClientProvider(annotation)).in(Scopes.SINGLETON); // kick off the binding for the filter set newSetBinder(binder, HttpRequestFilter.class, filterQualifier(annotation)); // export stats newExporter(rootBinder).export(HttpClient.class).annotatedWith(annotation).withGeneratedName(); }
protected DigdagEmbed.Bootstrap digdagBootstrap() { return new DigdagEmbed.Bootstrap() .setEnvironment(serverConfig.getEnvironment()) .setSystemConfig(serverConfig.getSystemConfig()) //.setSystemPlugins(loadSystemPlugins(serverConfig.getSystemConfig())) .overrideModulesWith((binder) -> { binder.bind(WorkspaceManager.class).to(ExtractArchiveWorkspaceManager.class).in(Scopes.SINGLETON); binder.bind(Version.class).toInstance(version); }) .addModules((binder) -> { binder.bind(ServerRuntimeInfoWriter.class).asEagerSingleton(); binder.bind(ServerConfig.class).toInstance(serverConfig); binder.bind(WorkflowExecutorLoop.class).asEagerSingleton(); binder.bind(WorkflowExecutionTimeoutEnforcer.class).asEagerSingleton(); binder.bind(ClientVersionChecker.class).toProvider(ClientVersionCheckerProvider.class); binder.bind(ErrorReporter.class).to(JmxErrorReporter.class).in(Scopes.SINGLETON); newExporter(binder).export(ErrorReporter.class).withGeneratedName(); }) .addModules(new ServerModule(serverConfig)); }
@Override public void configure(Binder binder) binder.requireExplicitBindings(); binder.disableCircularProxies(); binder.bind(new TypeLiteral<Supplier<DateTime>>() {}).to(RealTimeSupplier.class).in(Scopes.SINGLETON); binder.bind(ConflictResolver.class).in(Scopes.SINGLETON); Key<RemoteStore> remoteStoreKey = Key.get(RemoteStore.class, annotation); configBinder(binder).bindConfig(StoreConfig.class, annotation, name); httpClientBinder(binder).bindHttpClient(name, annotation); binder.bind(DistributedStore.class).annotatedWith(annotation).toProvider(new DistributedStoreProvider(name, localStoreKey, storeConfigKey, remoteStoreKey)).in(Scopes.SINGLETON); binder.bind(Replicator.class).annotatedWith(annotation).toProvider(new ReplicatorProvider(name, localStoreKey, httpClientKey, storeConfigKey)).in(Scopes.SINGLETON); binder.bind(HttpRemoteStore.class).annotatedWith(annotation).toProvider(new RemoteHttpStoreProvider(name, httpClientKey, storeConfigKey)).in(Scopes.SINGLETON); binder.bind(LocalStore.class).annotatedWith(annotation).to(localStoreClass).in(Scopes.SINGLETON); binder.bind(RemoteStore.class).annotatedWith(annotation).to(Key.get(HttpRemoteStore.class, annotation)); newExporter(binder).export(DistributedStore.class).annotatedWith(annotation).as(generatedNameOf(DistributedStore.class, named(name))); newExporter(binder).export(HttpRemoteStore.class).annotatedWith(annotation).as(generatedNameOf(HttpRemoteStore.class, named(name))); newExporter(binder).export(Replicator.class).annotatedWith(annotation).as(generatedNameOf(Replicator.class, named(name)));
@Override public void configure(Binder binder) { // for backwards compatibility binder.install(new EventModule()); binder.bind(JsonEventWriter.class).in(Scopes.SINGLETON); binder.bind(HttpEventClient.class).in(Scopes.SINGLETON); newSetBinder(binder, EventClient.class).addBinding().to(Key.get(HttpEventClient.class)).in(Scopes.SINGLETON); newExporter(binder).export(EventClient.class).withGeneratedName(); discoveryBinder(binder).bindHttpSelector("collector"); // bind the http client httpClientBinder(binder).bindHttpClient("event", ForEventClient.class); // Kick off the binding of Set<EventTypeMetadata> in case no events are bound newSetBinder(binder, new TypeLiteral<EventTypeMetadata<?>>() {}); } }
@Override public void configure(Binder binder) { binder.bind(NodeInfo.class).in(Scopes.SINGLETON); NodeConfig nodeConfig = new NodeConfig() .setEnvironment(environment) .setNodeInternalAddress(InetAddresses.toAddrString(getV4Localhost())) .setNodeBindIp(getV4Localhost()); if (pool.isPresent()) { nodeConfig.setPool(pool.get()); } binder.bind(NodeConfig.class).toInstance(nodeConfig); newExporter(binder).export(NodeInfo.class).withGeneratedName(); }
@Override public void configure(Binder binder) { binder.disableCircularProxies(); binder.bind(LoggingMBean.class).in(Scopes.SINGLETON); newExporter(binder).export(LoggingMBean.class).as("io.airlift.log:name=Logging"); }
@Override public void configure(Binder binder) { binder.disableCircularProxies(); binder.bind(NodeInfo.class).in(Scopes.SINGLETON); bindConfig(binder).bind(NodeConfig.class); newExporter(binder).export(NodeInfo.class).withGeneratedName(); } }
@Override public void configure(Binder binder) { binder.disableCircularProxies(); binder.bind(NodeInfo.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(NodeConfig.class); newExporter(binder).export(NodeInfo.class).withGeneratedName(); } }
@Override public void configure(Binder binder) { binder.bind(AccessControlManager.class).in(Scopes.SINGLETON); binder.bind(AccessControl.class).to(AccessControlManager.class).in(Scopes.SINGLETON); newExporter(binder).export(AccessControlManager.class).withGeneratedName(); } }
@Override public void configure(Binder binder) { binder.install(new MBeanModule()); // bind the configuration configBinder(binder).bindConfig(H2EmbeddedDataSourceConfig.class, annotation, propertyPrefix); // Bind the datasource binder.bind(DataSource.class).annotatedWith(annotation).toProvider(new H2EmbeddedDataSourceProvider(annotation)).in(Scopes.SINGLETON); newExporter(binder).export(DataSource.class).annotatedWith(annotation).withGeneratedName(); // Bind aliases Key<DataSource> key = Key.get(DataSource.class, annotation); for (Class<? extends Annotation> alias : aliases) { binder.bind(DataSource.class).annotatedWith(alias).to(key); } }
@Override public void configure() { // bind the configuration bindConfig(binder).annotatedWith(annotation).prefixedWith(name).to(HttpClientConfig.class); bindConfig(binder).annotatedWith(annotation).prefixedWith(name).to(NettyAsyncHttpClientConfig.class); // Shared thread pool bindConfig(binder).to(NettyIoPoolConfig.class); binder.bind(NettyIoPool.class).toProvider(SharedNettyIoPoolProvider.class).in(Scopes.SINGLETON); // bind the async client binder.bind(AsyncHttpClient.class).annotatedWith(annotation).toProvider(new HttpClientProvider(name, annotation)).in(Scopes.SINGLETON); // bind the a sync client also binder.bind(HttpClient.class).annotatedWith(annotation).to(Key.get(AsyncHttpClient.class, annotation)); // kick off the binding for the filter set newSetBinder(binder, HttpRequestFilter.class, filterQualifier(annotation)); // export stats newExporter(firstNonNull(rootBinder, binder)).export(AsyncHttpClient.class).annotatedWith(annotation).withGeneratedName(); }
@Override public void configure(Binder binder) { // for backwards compatibility binder.install(new EventModule()); binder.bind(JsonEventWriter.class).in(Scopes.SINGLETON); binder.bind(HttpEventClient.class).in(Scopes.SINGLETON); newSetBinder(binder, EventClient.class).addBinding().to(Key.get(HttpEventClient.class)).in(Scopes.SINGLETON); newExporter(binder).export(EventClient.class).withGeneratedName(); discoveryBinder(binder).bindHttpSelector("collector"); // bind the http client httpClientBinder(binder).bindHttpClient("event", ForEventClient.class); // Kick off the binding of Set<EventTypeMetadata> in case no events are bound newSetBinder(binder, new TypeLiteral<EventTypeMetadata<?>>() {}); } }
@Override public void configure(Binder binder) { NodeConfig nodeConfig = new NodeConfig() .setEnvironment(environment) .setNodeInternalIp(getV4Localhost()) .setNodeBindIp(getV4Localhost()); if (pool.isPresent()) { nodeConfig.setPool(pool.get()); } binder.bind(NodeConfig.class).toInstance(nodeConfig); newExporter(binder).export(NodeInfo.class).withGeneratedName(); }
@Override public void configure(Binder binder) { binder.disableCircularProxies(); binder.bind(LoggingMBean.class).in(Scopes.SINGLETON); newExporter(binder).export(LoggingMBean.class).as("com.proofpoint.log:name=Logging"); }
@Override public void configure(Binder binder) { configBinder(binder).bindConfig(FileHiveMetastoreConfig.class); binder.bind(ExtendedHiveMetastore.class).annotatedWith(ForCachingHiveMetastore.class).to(FileHiveMetastore.class).in(Scopes.SINGLETON); binder.bind(ExtendedHiveMetastore.class).to(CachingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generatedNameOf(CachingHiveMetastore.class, connectorId)); } }