use of io.trino.plugin.base.jmx.RebindSafeMBeanServer in project trino by trinodb.
the class PinotModule method configure.
@Override
public void configure(Binder binder) {
configBinder(binder).bindConfig(PinotConfig.class);
binder.bind(PinotConnector.class).in(Scopes.SINGLETON);
binder.bind(PinotMetadata.class).in(Scopes.SINGLETON);
binder.bind(PinotSplitManager.class).in(Scopes.SINGLETON);
binder.bind(PinotPageSourceProvider.class).in(Scopes.SINGLETON);
binder.bind(PinotClient.class).in(Scopes.SINGLETON);
binder.bind(PinotQueryClient.class).in(Scopes.SINGLETON);
binder.bind(Executor.class).annotatedWith(ForPinot.class).toInstance(newCachedThreadPool(threadsNamed("pinot-metadata-fetcher-" + catalogName)));
binder.bind(PinotSessionProperties.class).in(Scopes.SINGLETON);
binder.bind(PinotNodePartitioningProvider.class).in(Scopes.SINGLETON);
httpClientBinder(binder).bindHttpClient("pinot", ForPinot.class).withConfigDefaults(cfg -> {
cfg.setIdleTimeout(new Duration(300, SECONDS));
cfg.setConnectTimeout(new Duration(300, SECONDS));
cfg.setRequestTimeout(new Duration(300, SECONDS));
cfg.setMaxConnectionsPerServer(250);
cfg.setMaxContentLength(DataSize.of(32, MEGABYTE));
cfg.setSelectorCount(10);
cfg.setTimeoutThreads(8);
cfg.setTimeoutConcurrency(4);
});
jsonBinder(binder).addDeserializerBinding(DataSchema.class).to(DataSchemaDeserializer.class);
PinotClient.addJsonBinders(jsonCodecBinder(binder));
binder.bind(MBeanServer.class).toInstance(new RebindSafeMBeanServer(getPlatformMBeanServer()));
binder.bind(NodeManager.class).toInstance(nodeManager);
binder.bind(ConnectorNodePartitioningProvider.class).to(PinotNodePartitioningProvider.class).in(Scopes.SINGLETON);
newOptionalBinder(binder, PinotHostMapper.class).setDefault().to(IdentityPinotHostMapper.class).in(Scopes.SINGLETON);
}
Aggregations