-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Cluster state and CRUD operations for data streams #53877
Conversation
Pinging @elastic/es-core-features (:Core/Features/Data streams) |
server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java
Outdated
Show resolved
Hide resolved
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.
Looks good. I left a number of comments.
server/src/main/java/org/elasticsearch/indices/DataStreamMissingException.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/action/admin/indices/datastream/CreateDataStreamAction.java
Outdated
Show resolved
Hide resolved
rest-api-spec/src/main/resources/rest-api-spec/test/indices.data_stream/10_basic.yml
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamMetadataTests.java
Show resolved
Hide resolved
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.
Looking good. Left some test comments.
.../src/main/java/org/elasticsearch/action/admin/indices/datastream/CreateDataStreamAction.java
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/cluster/metadata/ToAndFromJsonMetaDataTests.java
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/action/admin/indices/datastream/CreateDataStreamAction.java
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/action/admin/indices/datastream/DeleteDataStreamAction.java
Show resolved
Hide resolved
} | ||
|
||
static List<DataStream> getDataStreams(ClusterState clusterState, Request request) { | ||
Map<String, DataStream> dataStreams = clusterState.metaData().dataStreams(); |
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.
unit test?
Also I think this should throw a resource not found exception if a specific data stream doesn't exist?
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.
It seems there are different existing behaviors when attempting to retrieve a specific resource that does not exist. E.g., aliases and indices return a 404 and index templates and ingest pipelines return an empty list. I don't if those are intentional behavioral differences, but I can certainly return a 404 if that's appropriate for data streams.
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.
I think that returning a 404 in case of requesting a specific data stream is appropriate.
@elasticmachine update branch |
@elasticmachine update branch |
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
Adds data streams to cluster state and implements their create, delete, and get operations.
Relates to #53100.