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
(Preview) Replace Dropwizard with Airlift #317
base: main
Are you sure you want to change the base?
Conversation
gateway-ha/etc/config.properties
Outdated
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff | ||
node.environment=test |
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 gateway is not clustered, why does it need a node.id
and node.environment
?
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.
That's because HttpServerModule depends on NodeInfo which needs NodeConfig which requires non-null node.environment and node.id.
I should be able to set these in Java and eliminate these from the config file.
Might need to dig deeper to see if there are drawbacks of doing it.
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.
There is no harm in having these value though .. right?
02366d6
to
f052941
Compare
d986394
to
349c6e1
Compare
349c6e1
to
4c3f20a
Compare
// public Module constructor(HaGatewayConfiguration) | ||
// public Module constructor(HaGatewayConfiguration, Environment) | ||
Constructor<?>[] constructors = Class.forName(clazz).getConstructors(); | ||
if (constructors.length != 1) { | ||
throw new RuntimeException(format("Failed to load module [%s]. Multiple constructors exist.", clazz)); | ||
} | ||
Constructor<?> constructor = constructors[0]; | ||
Object module = switch (constructor.getParameterCount()) { |
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.
could replace this switch
with an if
@@ -20,6 +20,7 @@ | |||
|
|||
public class HaGatewayConfiguration | |||
{ | |||
private Map<String, String> airliftConfig = new HashMap<>(); |
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.
airliftConfig
may not be intuitive to users unfamiliar with the implementation details. If we set node.environment
in the code, then something like httpConfig
would be more obvious
Description
Resolve #41
The first two commits will be split into different PR.
The following commits can no longer be built and tested individually. This is caused by the mass dependency conflict between Dropwizard and Airlift. It is impossible to replace Dropwizard part by part and keep each commit buildable. Also, it will be very difficult to review if all changes are squashed into one commit.
TODO in this PR
Follow-up later in other PRs
How to run in Intellij
VM options:
-Xmx1g -Djdk.attach.allowAttachSelf=true -Dlog.levels-file=gateway-ha/etc/log.properties -Dconfig=gateway-ha/etc/config.properties
Main class:
io.trino.gateway.ha.HaGatewayLauncher
Argument:
docs/quickstart-config.yaml
Working directory:
$ProjectFileDir$
Release notes
(x) Release notes are required, with the following suggested text: