Search in sources :

Example 1 with IdentifierMappingModule

use of io.trino.plugin.jdbc.mapping.IdentifierMappingModule in project trino by trinodb.

the class JdbcModule method setup.

@Override
public void setup(Binder binder) {
    binder.bind(CatalogName.class).toInstance(new CatalogName(catalogName));
    install(new JdbcDiagnosticModule());
    install(new IdentifierMappingModule());
    newOptionalBinder(binder, ConnectorAccessControl.class);
    newOptionalBinder(binder, QueryBuilder.class).setDefault().to(DefaultQueryBuilder.class).in(Scopes.SINGLETON);
    procedureBinder(binder);
    tablePropertiesProviderBinder(binder);
    newOptionalBinder(binder, JdbcMetadataFactory.class).setDefault().to(DefaultJdbcMetadataFactory.class).in(Scopes.SINGLETON);
    newOptionalBinder(binder, ConnectorSplitManager.class).setDefault().to(JdbcSplitManager.class).in(Scopes.SINGLETON);
    newOptionalBinder(binder, ConnectorRecordSetProvider.class).setDefault().to(JdbcRecordSetProvider.class).in(Scopes.SINGLETON);
    newOptionalBinder(binder, ConnectorPageSinkProvider.class).setDefault().to(JdbcPageSinkProvider.class).in(Scopes.SINGLETON);
    binder.bind(JdbcConnector.class).in(Scopes.SINGLETON);
    configBinder(binder).bindConfig(JdbcMetadataConfig.class);
    configBinder(binder).bindConfig(JdbcWriteConfig.class);
    configBinder(binder).bindConfig(BaseJdbcConfig.class);
    configBinder(binder).bindConfig(TypeHandlingJdbcConfig.class);
    bindSessionPropertiesProvider(binder, TypeHandlingJdbcSessionProperties.class);
    bindSessionPropertiesProvider(binder, JdbcMetadataSessionProperties.class);
    bindSessionPropertiesProvider(binder, JdbcWriteSessionProperties.class);
    binder.bind(CachingJdbcClient.class).in(Scopes.SINGLETON);
    binder.bind(JdbcClient.class).to(Key.get(CachingJdbcClient.class)).in(Scopes.SINGLETON);
    newSetBinder(binder, Procedure.class).addBinding().toProvider(FlushJdbcMetadataCacheProcedure.class).in(Scopes.SINGLETON);
    binder.bind(ConnectionFactory.class).annotatedWith(ForLazyConnectionFactory.class).to(Key.get(ConnectionFactory.class, StatsCollecting.class)).in(Scopes.SINGLETON);
    binder.bind(ConnectionFactory.class).to(LazyConnectionFactory.class).in(Scopes.SINGLETON);
    newOptionalBinder(binder, Key.get(int.class, MaxDomainCompactionThreshold.class));
    newOptionalBinder(binder, Key.get(ExecutorService.class, ForRecordCursor.class)).setDefault().toProvider(MoreExecutors::newDirectExecutorService).in(Scopes.SINGLETON);
}
Also used : IdentifierMappingModule(io.trino.plugin.jdbc.mapping.IdentifierMappingModule) ConnectorRecordSetProvider(io.trino.spi.connector.ConnectorRecordSetProvider) ConnectorPageSinkProvider(io.trino.spi.connector.ConnectorPageSinkProvider) ConnectorSplitManager(io.trino.spi.connector.ConnectorSplitManager) FlushJdbcMetadataCacheProcedure(io.trino.plugin.jdbc.procedure.FlushJdbcMetadataCacheProcedure) FlushJdbcMetadataCacheProcedure(io.trino.plugin.jdbc.procedure.FlushJdbcMetadataCacheProcedure) Procedure(io.trino.spi.procedure.Procedure) CatalogName(io.trino.plugin.base.CatalogName)

Example 2 with IdentifierMappingModule

use of io.trino.plugin.jdbc.mapping.IdentifierMappingModule in project trino by trinodb.

the class PhoenixClientModule method setup.

@Override
protected void setup(Binder binder) {
    binder.bind(ConnectorSplitManager.class).annotatedWith(ForClassLoaderSafe.class).to(PhoenixSplitManager.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorSplitManager.class).to(ClassLoaderSafeConnectorSplitManager.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorRecordSetProvider.class).annotatedWith(ForClassLoaderSafe.class).to(JdbcRecordSetProvider.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorRecordSetProvider.class).to(ClassLoaderSafeConnectorRecordSetProvider.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorPageSinkProvider.class).annotatedWith(ForClassLoaderSafe.class).to(JdbcPageSinkProvider.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorPageSinkProvider.class).to(ClassLoaderSafeConnectorPageSinkProvider.class).in(Scopes.SINGLETON);
    binder.bind(QueryBuilder.class).to(DefaultQueryBuilder.class).in(Scopes.SINGLETON);
    newOptionalBinder(binder, Key.get(int.class, MaxDomainCompactionThreshold.class));
    configBinder(binder).bindConfig(TypeHandlingJdbcConfig.class);
    bindSessionPropertiesProvider(binder, TypeHandlingJdbcSessionProperties.class);
    bindSessionPropertiesProvider(binder, JdbcMetadataSessionProperties.class);
    bindSessionPropertiesProvider(binder, JdbcWriteSessionProperties.class);
    bindSessionPropertiesProvider(binder, PhoenixSessionProperties.class);
    configBinder(binder).bindConfig(JdbcMetadataConfig.class);
    configBinder(binder).bindConfig(JdbcWriteConfig.class);
    binder.bind(PhoenixClient.class).in(Scopes.SINGLETON);
    binder.bind(JdbcClient.class).annotatedWith(ForBaseJdbc.class).to(Key.get(PhoenixClient.class)).in(Scopes.SINGLETON);
    binder.bind(JdbcClient.class).to(Key.get(JdbcClient.class, StatsCollecting.class)).in(Scopes.SINGLETON);
    binder.bind(ConnectorMetadata.class).annotatedWith(ForClassLoaderSafe.class).to(PhoenixMetadata.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorMetadata.class).to(ClassLoaderSafeConnectorMetadata.class).in(Scopes.SINGLETON);
    binder.bind(ConnectionFactory.class).annotatedWith(ForLazyConnectionFactory.class).to(Key.get(ConnectionFactory.class, StatsCollecting.class)).in(Scopes.SINGLETON);
    binder.bind(ConnectionFactory.class).to(LazyConnectionFactory.class).in(Scopes.SINGLETON);
    bindTablePropertiesProvider(binder, PhoenixTableProperties.class);
    binder.bind(PhoenixColumnProperties.class).in(Scopes.SINGLETON);
    binder.bind(PhoenixConnector.class).in(Scopes.SINGLETON);
    checkConfiguration(buildConfigObject(PhoenixConfig.class).getConnectionUrl());
    install(new JdbcDiagnosticModule());
    install(new IdentifierMappingModule());
    install(new DecimalModule());
}
Also used : DefaultQueryBuilder(io.trino.plugin.jdbc.DefaultQueryBuilder) ClassLoaderSafeConnectorRecordSetProvider(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorRecordSetProvider) IdentifierMappingModule(io.trino.plugin.jdbc.mapping.IdentifierMappingModule) ClassLoaderSafeConnectorMetadata(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata) DecimalModule(io.trino.plugin.jdbc.DecimalModule) ClassLoaderSafeConnectorPageSinkProvider(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorPageSinkProvider) MaxDomainCompactionThreshold(io.trino.plugin.jdbc.MaxDomainCompactionThreshold) JdbcClient(io.trino.plugin.jdbc.JdbcClient) JdbcRecordSetProvider(io.trino.plugin.jdbc.JdbcRecordSetProvider) ConnectorRecordSetProvider(io.trino.spi.connector.ConnectorRecordSetProvider) ClassLoaderSafeConnectorRecordSetProvider(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorRecordSetProvider) DriverConnectionFactory(io.trino.plugin.jdbc.DriverConnectionFactory) ConnectionFactory(io.trino.plugin.jdbc.ConnectionFactory) ConfiguringConnectionFactory(io.trino.plugin.jdbc.ConfiguringConnectionFactory) ForLazyConnectionFactory(io.trino.plugin.jdbc.ForLazyConnectionFactory) LazyConnectionFactory(io.trino.plugin.jdbc.LazyConnectionFactory) ClassLoaderSafeConnectorPageSinkProvider(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorPageSinkProvider) ConnectorPageSinkProvider(io.trino.spi.connector.ConnectorPageSinkProvider) ConnectorSplitManager(io.trino.spi.connector.ConnectorSplitManager) ClassLoaderSafeConnectorSplitManager(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorSplitManager) ClassLoaderSafeConnectorSplitManager(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorSplitManager) ForLazyConnectionFactory(io.trino.plugin.jdbc.ForLazyConnectionFactory) LazyConnectionFactory(io.trino.plugin.jdbc.LazyConnectionFactory) ClassLoaderSafeConnectorMetadata(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata) ConnectorMetadata(io.trino.spi.connector.ConnectorMetadata) JdbcPageSinkProvider(io.trino.plugin.jdbc.JdbcPageSinkProvider) JdbcDiagnosticModule(io.trino.plugin.jdbc.JdbcDiagnosticModule)

Example 3 with IdentifierMappingModule

use of io.trino.plugin.jdbc.mapping.IdentifierMappingModule in project trino by trinodb.

the class PhoenixClientModule method setup.

@Override
protected void setup(Binder binder) {
    binder.bind(ConnectorSplitManager.class).annotatedWith(ForClassLoaderSafe.class).to(PhoenixSplitManager.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorSplitManager.class).to(ClassLoaderSafeConnectorSplitManager.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorRecordSetProvider.class).annotatedWith(ForClassLoaderSafe.class).to(JdbcRecordSetProvider.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorRecordSetProvider.class).to(ClassLoaderSafeConnectorRecordSetProvider.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorPageSinkProvider.class).annotatedWith(ForClassLoaderSafe.class).to(JdbcPageSinkProvider.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorPageSinkProvider.class).to(ClassLoaderSafeConnectorPageSinkProvider.class).in(Scopes.SINGLETON);
    binder.bind(QueryBuilder.class).to(DefaultQueryBuilder.class).in(Scopes.SINGLETON);
    newOptionalBinder(binder, Key.get(int.class, MaxDomainCompactionThreshold.class));
    configBinder(binder).bindConfig(TypeHandlingJdbcConfig.class);
    bindSessionPropertiesProvider(binder, TypeHandlingJdbcSessionProperties.class);
    bindSessionPropertiesProvider(binder, JdbcMetadataSessionProperties.class);
    bindSessionPropertiesProvider(binder, JdbcWriteSessionProperties.class);
    bindSessionPropertiesProvider(binder, PhoenixSessionProperties.class);
    configBinder(binder).bindConfig(JdbcMetadataConfig.class);
    configBinder(binder).bindConfig(JdbcWriteConfig.class);
    binder.bind(PhoenixClient.class).in(Scopes.SINGLETON);
    binder.bind(JdbcClient.class).annotatedWith(ForBaseJdbc.class).to(Key.get(PhoenixClient.class)).in(Scopes.SINGLETON);
    binder.bind(JdbcClient.class).to(Key.get(JdbcClient.class, StatsCollecting.class)).in(Scopes.SINGLETON);
    binder.bind(ConnectorMetadata.class).annotatedWith(ForClassLoaderSafe.class).to(PhoenixMetadata.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorMetadata.class).to(ClassLoaderSafeConnectorMetadata.class).in(Scopes.SINGLETON);
    binder.bind(ConnectionFactory.class).annotatedWith(ForLazyConnectionFactory.class).to(Key.get(ConnectionFactory.class, StatsCollecting.class)).in(Scopes.SINGLETON);
    binder.bind(ConnectionFactory.class).to(LazyConnectionFactory.class).in(Scopes.SINGLETON);
    bindTablePropertiesProvider(binder, PhoenixTableProperties.class);
    binder.bind(PhoenixColumnProperties.class).in(Scopes.SINGLETON);
    binder.bind(PhoenixConnector.class).in(Scopes.SINGLETON);
    checkConfiguration(buildConfigObject(PhoenixConfig.class).getConnectionUrl());
    install(new JdbcDiagnosticModule());
    install(new IdentifierMappingModule());
    install(new DecimalModule());
}
Also used : DefaultQueryBuilder(io.trino.plugin.jdbc.DefaultQueryBuilder) ClassLoaderSafeConnectorRecordSetProvider(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorRecordSetProvider) IdentifierMappingModule(io.trino.plugin.jdbc.mapping.IdentifierMappingModule) ClassLoaderSafeConnectorMetadata(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata) DecimalModule(io.trino.plugin.jdbc.DecimalModule) ClassLoaderSafeConnectorPageSinkProvider(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorPageSinkProvider) MaxDomainCompactionThreshold(io.trino.plugin.jdbc.MaxDomainCompactionThreshold) JdbcClient(io.trino.plugin.jdbc.JdbcClient) JdbcRecordSetProvider(io.trino.plugin.jdbc.JdbcRecordSetProvider) ConnectorRecordSetProvider(io.trino.spi.connector.ConnectorRecordSetProvider) ClassLoaderSafeConnectorRecordSetProvider(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorRecordSetProvider) DriverConnectionFactory(io.trino.plugin.jdbc.DriverConnectionFactory) ConnectionFactory(io.trino.plugin.jdbc.ConnectionFactory) ConfiguringConnectionFactory(io.trino.plugin.jdbc.ConfiguringConnectionFactory) ForLazyConnectionFactory(io.trino.plugin.jdbc.ForLazyConnectionFactory) LazyConnectionFactory(io.trino.plugin.jdbc.LazyConnectionFactory) ClassLoaderSafeConnectorPageSinkProvider(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorPageSinkProvider) ConnectorPageSinkProvider(io.trino.spi.connector.ConnectorPageSinkProvider) ConnectorSplitManager(io.trino.spi.connector.ConnectorSplitManager) ClassLoaderSafeConnectorSplitManager(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorSplitManager) ClassLoaderSafeConnectorSplitManager(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorSplitManager) ForLazyConnectionFactory(io.trino.plugin.jdbc.ForLazyConnectionFactory) LazyConnectionFactory(io.trino.plugin.jdbc.LazyConnectionFactory) ClassLoaderSafeConnectorMetadata(io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata) ConnectorMetadata(io.trino.spi.connector.ConnectorMetadata) JdbcPageSinkProvider(io.trino.plugin.jdbc.JdbcPageSinkProvider) JdbcDiagnosticModule(io.trino.plugin.jdbc.JdbcDiagnosticModule)

Aggregations

IdentifierMappingModule (io.trino.plugin.jdbc.mapping.IdentifierMappingModule)3 ConnectorPageSinkProvider (io.trino.spi.connector.ConnectorPageSinkProvider)3 ConnectorRecordSetProvider (io.trino.spi.connector.ConnectorRecordSetProvider)3 ConnectorSplitManager (io.trino.spi.connector.ConnectorSplitManager)3 ClassLoaderSafeConnectorMetadata (io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata)2 ClassLoaderSafeConnectorPageSinkProvider (io.trino.plugin.base.classloader.ClassLoaderSafeConnectorPageSinkProvider)2 ClassLoaderSafeConnectorRecordSetProvider (io.trino.plugin.base.classloader.ClassLoaderSafeConnectorRecordSetProvider)2 ClassLoaderSafeConnectorSplitManager (io.trino.plugin.base.classloader.ClassLoaderSafeConnectorSplitManager)2 ConfiguringConnectionFactory (io.trino.plugin.jdbc.ConfiguringConnectionFactory)2 ConnectionFactory (io.trino.plugin.jdbc.ConnectionFactory)2 DecimalModule (io.trino.plugin.jdbc.DecimalModule)2 DefaultQueryBuilder (io.trino.plugin.jdbc.DefaultQueryBuilder)2 DriverConnectionFactory (io.trino.plugin.jdbc.DriverConnectionFactory)2 ForLazyConnectionFactory (io.trino.plugin.jdbc.ForLazyConnectionFactory)2 JdbcClient (io.trino.plugin.jdbc.JdbcClient)2 JdbcDiagnosticModule (io.trino.plugin.jdbc.JdbcDiagnosticModule)2 JdbcPageSinkProvider (io.trino.plugin.jdbc.JdbcPageSinkProvider)2 JdbcRecordSetProvider (io.trino.plugin.jdbc.JdbcRecordSetProvider)2 LazyConnectionFactory (io.trino.plugin.jdbc.LazyConnectionFactory)2 MaxDomainCompactionThreshold (io.trino.plugin.jdbc.MaxDomainCompactionThreshold)2