-
Notifications
You must be signed in to change notification settings - Fork 211
[Part 4]: Clean up worker ports #151
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
This diff has two purposes: 1. Establish the semantics of WorkerPorts and make sure all constructors lead to the same behavior (which was not the case before) 2. Make sure WorkerPorts is serializable by both Jackson and Java as it will be sent via wire using java serialization during RPC calls.
|
|
||
| ext.libraries = [ | ||
| asyncHttpClient: 'org.asynchttpclient:async-http-client:2.12.3', | ||
| commonsLang3: 'org.apache.commons:commons-lang3:3.5', |
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.
Do you think this one might need to be shaded?
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 don't think so. The breaking API changes in this library are fairly minimum.
| } | ||
|
|
||
| public WorkerPorts(int metricsPort, int debugPort, int consolePort, int customPort, int sinkPort) { | ||
| this.ports = new ArrayList<>(5); |
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 you pl refactor this to call the WorkerPorts(List<Integer>); constructor?
I'd also make ports an immutable because we return the value as-is in getPorts.
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.
+1
| this.consolePort = consolePort; | ||
| this.customPort = customPort; | ||
| this.ports = ports; | ||
| this.sinkPort = ports.get(0); |
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.
also, this one.
| @JsonIgnore | ||
| public List<Integer> getAllPorts() { | ||
| final List<Integer> allPorts = new ArrayList<>(ports); | ||
| final List<Integer> allPorts = new ArrayList<>(); |
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.
this diff changes the order of the sink port in the list, not sure how this function is used but it might break any code path that relies on sink port being first in list
|
|
||
| @Test public void shouldTokenizeWithEventsContainingPartialDelimiterMatchesWithCustomDelimiter() { | ||
| String delimiter = UUID.randomUUID().toString(); | ||
| String delimiter = "a04f0418-bdff-4f53-af7d-9f5a093b9d65"; |
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'm curious why the fixed value here?
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.
This was to get around the library bug fixed in #154. I suppose we can move to randomUUID now.
This diff has two purposes:
Context
Explain context and other details for this pull request.
Checklist
./gradlew buildcompiles code correctly./gradlew testpasses all testsCONTRIBUTING.md