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) |
sethmlarson
left a comment
There was a problem hiding this comment.
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.
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.
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