-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Add time series related information to get data stream API #86395
Add time series related information to get data stream API #86395
Conversation
In case if a data stream is a time series data stream then include time series information. This includes the continuous temporal ranges a time series data stream encapsulates. This is computed based on combing the index.time_series.start_time and index.time_series.end_time ranges of all backing indices of a time series data stream Closes elastic#83518
Pinging @elastic/es-data-management (Team:Data Management) |
This change add
|
Pinging @elastic/clients-team (Team:Clients) |
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 from an API perspective
Thanks @sethmlarson for reviewing! |
if (dataStream.getIndexMode() == IndexMode.TIME_SERIES) { | ||
List<Tuple<Instant, Instant>> ranges = new ArrayList<>(); | ||
Tuple<Instant, Instant> current = null; | ||
for (Index index : dataStream.getIndices()) { |
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.
Could you fail if the indices aren't in time series order? Or warn or something? Just out of paranoia.
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.
Or sort them by start time.
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.
The indices are in order in which they are created. (new data stream, rollover, rollover again -> 3 backing indices that are in order). So the start / end times should be in order.
I will add an assertion and ensure a warning log gets printed (if this ever should occur in production). Which I don't think should be the case.
@elasticmachine update branch |
In case if a data stream is a time series data stream then include time series information.
This includes the continuous temporal ranges a time series data stream encapsulates.
This is computed based on combing the index.time_series.start_time and index.time_series.end_time
ranges of all backing indices of a time series data stream
Closes #83518