Search in sources :

Example 1 with RebindSafeMBeanServer

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);
}
Also used : PinotClient(io.trino.plugin.pinot.client.PinotClient) Duration(io.airlift.units.Duration) DataSchema(org.apache.pinot.common.utils.DataSchema) IdentityPinotHostMapper(io.trino.plugin.pinot.client.IdentityPinotHostMapper) NodeManager(io.trino.spi.NodeManager) PinotQueryClient(io.trino.plugin.pinot.client.PinotQueryClient) RebindSafeMBeanServer(io.trino.plugin.base.jmx.RebindSafeMBeanServer) ManagementFactory.getPlatformMBeanServer(java.lang.management.ManagementFactory.getPlatformMBeanServer) RebindSafeMBeanServer(io.trino.plugin.base.jmx.RebindSafeMBeanServer) MBeanServer(javax.management.MBeanServer) IdentityPinotHostMapper(io.trino.plugin.pinot.client.IdentityPinotHostMapper) PinotHostMapper(io.trino.plugin.pinot.client.PinotHostMapper)

Aggregations

Duration (io.airlift.units.Duration)1 RebindSafeMBeanServer (io.trino.plugin.base.jmx.RebindSafeMBeanServer)1 IdentityPinotHostMapper (io.trino.plugin.pinot.client.IdentityPinotHostMapper)1 PinotClient (io.trino.plugin.pinot.client.PinotClient)1 PinotHostMapper (io.trino.plugin.pinot.client.PinotHostMapper)1 PinotQueryClient (io.trino.plugin.pinot.client.PinotQueryClient)1 NodeManager (io.trino.spi.NodeManager)1 ManagementFactory.getPlatformMBeanServer (java.lang.management.ManagementFactory.getPlatformMBeanServer)1 MBeanServer (javax.management.MBeanServer)1 DataSchema (org.apache.pinot.common.utils.DataSchema)1