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.
  • 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 of TimeSeries.RangeQuery.limit(long).

      Returns:
      the number of events selected by the query
    • 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

      Returns a description of the structure of the result stream.
      Returns:
      a StreamStructure that describes the structure of the result stream
    • merge

      Merge this result with other, combining original events and edit events, to produce an TimeSeries.QueryResult of type VALUE_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 from other 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 and selectedCount() to return the count of events in the stream, regardless of whether this result is complete.