Interface TimeSeries.QueryResult<V>
- Type Parameters:
V
- query value type
- Enclosing interface:
- TimeSeries
public static interface TimeSeries.QueryResult<V>
Query result providing a
stream of events
.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Describes the structural properties of a stream. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this result includes all events selected by the query.merge
(TimeSeries.QueryResult<V> other) Merge this result withother
, combining original events and edit events, to produce anTimeSeries.QueryResult
of typeVALUE_EVENT_STREAM
long
Returns the number of events selected by the query.stream()
Returns a description of the structure of theresult stream
.
-
Method Details
-
selectedCount
long selectedCount()Returns the number of events selected by the query.This number may be greater than
stream().count()
due to a policy of the time series topic to limit the number of returned results, or the use ofTimeSeries.RangeQuery.limit(long)
.- Returns:
- the number of events selected by the query
-
stream
Stream<TimeSeries.Event<V>> stream()- Returns:
- the events, as a
java.util.stream.Stream
interface. Instances benefit from the various combinator and reduction methods provided by Stream.
-
isComplete
boolean isComplete()Returns whether this result includes all events selected by the query.Equivalent to
return this.selectedCount() == this.stream().count();
-
streamStructure
TimeSeries.QueryResult.StreamStructure streamStructure()Returns a description of the structure of theresult stream
.- Returns:
- a StreamStructure that describes the structure of the result stream
-
merge
Merge this result withother
, combining original events and edit events, to produce anTimeSeries.QueryResult
of typeVALUE_EVENT_STREAM
The following rules are applied to calculate the result:
- If this result and
other
have an event with equal sequence numbers, the event fromother
is selected. - An edit event is selected in place of its original event.
- If there are multiple edit events of an original edit, the one with the highest sequence is selected.
The returned result implements
isComplete()
to return true andselectedCount()
to return the count of events in the stream, regardless of whether this result is complete. - If this result and
-