Skip to content

Conversation

@gmarouli
Copy link
Contributor

@gmarouli gmarouli commented Sep 19, 2024

As the data stream start having built-in features, for example the data stream lifecycle and in the future the failure store, we would like to group these features under one unified entity.

This entity is going to be the data stream options and the first attempt to move some configuration there has already been implemented, see #109515.

In this PR we refactor the data stream code to use the data stream options instead of a single boolean to enabled the failure store.

The benefit of this are:

  • We introduce one place for all these built-in features.
  • This is extensible and can support other features in the future.
  • It provides a unified way of configuring these features either via updating directly, or via template composition.

Implementation notes:

Currently the record DataStreamOptions contains only DataStreamFailureStore, and the FailureStoreOptions contains only the enabled flag.

Even though the enabled flag is nullable and in the future it will possible to configure DataStreamFailureStore without setting this flag, currently this is not available because then we would have an empty DataStreamFailureStore object.

@gmarouli
Copy link
Contributor Author

@elasticmachine update branch

@gmarouli
Copy link
Contributor Author

@elasticmachine update branch

@gmarouli gmarouli added auto-backport Automatically create backport pull requests when merged v8.16.0 labels Sep 20, 2024
Comment on lines -62 to -66
@Nullable
public DataStreamFailureStore getFailureStore() {
return failureStore;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Redundant method since the DataStreamOptions is a record.

@gmarouli gmarouli marked this pull request as ready for review September 23, 2024 13:13
@gmarouli gmarouli requested a review from jbaiera September 23, 2024 13:14
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Sep 23, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@gmarouli gmarouli marked this pull request as draft September 25, 2024 15:19
@gmarouli gmarouli marked this pull request as ready for review September 26, 2024 17:26
@Nullable
private final DataStreamLifecycle lifecycle;
private final boolean failureStoreEnabled;
private final DataStreamOptions dataStreamOptions;
Copy link
Contributor Author

@gmarouli gmarouli Sep 26, 2024

Choose a reason for hiding this comment

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

I thought it would be easier to refer to an empty constant than always perform the null check before accessing this object. Only on serialisation we use null to avoid serialising empty configurations.

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.

This looks really great! I only had a couple comments but otherwise LGTM!

@gmarouli
Copy link
Contributor Author

@elasticmachine update branch

@gmarouli
Copy link
Contributor Author

@elasticmachine update branch

@gmarouli gmarouli added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Sep 30, 2024
@gmarouli gmarouli merged commit 76c2d8d into elastic:main Sep 30, 2024
@gmarouli gmarouli deleted the failure-store-config-switch-to-options branch September 30, 2024 12:32
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

gmarouli added a commit to gmarouli/elasticsearch that referenced this pull request Sep 30, 2024
elasticsearchmachine pushed a commit that referenced this pull request Sep 30, 2024
…#113176) (#113799)

* Move the failure store enable flag into the data stream options (#113176)

* Remove unsupported java 21 features
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Data Management/Data streams Data streams and their lifecycles >refactoring Team:Data Management Meta label for data/management team v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants