Skip to content

Serialize NodesInfoRequest as a set of strings #53202

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

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
BWC backport of #53140

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.
@williamrandolph williamrandolph merged commit d145b55 into elastic:7.x Mar 6, 2020
@williamrandolph williamrandolph deleted the backport/7.x/nodes-info-requests-refactor branch May 23, 2022 17:25
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.

1 participant