-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Refactor Metadata.toXContent by extracting methods #124689
Refactor Metadata.toXContent by extracting methods #124689
Conversation
The method is long and has two distinct paths for multi-project and single-project formats. This PR extracts separate method for each of the code paths for readability. See also: elastic#124613 (comment)
Pinging @elastic/es-core-infra (Team:Core/Infra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks Yang!
|
||
// need to combine reserved state together into a single block so we don't get duplicate keys | ||
// and not include it in the project xcontent output (through the lack of multi-project params) | ||
// use a tree map so the order is deterministic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the tree map in the MP version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually have no idea. This is existing code. I thought the order was relied on tests. But I could not find any evidence.
@elasticmachine update branch |
The method is long and has two distinct paths for multi-project and single-project formats. This PR extracts separate method for each of the code paths for readability. See also: elastic#124613 (comment)
The method is long and has two distinct paths for multi-project and single-project formats. This PR extracts separate method for each of the code paths for readability.
See also:
#124613 (comment)