-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Reduce use of deprecated Metadata builder method #124290
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
Reduce use of deprecated Metadata builder method #124290
Conversation
This removes all non-test usage of Metadata.Builder.put(IndexMetadata.Builder) And replaces it with appropriate calls to the equivalent method on `ProjectMetadata.Builder` In most cases this _does not_ make the code project aware, but does reduce the number of deprecated methods in use
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
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
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
@@ -287,6 +289,8 @@ static ClusterState unfollow(String followerIndex, ClusterState current) { | |||
// Remove ccr custom metadata | |||
newIndexMetadata.removeCustom(Ccr.CCR_CUSTOM_METADATA_KEY); | |||
|
|||
return current.copyAndUpdateMetadata(metadata -> metadata.put(newIndexMetadata)); | |||
@FixForMultiProject | |||
final ProjectId projectId = current.metadata().getProject().id(); |
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.
:+1 I like this pattern
This removes all non-test usage of
And replaces it with appropriate calls to the equivalent method on
ProjectMetadata.Builder
In most cases this does not make the code project aware, but does reduce the number of deprecated methods in use