Serialize NodesInfoRequest as a set of strings#53140
Merged
williamrandolph merged 11 commits intoelastic:masterfrom Mar 6, 2020
Merged
Serialize NodesInfoRequest as a set of strings#53140williamrandolph merged 11 commits intoelastic:masterfrom
williamrandolph merged 11 commits intoelastic:masterfrom
Conversation
For Node Info to be pluggable, NodesInfoRequest must be able to carry arbitrary strings. This commit reworks the internals of that class to use a set rather than hard-coded boolean fields.
NodesInfoRequest defaults to specifying all values. We need to test for this behavior as we refactor. Also, we can use random testing for the various combinations of metrics rather than having individual tests for each metric.
Collaborator
|
Pinging @elastic/es-core-infra (:Core/Infra/Plugins) |
pugnascotia
reviewed
Mar 5, 2020
server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequest.java
Show resolved
Hide resolved
pugnascotia
reviewed
Mar 5, 2020
...er/src/test/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequestTests.java
Show resolved
Hide resolved
pugnascotia
approved these changes
Mar 5, 2020
Contributor
pugnascotia
left a comment
There was a problem hiding this comment.
Couple of suggestions, but LGTM.
williamrandolph
commented
Mar 5, 2020
...er/src/test/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequestTests.java
Outdated
Show resolved
Hide resolved
rjernst
approved these changes
Mar 5, 2020
Member
rjernst
left a comment
There was a problem hiding this comment.
LGTM. A few small suggestions
server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequest.java
Show resolved
Hide resolved
...er/src/test/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequestTests.java
Show resolved
Hide resolved
williamrandolph
added a commit
that referenced
this pull request
Mar 6, 2020
For Node Info to be pluggable, NodesInfoRequest must be able to carry arbitrary strings. This commit reworks the internals of that class to use a set rather than hard-coded boolean fields. NodesInfoRequest defaults to specifying all values. We test for this behavior as we refactor and use random testing for the various combinations of metrics. Add backwards compatibility for transport requests.
This was referenced Mar 6, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the nodes info endpoint is going to be pluggable, the
NodesInfoRequestclass needs to support flexible lists of metrics rather than a fixed group of boolean flags. This PR refactors theNodesInfoRequestclass so that its serialization will be capable of carrying such lists.It does not change the external API of the
NodesInfoRequestclass. This will be done in a follow-up PR. I want to keep this PR as small as I can in case I have misunderstood anything important about backwards compatibility for the transport protocol.This PR also adds some granular unit tests that I used to make sure that the class's behavior didn't change.
Relates #52975