Class TimeSeriesGroupingAggregatorEvaluationContext

java.lang.Object
org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext
org.elasticsearch.compute.aggregation.TimeSeriesGroupingAggregatorEvaluationContext
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.Releasable

public abstract class TimeSeriesGroupingAggregatorEvaluationContext extends GroupingAggregatorEvaluationContext
  • Constructor Details

    • TimeSeriesGroupingAggregatorEvaluationContext

      public TimeSeriesGroupingAggregatorEvaluationContext(DriverContext driverContext)
  • Method Details

    • allGroupIds

      public IntVector allGroupIds()
      Returns the full set of group IDs when output filtering is active (i.e., the operator passes only output-aligned groups to aggregators). Window functions need the complete set to produce intermediate results for neighbor lookups during the merge step.
      Returns:
      all group IDs, or null when no output filtering is applied
    • setAllGroupIds

      public void setAllGroupIds(IntVector allGroupIds)
    • rangeStartInMillis

      public abstract long rangeStartInMillis(int groupId)
      Returns the inclusive start of the time range, in milliseconds, for the specified group ID. Data points for this group are within the range [rangeStartInMillis, rangeEndInMillis).
      Parameters:
      groupId - the group id
      Returns:
      the start of the time range in milliseconds (inclusive)
    • rangeEndInMillis

      public abstract long rangeEndInMillis(int groupId)
      Returns the exclusive end of the time range, in milliseconds, for the specified group ID. Data points for this group are within the range [rangeStartInMillis, rangeEndInMillis).
    • groupIdsFromWindow

      public abstract List<Integer> groupIdsFromWindow(int startingGroupId, Duration window)
      Returns the group IDs of subsequent groups that belong to the window starting with the startingGroupId. The time ranges of returned group IDs are within the interval [rangeStartInMillis(startingGroupId), rangeStartInMillis(startingGroupId) + window.toMillis()).
      Parameters:
      startingGroupId - the starting group ID
      window - the window duration
      Returns:
      a list of group IDs within the window
    • previousGroupId

      public abstract int previousGroupId(int currentGroupId)
    • nextGroupId

      public abstract int nextGroupId(int currentGroupId)
    • computeAdjacentGroupIds

      public abstract void computeAdjacentGroupIds()
      Computes and caches the adjacent group IDs. They weill be used in #previousGroupId and #nextGroupId.