Skip to content

Conversation

@gmarouli
Copy link
Contributor

In this PR we unify the builders for the data structures and their templates. The reasons for this change:

  • Less object creation because we update the builder structure which reuses other builders and then we do not have to rebuild intermediate values.
  • The need for templates emerged because we need to use ResettableValues but ResettableValues are resolved and used during composition they do not need to be stored in the result. Considering this there is no need to use templates in composition.
  • We introduce the method compose, which we can use to compose a new template with the existing data in the builder. This makes it explicit which data can be composed and how.

@gmarouli gmarouli added >refactoring :Data Management/Data streams Data streams and their lifecycles labels Mar 20, 2025
@gmarouli gmarouli requested a review from jbaiera March 20, 2025 11:02
@elasticsearchmachine elasticsearchmachine added v9.1.0 Team:Data Management Meta label for data/management team labels Mar 20, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Mar 20, 2025
Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

LGTM!

@gmarouli gmarouli merged commit 2c377f9 into elastic:main Mar 21, 2025
18 checks passed
@gmarouli gmarouli deleted the unify-template-builders branch March 21, 2025 08:03
@gmarouli
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Questions ?

Please refer to the Backport tool documentation

gmarouli added a commit to gmarouli/elasticsearch that referenced this pull request Mar 21, 2025
…ta stream lifecycle (elastic#125293)

(cherry picked from commit 2c377f9)

# Conflicts:
#	server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java
#	server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java
#	server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateDataStreamService.java
#	server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java
#	server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsServiceTests.java
#	server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java
gmarouli added a commit that referenced this pull request Mar 21, 2025
…and data stream lifecycle (#125293) (#125387)

* Unify template builders for data stream options, failure store and data stream lifecycle (#125293)

(cherry picked from commit 2c377f9)

# Conflicts:
#	server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java
#	server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java
#	server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateDataStreamService.java
#	server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java
#	server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsServiceTests.java
#	server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java

* Rename metadata variable from project to metadata
afoucret pushed a commit to afoucret/elasticsearch that referenced this pull request Mar 21, 2025
smalyshev pushed a commit to smalyshev/elasticsearch that referenced this pull request Mar 21, 2025
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Data streams Data streams and their lifecycles >refactoring serverless-linked Added by automation, don't add manually Team:Data Management Meta label for data/management team v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants