-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add mappings versions to ClusterState.Builder convenience methods #99551
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
Add mappings versions to ClusterState.Builder convenience methods #99551
Conversation
|
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 with one comment
| public Builder putCompatibilityVersions( | ||
| String nodeId, | ||
| TransportVersion transportVersion, | ||
| Map<String, SystemIndexDescriptor.MappingsVersion> systemIndexMappingsVersions |
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.
Minor: it seems to me that this method is always called with an empty map. Maybe we could remove the parameter and give it a clearer name, like putCompatibilityVersionsWithNoSystemIndexMapping (I know, it's long, maybe there is something better). But something that makes the caller aware they are skipping something.
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.
The API I'm aiming for here is:
- a method that puts a CompatibilityVersions object to the map, keyed to node ID
- a method that sets the entire map of CompatibilityVersions for the builder
- a convenience method that takes all the kinds of versions and constructs a CompatibilityVersions object. As we add new kinds of versions, we'll add arguments to this method.
Since "CompatibilityVersions" is already plural, it's a little awkward to name the method that takes the whole map. I think "nodeIdToCompatibityVersionsMap" might be a more informative name.
But I think I want to keep the three-arg compatibility versions method as-is. Eventually we'll add more things to CompatibilityVersions, and I don't want to add methods to handle subsets of available types of versions.
| return compatibilityVersionsMap(versions); | ||
| } | ||
|
|
||
| public Builder compatibilityVersionsMap(Map<String, CompatibilityVersions> versions) { |
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.
Is there a name a bit more descriptive we could use?
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.
How about nodeIdsToCompatibilityVersions?
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.
Works for me!
|
@elasticsearchmachine please run elasticsearch-ci/part-1 |
This is a follow-up to #99307, adjusting convenience methods that used to take
TransportVersionarguments to account forMappingsVersionmaps.