Module org.elasticsearch.compute
Record Class GroupingAggregator
java.lang.Object
java.lang.Record
org.elasticsearch.compute.aggregation.GroupingAggregator
- All Implemented Interfaces:
Closeable,AutoCloseable,org.elasticsearch.core.Releasable
public record GroupingAggregator(GroupingAggregatorFunction aggregatorFunction, AggregatorMode mode)
extends Record
implements org.elasticsearch.core.Releasable
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionGroupingAggregator(GroupingAggregatorFunction aggregatorFunction, AggregatorMode mode) Creates an instance of aGroupingAggregatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaggregatorFunctionrecord component.voidclose()final booleanIndicates whether some other object is "equal to" this one.voidevaluate(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext) Build the results for this aggregation.intThe number of Blocks required for evaluation.final inthashCode()Returns a hash code value for this object.mode()Returns the value of themoderecord component.prepareProcessPage(SeenGroupIds seenGroupIds, Page page) Prepare to process a single page of results.toString()Returns a string representation of this record class.
-
Constructor Details
-
GroupingAggregator
Creates an instance of aGroupingAggregatorrecord class.- Parameters:
aggregatorFunction- the value for theaggregatorFunctionrecord componentmode- the value for themoderecord component
-
-
Method Details
-
evaluateBlockCount
public int evaluateBlockCount()The number of Blocks required for evaluation. -
prepareProcessPage
Prepare to process a single page of results. -
evaluate
public void evaluate(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext) Build the results for this aggregation.- Parameters:
selected- the groupIds that have been selected to be included in the results. Always ascending.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
aggregatorFunction
Returns the value of theaggregatorFunctionrecord component.- Returns:
- the value of the
aggregatorFunctionrecord component
-
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-