@Override public void configure(Binder binder) { configBinder(binder).bindConfig(FileHiveMetastoreConfig.class); binder.bind(ExtendedHiveMetastore.class).annotatedWith(ForCachingHiveMetastore.class).to(FileHiveMetastore.class).in(Scopes.SINGLETON); binder.bind(ExtendedHiveMetastore.class).to(CachingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generatedNameOf(CachingHiveMetastore.class, connectorId)); } }
@Override public void configure(Binder binder) { configBinder(binder).bindConfig(GlueHiveMetastoreConfig.class); binder.bind(ExtendedHiveMetastore.class).to(GlueHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generatedNameOf(GlueHiveMetastore.class, connectorId)); } }
binder.bind(RecordingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(RecordingHiveMetastore.class) .as(generatedNameOf(RecordingHiveMetastore.class, connectorId)); .as(generatedNameOf(ThriftHiveMetastore.class, connectorId)); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generatedNameOf(CachingHiveMetastore.class, connectorId));
@Override protected void setup(Binder binder) { S3FileSystemType type = buildConfigObject(HiveClientConfig.class).getS3FileSystemType(); if (type == S3FileSystemType.PRESTO) { binder.bind(S3ConfigurationUpdater.class).to(PrestoS3ConfigurationUpdater.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(HiveS3Config.class); binder.bind(PrestoS3FileSystemStats.class).toInstance(PrestoS3FileSystem.getFileSystemStats()); newExporter(binder).export(PrestoS3FileSystemStats.class).as(generatedNameOf(PrestoS3FileSystem.class, connectorId)); } else if (type == S3FileSystemType.EMRFS) { validateEmrFsClass(); binder.bind(S3ConfigurationUpdater.class).to(EmrFsS3ConfigurationUpdater.class).in(Scopes.SINGLETON); } else { throw new RuntimeException("Unknown file system type: " + type); } }
newExporter(binder).export(NamenodeStats.class).as(generatedNameOf(NamenodeStats.class, connectorId)); newExporter(binder).export(HiveWriterStats.class).as(generatedNameOf(HiveWriterStats.class, connectorId)); binder.bind(HiveTransactionManager.class).in(Scopes.SINGLETON); binder.bind(ConnectorSplitManager.class).to(HiveSplitManager.class).in(Scopes.SINGLETON); newExporter(binder).export(ConnectorSplitManager.class).as(generatedNameOf(HiveSplitManager.class, connectorId)); binder.bind(ConnectorPageSourceProvider.class).to(HivePageSourceProvider.class).in(Scopes.SINGLETON); binder.bind(ConnectorPageSinkProvider.class).to(HivePageSinkProvider.class).in(Scopes.SINGLETON); newExporter(binder).export(FileFormatDataSourceStats.class).as(generatedNameOf(FileFormatDataSourceStats.class, connectorId)); newExporter(binder).export(OrcFileWriterFactory.class).as(generatedNameOf(OrcFileWriterFactory.class, connectorId)); configBinder(binder).bindConfig(OrcFileWriterConfig.class); fileWriterFactoryBinder.addBinding().to(OrcFileWriterFactory.class).in(Scopes.SINGLETON);
@Override public void configure(Binder binder) { driftClientBinder(binder) .bindDriftClient(PrestoThriftService.class) .withExceptionClassifier(t -> { if (t instanceof PrestoThriftServiceException) { boolean retryable = ((PrestoThriftServiceException) t).isRetryable(); return new ExceptionClassification(Optional.of(retryable), HostStatus.NORMAL); } return NORMAL_EXCEPTION; }); binder.bind(ThriftConnector.class).in(Scopes.SINGLETON); binder.bind(ThriftMetadata.class).in(Scopes.SINGLETON); binder.bind(ThriftSplitManager.class).in(Scopes.SINGLETON); binder.bind(ThriftPageSourceProvider.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(ThriftConnectorConfig.class); binder.bind(ThriftSessionProperties.class).in(Scopes.SINGLETON); binder.bind(ThriftIndexProvider.class).in(Scopes.SINGLETON); binder.bind(ThriftConnectorStats.class).in(Scopes.SINGLETON); newExporter(binder).export(ThriftConnectorStats.class) .as(generatedNameOf(ThriftConnectorStats.class, connectorId)); }
.toInstance(newCachedThreadPool(threadsNamed("query-execution-%s"))); binder.bind(QueryExecutionMBean.class).in(Scopes.SINGLETON); newExporter(binder).export(QueryExecutionMBean.class).as(generatedNameOf(QueryExecution.class));
@Override public void configure(Binder binder) { binder.disableCircularProxies(); binder.bind(LoggingMBean.class).in(Scopes.SINGLETON); newExporter(binder).export(LoggingMBean.class).as("io.airlift.log:name=Logging"); }
@Override public void configure(Binder binder) { binder.disableCircularProxies(); binder.bind(LoggingMBean.class).in(Scopes.SINGLETON); newExporter(binder).export(LoggingMBean.class).as("com.proofpoint.log:name=Logging"); }
@Override public void configure(Binder binder) { configBinder(binder).bindConfig(FileHiveMetastoreConfig.class); binder.bind(ExtendedHiveMetastore.class).annotatedWith(ForCachingHiveMetastore.class).to(FileHiveMetastore.class).in(Scopes.SINGLETON); binder.bind(ExtendedHiveMetastore.class).to(CachingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generator -> generator.generatedNameOf(CachingHiveMetastore.class)); } }
@Override public void configure(Binder binder) { binder.disableCircularProxies(); binder.bind(LoggingMBean.class).in(Scopes.SINGLETON); newExporter(binder).export(LoggingMBean.class).as("io.airlift.log:name=Logging"); }
binder.bind(HiveMetastore.class).to(CachingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(HiveMetastore.class) .as(generatedNameOf(CachingHiveMetastore.class, connectorId)); newExporter(binder).export(NamenodeStats.class).as(generatedNameOf(NamenodeStats.class)); newExporter(binder).export(PrestoS3FileSystemStats.class).as(generatedNameOf(PrestoS3FileSystem.class, connectorId));
binder.bind(HiveTransactionManager.class).in(Scopes.SINGLETON); binder.bind(ConnectorSplitManager.class).to(HiveSplitManager.class).in(Scopes.SINGLETON); newExporter(binder).export(ConnectorSplitManager.class).as(generator -> generator.generatedNameOf(HiveSplitManager.class)); binder.bind(ConnectorPageSourceProvider.class).to(HivePageSourceProvider.class).in(Scopes.SINGLETON); binder.bind(ConnectorPageSinkProvider.class).to(HivePageSinkProvider.class).in(Scopes.SINGLETON);
@Override protected void setup(Binder binder) { S3FileSystemType type = buildConfigObject(HiveClientConfig.class).getS3FileSystemType(); if (type == S3FileSystemType.PRESTO) { binder.bind(S3ConfigurationUpdater.class).to(PrestoS3ConfigurationUpdater.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(HiveS3Config.class); binder.bind(PrestoS3FileSystemStats.class).toInstance(PrestoS3FileSystem.getFileSystemStats()); newExporter(binder).export(PrestoS3FileSystemStats.class) .as(generator -> generator.generatedNameOf(PrestoS3FileSystem.class)); } else if (type == S3FileSystemType.EMRFS) { validateEmrFsClass(); binder.bind(S3ConfigurationUpdater.class).to(EmrFsS3ConfigurationUpdater.class).in(Scopes.SINGLETON); } else { throw new RuntimeException("Unknown file system type: " + type); } }
@Override protected void setup(Binder binder) { configBinder(binder).bindConfig(GlueHiveMetastoreConfig.class); if (buildConfigObject(HiveClientConfig.class).getRecordingPath() != null) { binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForRecordingHiveMetastore.class) .to(GlueHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(GlueHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(GlueHiveMetastore.class).withGeneratedName(); binder.bind(ExtendedHiveMetastore.class).to(RecordingHiveMetastore.class).in(Scopes.SINGLETON); binder.bind(RecordingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(RecordingHiveMetastore.class).withGeneratedName(); Multibinder<Procedure> procedures = newSetBinder(binder, Procedure.class); procedures.addBinding().toProvider(WriteHiveMetastoreRecordingProcedure.class).in(Scopes.SINGLETON); } else { binder.bind(ExtendedHiveMetastore.class).to(GlueHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generator -> generator.generatedNameOf(GlueHiveMetastore.class)); } } }
binder.bind(TemporalFunction.class).in(Scopes.SINGLETON); newExporter(binder).export(ShardRecoveryManager.class).as(generatedNameOf(ShardRecoveryManager.class, connectorId)); newExporter(binder).export(BackupManager.class).as(generatedNameOf(BackupManager.class, connectorId)); newExporter(binder).export(StorageManager.class).as(generatedNameOf(OrcStorageManager.class, connectorId)); newExporter(binder).export(ShardCompactionManager.class).as(generatedNameOf(ShardCompactionManager.class, connectorId)); newExporter(binder).export(ShardOrganizer.class).as(generatedNameOf(ShardOrganizer.class, connectorId)); newExporter(binder).export(ShardCompactor.class).as(generatedNameOf(ShardCompactor.class, connectorId)); newExporter(binder).export(ShardEjector.class).as(generatedNameOf(ShardEjector.class, connectorId)); newExporter(binder).export(ShardCleaner.class).as(generatedNameOf(ShardCleaner.class, connectorId)); newExporter(binder).export(BucketBalancer.class).as(generatedNameOf(BucketBalancer.class, connectorId)); newExporter(binder).export(JobFactory.class).withGeneratedName();
newExporter(binder).export(StorageManager.class).as(generator -> generator.generatedNameOf(OrcStorageManager.class)); newExporter(binder).export(ShardCompactionManager.class).withGeneratedName(); newExporter(binder).export(ShardOrganizer.class).withGeneratedName();
.toInstance(newCachedThreadPool(threadsNamed("query-execution-%s"))); binder.bind(QueryExecutionMBean.class).in(Scopes.SINGLETON); newExporter(binder).export(QueryExecutionMBean.class).as(generatedNameOf(QueryExecution.class));
binder.bind(QueryExecutionMBean.class).in(Scopes.SINGLETON); newExporter(binder).export(QueryExecutionMBean.class) .as(generator -> generator.generatedNameOf(QueryExecution.class));