Package com.hazelcast.jet.pipeline
Class GroupAggregateBuilder<K,R0>
- java.lang.Object
-
- com.hazelcast.jet.pipeline.GroupAggregateBuilder<K,R0>
-
- Type Parameters:
K
- type of the grouping keyR0
- type of the aggregation result for stream-0
public class GroupAggregateBuilder<K,R0> extends java.lang.Object
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, callstage.aggregateBuilder(aggrOp)
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, gohere
.- Since:
- Jet 3.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T,R>
Tag<R>add(BatchStageWithKey<T,K> stage, AggregateOperation1<? super T,?,? extends R> aggrOp)
Adds another stage that will contribute its data to the aggregate operation to be performed.BatchStage<java.util.Map.Entry<K,ItemsByTag>>
build()
Creates and returns a pipeline stage that performs the co-aggregation of the stages registered with this builder object and emits aMap.Entry(key, resultsByTag)
for each distinct key.Tag<R0>
tag0()
Returns the tag corresponding to the pipeline stage this builder was obtained from.
-
-
-
Method Detail
-
tag0
@Nonnull public Tag<R0> 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
@Nonnull public <T,R> Tag<R> add(@Nonnull BatchStageWithKey<T,K> stage, @Nonnull AggregateOperation1<? super T,?,? extends R> aggrOp)
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
@Nonnull public BatchStage<java.util.Map.Entry<K,ItemsByTag>> build()
Creates and returns a pipeline stage that performs the co-aggregation of the stages registered with this builder object and emits aMap.Entry(key, resultsByTag)
for each distinct key. The composite aggregate operation places the results of the individual aggregate operations in anItemsByTag
. Use the tags you got from this builder to access the results.- Returns:
- a new stage representing the co-aggregation
-
-