use of com.facebook.presto.cost.StatsCalculatorModule in project presto by prestodb.
the class PrestoSparkModule method setup.
@Override
protected void setup(Binder binder) {
// configs
// TODO: decouple configuration properties that don't make sense on Spark
configBinder(binder).bindConfig(NodeSchedulerConfig.class);
configBinder(binder).bindConfig(SimpleTtlNodeSelectorConfig.class);
configBinder(binder).bindConfig(QueryManagerConfig.class);
configBinder(binder).bindConfigGlobalDefaults(QueryManagerConfig.class, PrestoSparkSettingsRequirements::setDefaults);
configBinder(binder).bindConfig(FeaturesConfig.class);
configBinder(binder).bindConfigGlobalDefaults(FeaturesConfig.class, PrestoSparkSettingsRequirements::setDefaults);
configBinder(binder).bindConfig(MemoryManagerConfig.class);
configBinder(binder).bindConfig(TaskManagerConfig.class);
configBinder(binder).bindConfig(TransactionManagerConfig.class);
configBinder(binder).bindConfig(NodeMemoryConfig.class);
configBinder(binder).bindConfig(WarningCollectorConfig.class);
configBinder(binder).bindConfig(NodeSpillConfig.class);
configBinder(binder).bindConfig(CompilerConfig.class);
configBinder(binder).bindConfig(SqlEnvironmentConfig.class);
configBinder(binder).bindConfig(StaticFunctionNamespaceStoreConfig.class);
configBinder(binder).bindConfig(PrestoSparkConfig.class);
configBinder(binder).bindConfig(TracingConfig.class);
// json codecs
jsonCodecBinder(binder).bindJsonCodec(ViewDefinition.class);
jsonCodecBinder(binder).bindJsonCodec(TaskInfo.class);
jsonCodecBinder(binder).bindJsonCodec(PrestoSparkTaskDescriptor.class);
jsonCodecBinder(binder).bindJsonCodec(PlanFragment.class);
jsonCodecBinder(binder).bindJsonCodec(TaskSource.class);
jsonCodecBinder(binder).bindJsonCodec(TableCommitContext.class);
jsonCodecBinder(binder).bindJsonCodec(ExplainAnalyzeContext.class);
jsonCodecBinder(binder).bindJsonCodec(ExecutionFailureInfo.class);
jsonCodecBinder(binder).bindJsonCodec(StageInfo.class);
jsonCodecBinder(binder).bindJsonCodec(OperatorStats.class);
jsonCodecBinder(binder).bindJsonCodec(QueryInfo.class);
jsonCodecBinder(binder).bindJsonCodec(PrestoSparkQueryStatusInfo.class);
jsonCodecBinder(binder).bindJsonCodec(PrestoSparkQueryData.class);
jsonCodecBinder(binder).bindListJsonCodec(TaskMemoryReservationSummary.class);
// smile codecs
smileCodecBinder(binder).bindSmileCodec(TaskSource.class);
smileCodecBinder(binder).bindSmileCodec(TaskInfo.class);
PrestoSparkConfig prestoSparkConfig = buildConfigObject(PrestoSparkConfig.class);
if (prestoSparkConfig.isSmileSerializationEnabled()) {
binder.bind(new TypeLiteral<Codec<TaskSource>>() {
}).to(new TypeLiteral<SmileCodec<TaskSource>>() {
}).in(Scopes.SINGLETON);
binder.bind(new TypeLiteral<Codec<TaskInfo>>() {
}).to(new TypeLiteral<SmileCodec<TaskInfo>>() {
}).in(Scopes.SINGLETON);
} else {
binder.bind(new TypeLiteral<Codec<TaskSource>>() {
}).to(new TypeLiteral<JsonCodec<TaskSource>>() {
}).in(Scopes.SINGLETON);
binder.bind(new TypeLiteral<Codec<TaskInfo>>() {
}).to(new TypeLiteral<JsonCodec<TaskInfo>>() {
}).in(Scopes.SINGLETON);
}
// index manager
binder.bind(IndexManager.class).in(Scopes.SINGLETON);
// handle resolver
binder.install(new HandleJsonModule());
// plugin manager
configBinder(binder).bindConfig(PluginManagerConfig.class);
binder.bind(PluginManager.class).in(Scopes.SINGLETON);
// catalog manager
binder.bind(StaticCatalogStore.class).in(Scopes.SINGLETON);
configBinder(binder).bindConfig(StaticCatalogStoreConfig.class);
// catalog
binder.bind(ConnectorManager.class).in(Scopes.SINGLETON);
binder.bind(CatalogManager.class).in(Scopes.SINGLETON);
// property managers
binder.bind(SessionPropertyManager.class).toProvider(PrestoSparkSessionPropertyManagerProvider.class).in(Scopes.SINGLETON);
binder.bind(SystemSessionProperties.class).in(Scopes.SINGLETON);
binder.bind(PrestoSparkSessionProperties.class).in(Scopes.SINGLETON);
binder.bind(SessionPropertyDefaults.class).in(Scopes.SINGLETON);
binder.bind(SchemaPropertyManager.class).in(Scopes.SINGLETON);
binder.bind(TablePropertyManager.class).in(Scopes.SINGLETON);
binder.bind(ColumnPropertyManager.class).in(Scopes.SINGLETON);
binder.bind(AnalyzePropertyManager.class).in(Scopes.SINGLETON);
binder.bind(QuerySessionSupplier.class).in(Scopes.SINGLETON);
// block encodings
binder.bind(BlockEncodingManager.class).in(Scopes.SINGLETON);
binder.bind(BlockEncodingSerde.class).to(BlockEncodingManager.class).in(Scopes.SINGLETON);
newSetBinder(binder, BlockEncoding.class);
jsonBinder(binder).addSerializerBinding(Block.class).to(BlockJsonSerde.Serializer.class);
jsonBinder(binder).addDeserializerBinding(Block.class).to(BlockJsonSerde.Deserializer.class);
// metadata
binder.bind(FunctionAndTypeManager.class).in(Scopes.SINGLETON);
binder.bind(MetadataManager.class).in(Scopes.SINGLETON);
binder.bind(Metadata.class).to(MetadataManager.class).in(Scopes.SINGLETON);
binder.bind(StaticFunctionNamespaceStore.class).in(Scopes.SINGLETON);
// type
newSetBinder(binder, Type.class);
binder.bind(TypeManager.class).to(FunctionAndTypeManager.class).in(Scopes.SINGLETON);
jsonBinder(binder).addDeserializerBinding(Type.class).to(TypeDeserializer.class);
// PageSorter
binder.bind(PageSorter.class).to(PagesIndexPageSorter.class).in(Scopes.SINGLETON);
// PageIndexer
binder.bind(PagesIndex.Factory.class).to(PagesIndex.DefaultFactory.class);
binder.bind(PageIndexerFactory.class).to(GroupByHashPageIndexerFactory.class).in(Scopes.SINGLETON);
// compilers
binder.bind(JoinFilterFunctionCompiler.class).in(Scopes.SINGLETON);
newExporter(binder).export(JoinFilterFunctionCompiler.class).withGeneratedName();
binder.bind(JoinCompiler.class).in(Scopes.SINGLETON);
newExporter(binder).export(JoinCompiler.class).withGeneratedName();
binder.bind(OrderingCompiler.class).in(Scopes.SINGLETON);
newExporter(binder).export(OrderingCompiler.class).withGeneratedName();
binder.bind(LookupJoinOperators.class).in(Scopes.SINGLETON);
binder.bind(DomainTranslator.class).to(RowExpressionDomainTranslator.class).in(Scopes.SINGLETON);
binder.bind(PredicateCompiler.class).to(RowExpressionPredicateCompiler.class).in(Scopes.SINGLETON);
binder.bind(DeterminismEvaluator.class).to(RowExpressionDeterminismEvaluator.class).in(Scopes.SINGLETON);
binder.bind(ExpressionCompiler.class).in(Scopes.SINGLETON);
binder.bind(PageFunctionCompiler.class).in(Scopes.SINGLETON);
// split manager
binder.bind(SplitManager.class).in(Scopes.SINGLETON);
// partitioning provider manager
binder.bind(PartitioningProviderManager.class).in(Scopes.SINGLETON);
// executors
ExecutorService executor = newCachedThreadPool(daemonThreadsNamed("presto-spark-executor-%s"));
binder.bind(Executor.class).toInstance(executor);
binder.bind(ExecutorService.class).toInstance(executor);
binder.bind(ScheduledExecutorService.class).toInstance(newScheduledThreadPool(0, daemonThreadsNamed("presto-spark-scheduled-executor-%s")));
// task executor
binder.bind(EmbedVersion.class).in(Scopes.SINGLETON);
binder.bind(MultilevelSplitQueue.class).in(Scopes.SINGLETON);
binder.bind(TaskExecutor.class).in(Scopes.SINGLETON);
// data stream provider
binder.bind(PageSourceManager.class).in(Scopes.SINGLETON);
binder.bind(PageSourceProvider.class).to(PageSourceManager.class).in(Scopes.SINGLETON);
// connector distributed metadata manager
binder.bind(ConnectorMetadataUpdaterManager.class).in(Scopes.SINGLETON);
// page sink provider
binder.bind(PageSinkManager.class).in(Scopes.SINGLETON);
binder.bind(PageSinkProvider.class).to(PageSinkManager.class).in(Scopes.SINGLETON);
// query explainer
binder.bind(QueryExplainer.class).in(Scopes.SINGLETON);
// parser
binder.bind(PlanChecker.class).in(Scopes.SINGLETON);
binder.bind(SqlParser.class).in(Scopes.SINGLETON);
binder.bind(SqlParserOptions.class).toInstance(sqlParserOptions);
// planner
binder.bind(PlanFragmenter.class).in(Scopes.SINGLETON);
binder.bind(PlanOptimizers.class).in(Scopes.SINGLETON);
binder.bind(ConnectorPlanOptimizerManager.class).in(Scopes.SINGLETON);
binder.bind(LocalExecutionPlanner.class).in(Scopes.SINGLETON);
configBinder(binder).bindConfig(FileFragmentResultCacheConfig.class);
binder.bind(FragmentCacheStats.class).in(Scopes.SINGLETON);
binder.bind(IndexJoinLookupStats.class).in(Scopes.SINGLETON);
binder.bind(QueryIdGenerator.class).in(Scopes.SINGLETON);
binder.bind(QueryPreparer.class).in(Scopes.SINGLETON);
jsonBinder(binder).addKeySerializerBinding(VariableReferenceExpression.class).to(VariableReferenceExpressionSerializer.class);
jsonBinder(binder).addKeyDeserializerBinding(VariableReferenceExpression.class).to(VariableReferenceExpressionDeserializer.class);
// statistics calculator / cost calculator
binder.install(new StatsCalculatorModule());
binder.bind(CostCalculator.class).to(CostCalculatorUsingExchanges.class).in(Scopes.SINGLETON);
binder.bind(CostCalculator.class).annotatedWith(CostCalculator.EstimatedExchanges.class).to(CostCalculatorWithEstimatedExchanges.class).in(Scopes.SINGLETON);
binder.bind(CostComparator.class).in(Scopes.SINGLETON);
// JMX (Do not export to the real MXBean server, as the Presto context may be created multiple times per JVM)
binder.bind(MBeanServer.class).toInstance(new TestingMBeanServer());
binder.bind(MBeanExporter.class).in(Scopes.SINGLETON);
// spill
binder.bind(SpillerFactory.class).to(GenericSpillerFactory.class).in(Scopes.SINGLETON);
binder.bind(SingleStreamSpillerFactory.class).to(TempStorageSingleStreamSpillerFactory.class).in(Scopes.SINGLETON);
binder.bind(PartitioningSpillerFactory.class).to(GenericPartitioningSpillerFactory.class).in(Scopes.SINGLETON);
binder.bind(SpillerStats.class).in(Scopes.SINGLETON);
binder.bind(StandaloneSpillerFactory.class).to(TempStorageStandaloneSpillerFactory.class).in(Scopes.SINGLETON);
// monitoring
jsonCodecBinder(binder).bindJsonCodec(OperatorInfo.class);
binder.bind(QueryMonitor.class).in(Scopes.SINGLETON);
configBinder(binder).bindConfig(QueryMonitorConfig.class);
binder.bind(SplitMonitor.class).in(Scopes.SINGLETON);
// Determine the NodeVersion
ServerConfig serverConfig = buildConfigObject(ServerConfig.class);
NodeVersion nodeVersion = new NodeVersion(serverConfig.getPrestoVersion());
binder.bind(NodeVersion.class).toInstance(nodeVersion);
// Support DDL statements. Helper class binds DDL statements to DataDefinitionTasks
PrestoDataDefBindingHelper.bindDDLDefinitionTasks(binder);
// TODO: Decouple node specific system tables
binder.bind(QueryManager.class).to(PrestoSparkQueryManager.class).in(Scopes.SINGLETON);
binder.bind(TaskManager.class).to(PrestoSparkTaskManager.class).in(Scopes.SINGLETON);
binder.install(new SystemConnectorModule());
// TODO: support explain analyze for Spark
binder.bind(new TypeLiteral<Optional<ExplainAnalyzeContext>>() {
}).toInstance(Optional.of(new ExplainAnalyzeContext((queryId) -> {
throw new UnsupportedOperationException("explain analyze is not supported");
})));
// TODO: support CBO, supply real nodes count
binder.bind(TaskCountEstimator.class).toInstance(new TaskCountEstimator(() -> 1000));
// TODO: Decouple and remove: required by ConnectorManager
binder.bind(InternalNodeManager.class).toInstance(new PrestoSparkInternalNodeManager());
// TODO: Decouple and remove: required by PluginManager
binder.bind(InternalResourceGroupManager.class).in(Scopes.SINGLETON);
binder.bind(ResourceGroupManager.class).to(InternalResourceGroupManager.class);
binder.bind(new TypeLiteral<ResourceGroupManager<?>>() {
}).to(new TypeLiteral<InternalResourceGroupManager<?>>() {
});
binder.bind(LegacyResourceGroupConfigurationManager.class).in(Scopes.SINGLETON);
binder.bind(ClusterMemoryPoolManager.class).toInstance(((poolId, listener) -> {
}));
binder.bind(QueryPrerequisitesManager.class).in(Scopes.SINGLETON);
binder.bind(ResourceGroupService.class).to(NoopResourceGroupService.class).in(Scopes.SINGLETON);
binder.bind(NodeTtlFetcherManager.class).to(ThrowingNodeTtlFetcherManager.class).in(Scopes.SINGLETON);
binder.bind(ClusterTtlProviderManager.class).to(ThrowingClusterTtlProviderManager.class).in(Scopes.SINGLETON);
// TODO: Decouple and remove: required by SessionPropertyDefaults, PluginManager, InternalResourceGroupManager, ConnectorManager
configBinder(binder).bindConfig(NodeConfig.class);
binder.bind(NodeInfo.class).in(Scopes.SINGLETON);
// TODO: Decouple and remove: required by LocalExecutionPlanner, PlanFragmenter
binder.bind(NodePartitioningManager.class).to(PrestoSparkNodePartitioningManager.class).in(Scopes.SINGLETON);
// TODO: Decouple and remove: required by PluginManager
install(new ServerSecurityModule());
// spark specific
binder.bind(SparkProcessType.class).toInstance(sparkProcessType);
binder.bind(PrestoSparkExecutionExceptionFactory.class).in(Scopes.SINGLETON);
binder.bind(PrestoSparkSettingsRequirements.class).in(Scopes.SINGLETON);
binder.bind(PrestoSparkQueryPlanner.class).in(Scopes.SINGLETON);
binder.bind(PrestoSparkPlanFragmenter.class).in(Scopes.SINGLETON);
binder.bind(PrestoSparkRddFactory.class).in(Scopes.SINGLETON);
binder.bind(PrestoSparkTaskExecutorFactory.class).in(Scopes.SINGLETON);
binder.bind(PrestoSparkQueryExecutionFactory.class).in(Scopes.SINGLETON);
binder.bind(PrestoSparkService.class).in(Scopes.SINGLETON);
binder.bind(PrestoSparkBroadcastTableCacheManager.class).in(Scopes.SINGLETON);
newSetBinder(binder, PrestoSparkServiceWaitTimeMetrics.class);
// extra credentials and authenticator for Presto-on-Spark
newSetBinder(binder, PrestoSparkCredentialsProvider.class);
newSetBinder(binder, PrestoSparkAuthenticatorProvider.class);
}
use of com.facebook.presto.cost.StatsCalculatorModule in project presto by prestodb.
the class CoordinatorModule method setup.
@Override
protected void setup(Binder binder) {
httpServerBinder(binder).bindResource("/ui", "webapp").withWelcomeFile("index.html");
httpServerBinder(binder).bindResource("/tableau", "webapp/tableau");
// discovery server
install(installModuleIf(EmbeddedDiscoveryConfig.class, EmbeddedDiscoveryConfig::isEnabled, new EmbeddedDiscoveryModule()));
// presto coordinator announcement
discoveryBinder(binder).bindHttpAnnouncement("presto-coordinator");
// statement resource
jsonCodecBinder(binder).bindJsonCodec(QueryInfo.class);
jsonCodecBinder(binder).bindJsonCodec(TaskInfo.class);
jsonCodecBinder(binder).bindJsonCodec(QueryResults.class);
jsonCodecBinder(binder).bindJsonCodec(SelectedRole.class);
jaxrsBinder(binder).bind(QueuedStatementResource.class);
jaxrsBinder(binder).bind(ExecutingStatementResource.class);
binder.bind(StatementHttpExecutionMBean.class).in(Scopes.SINGLETON);
newExporter(binder).export(StatementHttpExecutionMBean.class).withGeneratedName();
// resource for serving static content
jaxrsBinder(binder).bind(WebUiResource.class);
// failure detector
binder.install(new FailureDetectorModule());
jaxrsBinder(binder).bind(NodeResource.class);
jaxrsBinder(binder).bind(WorkerResource.class);
httpClientBinder(binder).bindHttpClient("workerInfo", ForWorkerInfo.class);
// query monitor
jsonCodecBinder(binder).bindJsonCodec(OperatorInfo.class);
configBinder(binder).bindConfig(QueryMonitorConfig.class);
binder.bind(QueryMonitor.class).in(Scopes.SINGLETON);
// query manager
jaxrsBinder(binder).bind(QueryResource.class);
jaxrsBinder(binder).bind(StageResource.class);
jaxrsBinder(binder).bind(QueryStateInfoResource.class);
jaxrsBinder(binder).bind(ResourceGroupStateInfoResource.class);
binder.bind(QueryIdGenerator.class).in(Scopes.SINGLETON);
binder.bind(QueryManager.class).to(SqlQueryManager.class).in(Scopes.SINGLETON);
newExporter(binder).export(QueryManager.class).withGeneratedName();
binder.bind(QueryPreparer.class).in(Scopes.SINGLETON);
binder.bind(SessionSupplier.class).to(QuerySessionSupplier.class).in(Scopes.SINGLETON);
binder.bind(InternalResourceGroupManager.class).in(Scopes.SINGLETON);
newExporter(binder).export(InternalResourceGroupManager.class).withGeneratedName();
binder.bind(ResourceGroupManager.class).to(InternalResourceGroupManager.class);
binder.bind(LegacyResourceGroupConfigurationManager.class).in(Scopes.SINGLETON);
binder.bind(RetryCircuitBreaker.class).in(Scopes.SINGLETON);
newExporter(binder).export(RetryCircuitBreaker.class).withGeneratedName();
binder.bind(LocalQueryProvider.class).in(Scopes.SINGLETON);
jaxrsBinder(binder).bind(TaskInfoResource.class);
// dispatcher
binder.bind(DispatchManager.class).in(Scopes.SINGLETON);
binder.bind(FailedDispatchQueryFactory.class).in(Scopes.SINGLETON);
binder.bind(DispatchExecutor.class).in(Scopes.SINGLETON);
// local dispatcher
binder.bind(DispatchQueryFactory.class).to(LocalDispatchQueryFactory.class);
// cluster memory manager
binder.bind(ClusterMemoryManager.class).in(Scopes.SINGLETON);
binder.bind(ClusterMemoryPoolManager.class).to(ClusterMemoryManager.class).in(Scopes.SINGLETON);
httpClientBinder(binder).bindHttpClient("memoryManager", ForMemoryManager.class).withTracing().withConfigDefaults(config -> {
config.setRequestTimeout(new Duration(10, SECONDS));
});
bindLowMemoryKiller(LowMemoryKillerPolicy.NONE, NoneLowMemoryKiller.class);
bindLowMemoryKiller(LowMemoryKillerPolicy.TOTAL_RESERVATION, TotalReservationLowMemoryKiller.class);
bindLowMemoryKiller(LowMemoryKillerPolicy.TOTAL_RESERVATION_ON_BLOCKED_NODES, TotalReservationOnBlockedNodesLowMemoryKiller.class);
newExporter(binder).export(ClusterMemoryManager.class).withGeneratedName();
// node monitor
binder.bind(ClusterSizeMonitor.class).in(Scopes.SINGLETON);
// statistics calculator
binder.install(new StatsCalculatorModule());
// cost calculator
binder.bind(TaskCountEstimator.class).in(Scopes.SINGLETON);
binder.bind(CostCalculator.class).to(CostCalculatorUsingExchanges.class).in(Scopes.SINGLETON);
binder.bind(CostCalculator.class).annotatedWith(EstimatedExchanges.class).to(CostCalculatorWithEstimatedExchanges.class).in(Scopes.SINGLETON);
binder.bind(CostComparator.class).in(Scopes.SINGLETON);
// cluster statistics
jaxrsBinder(binder).bind(ClusterStatsResource.class);
// planner
binder.bind(PlanFragmenter.class).in(Scopes.SINGLETON);
binder.bind(PlanOptimizers.class).in(Scopes.SINGLETON);
// query explainer
binder.bind(QueryExplainer.class).in(Scopes.SINGLETON);
// explain analyze
binder.bind(ExplainAnalyzeContext.class).in(Scopes.SINGLETON);
// execution scheduler
binder.bind(RemoteTaskFactory.class).to(HttpRemoteTaskFactory.class).in(Scopes.SINGLETON);
newExporter(binder).export(RemoteTaskFactory.class).withGeneratedName();
binder.bind(RemoteTaskStats.class).in(Scopes.SINGLETON);
newExporter(binder).export(RemoteTaskStats.class).withGeneratedName();
httpClientBinder(binder).bindHttpClient("scheduler", ForScheduler.class).withTracing().withFilter(GenerateTraceTokenRequestFilter.class).withConfigDefaults(config -> {
config.setRequestTimeout(new Duration(10, SECONDS));
config.setMaxConnectionsPerServer(250);
});
binder.bind(ScheduledExecutorService.class).annotatedWith(ForScheduler.class).toInstance(newSingleThreadScheduledExecutor(threadsNamed("stage-scheduler")));
// query execution
binder.bind(ExecutorService.class).annotatedWith(ForQueryExecution.class).toInstance(newCachedThreadPool(threadsNamed("query-execution-%s")));
binder.bind(QueryExecutionMBean.class).in(Scopes.SINGLETON);
newExporter(binder).export(QueryExecutionMBean.class).as(generatedNameOf(QueryExecution.class));
MapBinder<Class<? extends Statement>, QueryExecutionFactory<?>> executionBinder = newMapBinder(binder, new TypeLiteral<Class<? extends Statement>>() {
}, new TypeLiteral<QueryExecution.QueryExecutionFactory<?>>() {
});
binder.bind(SplitSchedulerStats.class).in(Scopes.SINGLETON);
newExporter(binder).export(SplitSchedulerStats.class).withGeneratedName();
binder.bind(SqlQueryExecutionFactory.class).in(Scopes.SINGLETON);
binder.bind(SectionExecutionFactory.class).in(Scopes.SINGLETON);
Set<Map.Entry<Class<? extends Statement>, QueryType>> queryTypes = getAllQueryTypes().entrySet();
// bind sql query statements to SqlQueryExecutionFactory
queryTypes.stream().filter(entry -> entry.getValue() != QueryType.DATA_DEFINITION).forEach(entry -> executionBinder.addBinding(entry.getKey()).to(SqlQueryExecutionFactory.class).in(Scopes.SINGLETON));
binder.bind(PartialResultQueryManager.class).in(Scopes.SINGLETON);
// bind data definition statements to DataDefinitionExecutionFactory
queryTypes.stream().filter(entry -> entry.getValue() == QueryType.DATA_DEFINITION && !isSessionTransactionControlStatement(entry.getKey())).forEach(entry -> executionBinder.addBinding(entry.getKey()).to(DDLDefinitionExecutionFactory.class).in(Scopes.SINGLETON));
binder.bind(DDLDefinitionExecutionFactory.class).in(Scopes.SINGLETON);
// bind session Control statements to SessionTransactionExecutionFactory
queryTypes.stream().filter(entry -> (entry.getValue() == QueryType.DATA_DEFINITION && isSessionTransactionControlStatement(entry.getKey()))).forEach(entry -> executionBinder.addBinding(entry.getKey()).to(SessionDefinitionExecutionFactory.class).in(Scopes.SINGLETON));
binder.bind(SessionDefinitionExecutionFactory.class).in(Scopes.SINGLETON);
// helper class binding data definition tasks and statements
PrestoDataDefBindingHelper.bindDDLDefinitionTasks(binder);
PrestoDataDefBindingHelper.bindTransactionControlDefinitionTasks(binder);
MapBinder<String, ExecutionPolicy> executionPolicyBinder = newMapBinder(binder, String.class, ExecutionPolicy.class);
executionPolicyBinder.addBinding("all-at-once").to(AllAtOnceExecutionPolicy.class);
executionPolicyBinder.addBinding("phased").to(PhasedExecutionPolicy.class);
configBinder(binder).bindConfig(NodeResourceStatusConfig.class);
binder.bind(NodeResourceStatusProvider.class).to(NodeResourceStatus.class).in(Scopes.SINGLETON);
newOptionalBinder(binder, ResourceManagerProxy.class);
install(installModuleIf(ServerConfig.class, ServerConfig::isResourceManagerEnabled, rmBinder -> {
httpClientBinder(rmBinder).bindHttpClient("resourceManager", ForResourceManager.class);
rmBinder.bind(ResourceManagerProxy.class).in(Scopes.SINGLETON);
}));
// cleanup
binder.bind(ExecutorCleanup.class).in(Scopes.SINGLETON);
}
Aggregations