Skip to content
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

More info classes to implement Writeable rather than Streamable #20288

Merged
merged 19 commits into from
Sep 2, 2016

Conversation

javanna
Copy link
Member

@javanna javanna commented Sep 1, 2016

While working on #20255 I noticed that we could easily migrate some classes that belong to our info api from Streamable to Writeable. I did it for some of them in this PR. That allows to have final members and more concise / better looking code. Also added tests where needed.

@javanna javanna changed the title Enhancement/more writeable More info classes to implement Writeable rather than Streamable Sep 1, 2016
}

public PluginsAndModules(StreamInput in) throws IOException {
int pluginsSize = in.readInt();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be plugins = in.readList(PluginInfo::new)?

@nik9000
Copy link
Member

nik9000 commented Sep 1, 2016

Changes LGTM. I left a bunch of minor stuff but none of them are actual objections.

I didn't carefully match up all the changes you did to make sure you added tests for them. Do you want me to double check that?

@javanna
Copy link
Member Author

javanna commented Sep 1, 2016

I didn't carefully match up all the changes you did to make sure you added tests for them. Do you want me to double check that?

please do. I didn't add many specific tests, rather beefed up NodeInfoStreamingTests which tests NodeInfo that holds all of these little objects that I changed. Let me know what you think.

@@ -302,6 +302,14 @@ public static int randomInt() {
return random().nextInt();
}

public static long randomPositiveLong() {
long positiveLong = randomLong();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh! another wonderful reason to use do {...} while syntax! The rarest of syntax!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also maybe change the variable name. The value might not be positive here.

@nik9000
Copy link
Member

nik9000 commented Sep 1, 2016

OK! I rechecked. LGTM.

@javanna javanna merged commit 28d7ebe into elastic:master Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants