Package com.hazelcast.jet.aggregate
Class AggregateOperationBuilder.VarArity<A,R>
java.lang.Object
com.hazelcast.jet.aggregate.AggregateOperationBuilder.VarArity<A,R>
- Type Parameters:
A
- the type of the accumulatorR
- type of the aggregation result
- Enclosing class:
- AggregateOperationBuilder<A>
The variable-arity variant of the aggregate operation builder.
Accepts any number of
accumulate
primitives and associates
them with Tag
s. Does not capture the static type of the
stream items.-
Method Summary
Modifier and TypeMethodDescriptionandAccumulate
(Tag<T> tag, BiConsumerEx<? super A, T> accumulateFn) Registers theaccumulate
primitive for the stream tagged with the supplied tag.andCombine
(BiConsumerEx<? super A, ? super A> combineFn) Registers thecombine
primitive.andDeduct
(BiConsumerEx<? super A, ? super A> deductFn) Registers thededuct
primitive.<R_NEW> AggregateOperationBuilder.VarArity<A,
R_NEW> andExport
(FunctionEx<? super A, ? extends R_NEW> exportFn) Registers theexport
primitive.<R_NEW> AggregateOperation<A,
R_NEW> andExportFinish
(FunctionEx<? super A, ? extends R_NEW> exportFinishFn) andFinish
(FunctionEx<? super A, ? extends R> finishFn) Registers thefinish
primitive.
-
Method Details
-
andAccumulate
@Nonnull public <T> AggregateOperationBuilder.VarArity<A,R> andAccumulate(@Nonnull Tag<T> tag, @Nonnull BiConsumerEx<? super A, T> accumulateFn) Registers theaccumulate
primitive for the stream tagged with the supplied tag.- Type Parameters:
T
- the expected type of input item- Parameters:
tag
- the tag of the associated input streamaccumulateFn
- theaccumulate
primitive. It must be stateless and cooperative.- Returns:
- this
-
andCombine
@Nonnull public AggregateOperationBuilder.VarArity<A,R> andCombine(@Nullable BiConsumerEx<? super A, ? super A> combineFn) Registers thecombine
primitive.The given function must be stateless and cooperative.
-
andDeduct
@Nonnull public AggregateOperationBuilder.VarArity<A,R> andDeduct(@Nullable BiConsumerEx<? super A, ? super A> deductFn) Registers thededuct
primitive.The given function must be stateless and cooperative.
-
andExport
@Nonnull public <R_NEW> AggregateOperationBuilder.VarArity<A,R_NEW> andExport(@Nonnull FunctionEx<? super A, ? extends R_NEW> exportFn) Registers theexport
primitive.The given function must be stateless and cooperative.
-
andFinish
@Nonnull public AggregateOperation<A,R> andFinish(@Nonnull FunctionEx<? super A, ? extends R> finishFn) Registers thefinish
primitive. Constructs and returns anAggregateOperation
from the current state of the builder.The given function must be stateless and cooperative.
- Throws:
IllegalStateException
- if theexport
primitive was not registered
-
andExportFinish
@Nonnull public <R_NEW> AggregateOperation<A,R_NEW> andExportFinish(@Nonnull FunctionEx<? super A, ? extends R_NEW> exportFinishFn) Registers the supplied function as both theexport
andfinish
primitive. Constructs and returns anAggregateOperation
from the current state of the builder.The given function must be stateless and cooperative.
- Throws:
IllegalStateException
- if theexport
primitive is already registered
-