-
Notifications
You must be signed in to change notification settings - Fork 11
Handle RemoteS3Facade dynamic creation in RemoteS3ConnectionController #195
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
Conversation
28068c0
to
0abf14e
Compare
Why a Map? Why not use a real object via Airlift config? |
I followed the pattern that Trino uses to create plugins. I can look into changing it to take a Airlift config, but that would essentially just move the code that does
from the We would also have to update the Collection<Module> remoteS3FacacdeModules(); since we would need to use these to create a new Bootstrap context with only This would have the advantage of removing the need for a separate WDYT? |
I can tell you from experience that the raw HashMap config for connectors is a major headache. Also, Trino plugins/connectors are usually their own context, with their own classloader, etc. We don't want to emulate that. |
@Override | ||
public RemoteS3Facade create(Map<String, String> configs) | ||
{ | ||
return new Bootstrap(new DefaultRemoteS3Module()) |
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.
I have serious concerns with starting a new Bootstrap with this library. I feel we're getting into the weeds. Maybe you can explain the need for this offline.
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.
Note: log
is unused
Update RemoteS3Facade default bindings to not set the optional default but the value. RemoteS3Connection no longer has a function to get a Map of configs, but gets a function to get an instantiated RemoteS3Facade. Add a StaticRemoteS3Connection record to replace the previous one.
cf4c81a
to
072cce2
Compare
Replace the RemoteS3Facade plugin type with a RemoteS3FacadeFactory that creates RemoteS3Facade instances based on Map<String, String> configs.
Add RemoteS3FacadeManager to create the default RemoteS3Facade from configs in
remote-s3-facade.properties
.