-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Some more cleanups related to ConnectorContextModule #27179
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
Some more cleanups related to ConnectorContextModule #27179
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactor plugin modules to remove redundant context bindings now provided by ConnectorContextModule and update connector factories to include ConnectorContextModule for centralized context provisioning. Class diagram for updated plugin modules and context bindingclassDiagram
class ConnectorContextModule {
+ConnectorContextModule(String catalogName, ConnectorContext context)
}
class MemoryModule {
+configure(Binder binder)
}
class FakerModule {
+configure(Binder binder)
}
class TpcdsModule {
+configure(Binder binder)
}
class TpchModule {
+TpchModule(int defaultSplitsPerNode, boolean predicatePushdownEnabled)
+setup(Binder binder)
}
class CassandraClientModule {
+setup(Binder binder)
}
ConnectorContextModule <|.. MemoryModule
ConnectorContextModule <|.. FakerModule
ConnectorContextModule <|.. TpcdsModule
ConnectorContextModule <|.. TpchModule
ConnectorContextModule <|.. CassandraClientModule
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
b89b038 to
59f4c5b
Compare
This binding is already provided by `ConnectorContextModule`.
This binding is already provided by `ConnectorContextModule`.
59f4c5b to
8aa2a84
Compare
|
CI hit #27183 |
| Bootstrap app = new Bootstrap("io.trino.bootstrap.catalog." + catalogName, new FakerModule(context.getTypeManager())); | ||
| Bootstrap app = new Bootstrap( | ||
| "io.trino.bootstrap.catalog." + catalogName, | ||
| new ConnectorContextModule(catalogName, context), |
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.
The ConnectorContextModule binds more than just TypeManager :) , but we just want to use ConnectorContextModule right?
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.
Yes, we want to use it whenever at least one object from ConnectorContext is passes to the connector.
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.
Thanks
Description
Two kinds of commits:
ConnectorContextModule, like Remove duplicate binding of TypeManager in trino-kafka #27178; this should have been part of the original PR, tbhConnectorContextModulein a plugin; these were missed because they do the bindings inside plugin-specific modules instead of using a common pattern of a module binding them "manually"Additional context and related issues
ConnectorContextModulewas introduced in #27054.Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
Summary by Sourcery
Standardize context injection by using ConnectorContextModule across connectors and eliminate duplicate manual bindings in plugin modules
Enhancements: