-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for OpenTelemetry in Glue metastore #18458
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,9 @@ | |
import com.amazonaws.services.glue.model.Table; | ||
import com.google.inject.Binder; | ||
import com.google.inject.Key; | ||
import com.google.inject.Provides; | ||
import com.google.inject.Scopes; | ||
import com.google.inject.Singleton; | ||
import com.google.inject.TypeLiteral; | ||
import com.google.inject.multibindings.Multibinder; | ||
import io.airlift.configuration.AbstractConfigurationAwareModule; | ||
import io.trino.plugin.hive.HideDeltaLakeTables; | ||
import io.trino.plugin.hive.metastore.glue.ForGlueHiveMetastore; | ||
|
@@ -34,7 +33,9 @@ | |
|
||
import java.util.function.Predicate; | ||
|
||
import static com.google.inject.multibindings.Multibinder.newSetBinder; | ||
import static com.google.inject.multibindings.OptionalBinder.newOptionalBinder; | ||
import static io.airlift.configuration.ConditionalModule.conditionalModule; | ||
import static io.airlift.configuration.ConfigBinder.configBinder; | ||
import static java.util.Objects.requireNonNull; | ||
import static org.weakref.jmx.guice.ExportBinder.newExporter; | ||
|
@@ -62,18 +63,16 @@ protected void setup(Binder binder) | |
newExporter(binder).export(TrinoCatalogFactory.class).withGeneratedName(); | ||
binder.bind(AWSGlueAsyncAdapterProvider.class).toInstance(awsGlueAsyncAdapterProvider); | ||
|
||
Multibinder<RequestHandler2> requestHandlers = newSetBinder(binder, RequestHandler2.class); | ||
install(conditionalModule( | ||
IcebergGlueCatalogConfig.class, | ||
IcebergGlueCatalogConfig::isSkipArchive, | ||
config -> requestHandlers.addBinding().toInstance(new SkipArchiveRequestHandler()))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sent follow-up #18465 Multibinder javadoc mentions:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The quoted text says that 2+ modules can call it does not seem to say, however, that |
||
|
||
// Required to inject HiveMetastoreFactory for migrate procedure | ||
binder.bind(Key.get(boolean.class, HideDeltaLakeTables.class)).toInstance(false); | ||
newOptionalBinder(binder, Key.get(new TypeLiteral<Predicate<Table>>() {}, ForGlueHiveMetastore.class)) | ||
.setBinding().toInstance(table -> true); | ||
install(new GlueMetastoreModule()); | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
@ForGlueHiveMetastore | ||
public static RequestHandler2 createRequestHandler(IcebergGlueCatalogConfig config) | ||
{ | ||
return new SkipArchiveRequestHandler(config.isSkipArchive()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as 9698991#r1279088778