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);
}
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());
}
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());
}
Aggregations