Skip to content

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

Conversation

tvernum
Copy link
Contributor

@tvernum tvernum commented Mar 7, 2025

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

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
@tvernum tvernum added :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >refactoring labels Mar 7, 2025
@tvernum tvernum requested a review from a team March 7, 2025 06:21
@elasticsearchmachine elasticsearchmachine added Team:Distributed Indexing Meta label for Distributed Indexing team v9.1.0 labels Mar 7, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

Copy link
Contributor

@nielsbauman nielsbauman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@ywangd ywangd left a 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();
Copy link
Member

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

@tvernum tvernum merged commit a0dd4e7 into elastic:main Apr 11, 2025
17 checks passed
@tvernum tvernum deleted the multi-project/metadata-builder/put-index-metadata-builder branch April 11, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >refactoring Team:Distributed Indexing Meta label for Distributed Indexing team v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants