Skip to content

Conversation

@williamrandolph
Copy link
Contributor

This PR refactors the NodesStatsRequest object towards pluggability. It has the same basic structure as a similar refactor of the NodesInfoRequest object.

Now that the NodesStatsRequest class uses a set of strings for its internal serialization, we need to update the class's interface so that we no longer use hard-coded getters and setters, but rather methods that add strings directly. For example, the old way of adding "os" metrics to a request would be to call request.os(true). The new way of doing this is to call request.addMetric("os").

For the time being, the canonical list of metrics is an enum in NodesStatsRequest. This will eventually be replaced with something pluggable.

Note that the NodesStatsRequestBuilder class also needs to be refactored, but I'm leaving that for a later PR in order to keep the diff manageable.

NodesStatsRequest uses a set of strings internally to track which
metrics have been requested. This commit adjusts the class's public API
to provide general methods for adding and removing submetric strings. It
removes the old hardcoded boolean getters and setters.
@elasticmachine
Copy link
Collaborator

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

@bpintea bpintea added v7.8.0 and removed v7.7.0 labels Mar 25, 2020
@williamrandolph williamrandolph merged commit 14204f8 into elastic:7.x Mar 26, 2020
@williamrandolph williamrandolph deleted the backport/7.x/nodes-stats-request-interface-refactor branch March 26, 2020 18:41
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.

3 participants