Module org.elasticsearch.compute
Record Class FilteredAggregatorFunction
java.lang.Object
java.lang.Record
org.elasticsearch.compute.aggregation.FilteredAggregatorFunction
- All Implemented Interfaces:
Closeable,AutoCloseable,AggregatorFunction,Releasable
public record FilteredAggregatorFunction(AggregatorFunction next, ExpressionEvaluator filter)
extends Record
implements AggregatorFunction
A
AggregatorFunction that wraps another, filtering which positions
are supplied to the aggregator.
This works by running the filter and providing its results in the mask
parameter for addRawInput(org.elasticsearch.compute.data.Page, org.elasticsearch.compute.data.BooleanVector).
-
Constructor Summary
ConstructorsConstructorDescriptionFilteredAggregatorFunction(AggregatorFunction next, ExpressionEvaluator filter) Creates an instance of aFilteredAggregatorFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIntermediateInput(Page page) Add a pre-aggregated page worth of "intermediate" input.voidaddRawInput(Page page, BooleanVector mask) Add a page worth of data to the aggregation.voidclose()final booleanIndicates whether some other object is "equal to" this one.voidevaluateFinal(Block[] blocks, int offset, DriverContext driverContext) Build the final results from running this agg.voidevaluateIntermediate(Block[] blocks, int offset, DriverContext driverContext) Build pre-aggregated "intermediate" data to pass to theAggregatorFunction.addIntermediateInput(org.elasticsearch.compute.data.Page).filter()Returns the value of thefilterrecord component.final inthashCode()Returns a hash code value for this object.intThe number of blocks used by intermediate state.next()Returns the value of thenextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FilteredAggregatorFunction
Creates an instance of aFilteredAggregatorFunctionrecord class.- Parameters:
next- the value for thenextrecord componentfilter- the value for thefilterrecord component
-
-
Method Details
-
addRawInput
Description copied from interface:AggregatorFunctionAdd a page worth of data to the aggregation.- Specified by:
addRawInputin interfaceAggregatorFunction- Parameters:
mask- a mask to apply to the positions. If the position isfalsethen the aggregation should skip it.
-
addIntermediateInput
Description copied from interface:AggregatorFunctionAdd a pre-aggregated page worth of "intermediate" input. This intermediate input will have been created by callingAggregatorFunction.evaluateIntermediate(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.operator.DriverContext)on this agg, though likely in a differentDriverand maybe on a different physical node.- Specified by:
addIntermediateInputin interfaceAggregatorFunction
-
evaluateIntermediate
Description copied from interface:AggregatorFunctionBuild pre-aggregated "intermediate" data to pass to theAggregatorFunction.addIntermediateInput(org.elasticsearch.compute.data.Page).- Specified by:
evaluateIntermediatein interfaceAggregatorFunction- Parameters:
blocks- write the output into this arrayoffset- write the firstBlockat this offset inblocks
-
evaluateFinal
Description copied from interface:AggregatorFunctionBuild the final results from running this agg.- Specified by:
evaluateFinalin interfaceAggregatorFunction- Parameters:
blocks- write the output into this arrayoffset- write the firstBlockat this offset inblocks
-
intermediateBlockCount
public int intermediateBlockCount()Description copied from interface:AggregatorFunctionThe number of blocks used by intermediate state.- Specified by:
intermediateBlockCountin interfaceAggregatorFunction
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReleasable
-
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). -
next
Returns the value of thenextrecord component.- Returns:
- the value of the
nextrecord component
-
filter
Returns the value of thefilterrecord component.- Returns:
- the value of the
filterrecord component
-