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

NodeStats classes to implement Writeable rather then Streamable #20327

Merged
merged 18 commits into from
Sep 7, 2016

Conversation

javanna
Copy link
Member

@javanna javanna commented Sep 5, 2016

This allows to make all the instance members final , which also prevents silly errors from happening (e.g. missing assignment when reading from the stream).

Added also an extensive serialization test that was missing before.

breaker = AllCircuitBreakerStats.readOptionalAllCircuitBreakerStats(in);
scriptStats = in.readOptionalStreamable(ScriptStats::new);
discoveryStats = in.readOptionalStreamable(() -> new DiscoveryStats(null));
os = in.readOptionalWriteable(OsStats::new);
Copy link
Member

Choose a reason for hiding this comment

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

I like how github put this part up front. Very nice.

@nik9000
Copy link
Member

nik9000 commented Sep 6, 2016

I left a few minor comments, LGTM otherwise.

assertEquals(mem.getNonHeapUsed(), deserializedMem.getNonHeapUsed());
assertEquals(mem.getHeapMax(), deserializedMem.getHeapMax());
JvmStats.Classes classes = jvm.getClasses();
assertEquals(classes.getLoadedClassCount(), deserializedJvm.getClasses().getLoadedClassCount());
Copy link
Member

Choose a reason for hiding this comment

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

Much nicer! Thanks.

@javanna javanna force-pushed the enhancement/stats_writeable branch 3 times, most recently from bd4db4d to 0b0168b Compare September 6, 2016 21:14
also removed null checks in toXContent for subobjects that cannot be null and added @nullable annotation for memory pools
Also removed ScriptStats#add method which was unused
…inal

FsInfo#total is removed in favour of getTotal, which allows to retrieve the total value

[TEST] fix FsProbeTests: null is not accepted as path constructor argument
Without the getters there is no way to retrieve the values for its instance members from the java api, they only get printed out on the REST layer
@javanna javanna merged commit 0d21d9f into elastic:master Sep 7, 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