Skip to content

NodeInfo response should use a collection rather than fields (#54460)#55132

Merged
williamrandolph merged 2 commits intoelastic:7.xfrom
williamrandolph:backport/7.x/nodes-info-response-fields-to-collection
Apr 13, 2020
Merged

NodeInfo response should use a collection rather than fields (#54460)#55132
williamrandolph merged 2 commits intoelastic:7.xfrom
williamrandolph:backport/7.x/nodes-info-response-fields-to-collection

Conversation

@williamrandolph
Copy link
Copy Markdown
Contributor

This is a first cut at giving NodeInfo the ability to carry a flexible
list of heterogeneous info responses. The trick is to be able to
serialize and deserialize an arbitrary list of blocks of information. It
is convenient to be able to deserialize into usable Java objects so that
we can aggregate nodes stats for the cluster stats endpoint.

In order to provide a little bit of clarity about which objects can and
can't be used as info blocks, I've introduced a new interface called
"ReportingService."

I have removed the hard-coded getters (e.g., getOs()) in favor of a
flexible method that can return heterogeneous kinds of info blocks
(e.g., getInfo(OsInfo.class)). Taking a class as an argument removes the
need to cast in the client code.

williamrandolph and others added 2 commits April 13, 2020 16:11
…#54460)

This is a first cut at giving NodeInfo the ability to carry a flexible
list of heterogeneous info responses. The trick is to be able to
serialize and deserialize an arbitrary list of blocks of information. It
is convenient to be able to deserialize into usable Java objects so that
we can aggregate nodes stats for the cluster stats endpoint.

In order to provide a little bit of clarity about which objects can and
can't be used as info blocks, I've introduced a new interface called
"ReportingService."

I have removed the hard-coded getters (e.g., getOs()) in favor of a
flexible method that can return heterogeneous kinds of info blocks
(e.g., getInfo(OsInfo.class)). Taking a class as an argument removes the
need to cast in the client code.
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

@williamrandolph
Copy link
Copy Markdown
Contributor Author

@elasticmachine please run elasticsearch-ci/1

@williamrandolph williamrandolph merged commit 52bebec into elastic:7.x Apr 13, 2020
@williamrandolph
Copy link
Copy Markdown
Contributor Author

backport of #54460

@williamrandolph williamrandolph deleted the backport/7.x/nodes-info-response-fields-to-collection branch May 23, 2022 17:27
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.

2 participants