Skip to content

Serialize NodesInfoRequest as a set of strings #53140

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

Merged

Conversation

williamrandolph
Copy link
Contributor

If the nodes info endpoint is going to be pluggable, the NodesInfoRequest class needs to support flexible lists of metrics rather than a fixed group of boolean flags. This PR refactors the NodesInfoRequest class so that its serialization will be capable of carrying such lists.

It does not change the external API of the NodesInfoRequest class. 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

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.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Plugins)

Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

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

Couple of suggestions, but LGTM.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM. A few small suggestions

@williamrandolph williamrandolph merged commit 4bd55ce into elastic:master Mar 6, 2020
@williamrandolph williamrandolph deleted the nodes-info-requests-refactor branch March 6, 2020 14:05
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.
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.

5 participants