Package com.hazelcast.jet.aggregate
Class CoAggregateOperationBuilder
java.lang.Object
com.hazelcast.jet.aggregate.CoAggregateOperationBuilder
Offers a step-by-step API to create an aggregate operation that
accepts multiple inputs. To obtain it, call
AggregateOperations.coAggregateOperationBuilder()
. and refer to that
method's Javadoc for further details.- Since:
- Jet 3.0
-
Method Summary
Modifier and TypeMethodDescription<T,
R> Tag<R> add
(Tag<T> tag, AggregateOperation1<? super T, ?, ? extends R> operation) Registers the given aggregate operation with the tag corresponding to an input to the co-aggregating operation being built.build()
Builds and returns theAggregateOperation
.<R> AggregateOperation<Object[],
R> build
(FunctionEx<? super ItemsByTag, ? extends R> exportFinishFn) Builds and returns the multi-inputAggregateOperation
.
-
Method Details
-
add
@Nonnull public <T,R> Tag<R> add(@Nonnull Tag<T> tag, @Nonnull AggregateOperation1<? super T, ?, ? extends R> operation) Registers the given aggregate operation with the tag corresponding to an input to the co-aggregating operation being built. If you are preparing an operation to pass to an aggregate builder, you must use the tags you obtained from it.Returns the tag you'll use to retrieve the results of aggregating this input.
- Type Parameters:
T
- type of this operation's inputR
- the result type of this operation- Returns:
- the result tag
-
build
Builds and returns theAggregateOperation
. Its result type isItemsByTag
containing all the tags you got from theadd(com.hazelcast.jet.datamodel.Tag<T>, com.hazelcast.jet.aggregate.AggregateOperation1<? super T, ?, ? extends R>)
method. -
build
@Nonnull public <R> AggregateOperation<Object[],R> build(@Nonnull FunctionEx<? super ItemsByTag, ? extends R> exportFinishFn) Builds and returns the multi-inputAggregateOperation
. It will call the suppliedexportFinishFn
to transform theItemsByTag
it creates to the result type it emits as the actual result.- Parameters:
exportFinishFn
- function to convertItemsByTag
to the target result type. It must be stateless and cooperative.
-