-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Conversation
} | ||
|
||
public PluginsAndModules(StreamInput in) throws IOException { | ||
int pluginsSize = in.readInt(); |
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 this be plugins = in.readList(PluginInfo::new)
?
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? |
980edbc
to
5451c31
Compare
please do. I didn't add many specific tests, rather beefed up |
@@ -302,6 +302,14 @@ public static int randomInt() { | |||
return random().nextInt(); | |||
} | |||
|
|||
public static long randomPositiveLong() { | |||
long positiveLong = randomLong(); |
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.
ooh! another wonderful reason to use do {...} while
syntax! The rarest of syntax!
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 maybe change the variable name. The value might not be positive here.
OK! I rechecked. LGTM. |
941556a
to
4bac777
Compare
With this we can make ByteSizeValue immutable for real.
This allows to make all instance members final. Also added serialization tests and sorted out inizialization that was scattered in two places.
… existing NodeInfoStreamingTests
79aeecf
to
51620f7
Compare
While working on #20255 I noticed that we could easily migrate some classes that belong to our info api from
Streamable
toWriteable
. 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.