Skip to content

Serialize NodesInfoRequest as a set of strings#53202

Merged
williamrandolph merged 12 commits intoelastic:7.xfrom
williamrandolph:backport/7.x/nodes-info-requests-refactor
Mar 6, 2020
Merged

Serialize NodesInfoRequest as a set of strings#53202
williamrandolph merged 12 commits intoelastic:7.xfrom
williamrandolph:backport/7.x/nodes-info-requests-refactor

Conversation

@williamrandolph
Copy link
Copy Markdown
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