Skip to content

Conversation

@sundargates
Copy link
Contributor

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.

Context

Explain context and other details for this pull request.

Checklist

  • ./gradlew build compiles code correctly
  • Added new tests where applicable
  • ./gradlew test passes all tests
  • Extended README or added javadocs where applicable
  • Added copyright headers for new files from CONTRIBUTING.md

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',
Copy link
Collaborator

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?

Copy link
Contributor Author

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);
Copy link
Contributor

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.

Copy link
Contributor Author

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);
Copy link
Contributor

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<>();
Copy link
Contributor

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

@sundargates sundargates merged commit 1ba70ca into Netflix:master Mar 24, 2022

@Test public void shouldTokenizeWithEventsContainingPartialDelimiterMatchesWithCustomDelimiter() {
String delimiter = UUID.randomUUID().toString();
String delimiter = "a04f0418-bdff-4f53-af7d-9f5a093b9d65";
Copy link
Contributor

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?

Copy link
Contributor

@hmitnflx hmitnflx Mar 26, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants