Package com.hazelcast.jet.pipeline
Class GroupAggregateBuilder1<T0,K>
java.lang.Object
com.hazelcast.jet.pipeline.GroupAggregateBuilder1<T0,K>
- Type Parameters:
T0
- type of the stream-0 itemK
- type of the grouping key
Offers a step-by-step API to build a pipeline stage that co-groups and
aggregates the data from several input stages. To obtain it, call
BatchStageWithKey.aggregateBuilder()
on one of the stages to co-group
and refer to that method's Javadoc for further details.
Note: this is not a builder of
AggregateOperation
. If that's what you are looking for, go here
.
- Since:
- Jet 3.0
-
Method Summary
Modifier and TypeMethodDescription<T> Tag<T>
add
(BatchStageWithKey<T, K> stage) Adds another stage that will contribute its data to the aggregate operation to be performed.<R> BatchStage<Map.Entry<K,
R>> build
(AggregateOperation<?, R> aggrOp) Creates and returns a pipeline stage that performs the co-grouping and aggregation of pipeline stages registered with this builder object.<R,
OUT> BatchStage<OUT> build
(AggregateOperation<?, R> aggrOp, BiFunctionEx<? super K, ? super R, OUT> mapToOutputFn) Deprecated.This is a leftover from an earlier development cycle of the Pipeline API.tag0()
Returns the tag corresponding to the pipeline stage this builder was obtained from.
-
Method Details
-
tag0
Returns the tag corresponding to the pipeline stage this builder was obtained from. Use this tag to refer to this stage when building theAggregateOperation
that you'll pass tobuild(aggrOp)
. -
add
Adds another stage that will contribute its data to the aggregate operation to be performed. Returns the tag you'll use to refer to this stage when building theAggregateOperation
that you'll pass tobuild()
. -
build
@Deprecated @Nonnull public <R,OUT> BatchStage<OUT> build(@Nonnull AggregateOperation<?, R> aggrOp, @Nonnull BiFunctionEx<? super K, ? super R, OUT> mapToOutputFn) Deprecated.This is a leftover from an earlier development cycle of the Pipeline API. Usebuild(AggregateOperation)
instead and add a separate mapping stage withmapToOutputFn
.Creates and returns a pipeline stage that performs the co-grouping and aggregation of pipeline stages registered with this builder object. The tags you register with the aggregate operation must match the tags you registered with this builder. It applies themapToOutputFn
to the key and the corresponding result of the aggregate operation to obtain the final output of the stage.- Type Parameters:
R
- result type of the aggregate operationOUT
- output type of the returned stage- Parameters:
aggrOp
- the aggregate operation to performmapToOutputFn
- the function to map the output. It must be stateless and cooperative.- Returns:
- a new stage representing the co-group-and-aggregate operation
-
build
Creates and returns a pipeline stage that performs the co-grouping and aggregation of pipeline stages registered with this builder object. The tags you register with the aggregate operation must match the tags you registered with this builder.- Type Parameters:
R
- output type of the returned stage- Parameters:
aggrOp
- the aggregate operation to perform- Returns:
- a new stage representing the co-group-and-aggregate operation
-