Module org.elasticsearch.compute
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the full set of group IDs when output filtering is active (i.e., the operator passes only output-aligned groups to aggregators).abstract voidComputes and caches the adjacent group IDs.groupIdsFromWindow(int startingGroupId, Duration window) Returns the group IDs of subsequent groups that belong to the window starting with thestartingGroupId.abstract intnextGroupId(int currentGroupId) abstract intpreviousGroupId(int currentGroupId) abstract longrangeEndInMillis(int groupId) Returns the exclusive end of the time range, in milliseconds, for the specified group ID.abstract longrangeStartInMillis(int groupId) Returns the inclusive start of the time range, in milliseconds, for the specified group ID.voidsetAllGroupIds(IntVector allGroupIds) Methods inherited from class org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext
blockFactory, close, driverContext
-
Constructor Details
-
TimeSeriesGroupingAggregatorEvaluationContext
-
-
Method Details
-
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
nullwhen no output filtering is applied
-
setAllGroupIds
-
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
Returns the group IDs of subsequent groups that belong to the window starting with thestartingGroupId. The time ranges of returned group IDs are within the interval[rangeStartInMillis(startingGroupId), rangeStartInMillis(startingGroupId) + window.toMillis()).- Parameters:
startingGroupId- the starting group IDwindow- 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.
-