T
- type of the input itemK
- type of the keypublic interface StageWithGrouping<T,K> extends GeneralStageWithGrouping<T,K>
Modifier and Type | Method and Description |
---|---|
default <A,R> BatchStage<Map.Entry<K,R>> |
aggregate(AggregateOperation1<? super T,A,R> aggrOp)
Attaches to this stage a stage that performs the given
group-and-aggregate operation.
|
<A,R,OUT> BatchStage<OUT> |
aggregate(AggregateOperation1<? super T,A,R> aggrOp,
DistributedBiFunction<? super K,? super R,OUT> mapToOutputFn)
Attaches to this stage a stage that performs the given
group-and-aggregate operation.
|
default <T1,A,R> BatchStage<Map.Entry<K,R>> |
aggregate2(StageWithGrouping<T1,? extends K> stage1,
AggregateOperation2<? super T,? super T1,A,R> aggrOp)
Attaches to this stage a stage that performs the given
cogroup-and-aggregate operation over the items from both this stage
and
stage1 you supply. |
<T1,A,R,OUT> |
aggregate2(StageWithGrouping<T1,? extends K> stage1,
AggregateOperation2<? super T,? super T1,A,R> aggrOp,
DistributedBiFunction<? super K,? super R,OUT> mapToOutputFn)
Attaches to this stage a stage that performs the given
cogroup-and-aggregate operation over the items from both this stage
and
stage1 you supply. |
default <T1,T2,A,R> |
aggregate3(StageWithGrouping<T1,? extends K> stage1,
StageWithGrouping<T2,? extends K> stage2,
AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp)
Attaches to this stage a stage that performs the given
cogroup-and-aggregate operation over the items from this stage as well
as
stage1 and stage2 you supply. |
<T1,T2,A,R,OUT> |
aggregate3(StageWithGrouping<T1,? extends K> stage1,
StageWithGrouping<T2,? extends K> stage2,
AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp,
DistributedBiFunction<? super K,? super R,OUT> mapToOutputFn)
Attaches to this stage a stage that performs the given
cogroup-and-aggregate operation over the items from this stage as well
as
stage1 and stage2 you supply. |
default GroupAggregateBuilder<T,K> |
aggregateBuilder()
Returns a fluent API builder object to construct a cogroup-and-aggregate
stage with any number of contributing stages.
|
keyFn
@Nonnull <A,R,OUT> BatchStage<OUT> aggregate(@Nonnull AggregateOperation1<? super T,A,R> aggrOp, @Nonnull DistributedBiFunction<? super K,? super R,OUT> mapToOutputFn)
mapToOutputFn
with each key and the
associated aggregation result to create the items to emit.A
- type of the accumulator used by the aggregate operationR
- type of the aggregation resultOUT
- type of the output itemaggrOp
- the aggregate operation to performmapToOutputFn
- the function that creates the output itemAggregateOperations
@Nonnull default <A,R> BatchStage<Map.Entry<K,R>> aggregate(@Nonnull AggregateOperation1<? super T,A,R> aggrOp)
Map.Entry
) for each distinct key it observes in its input. The value
is the result of the aggregate operation across all the items with the
given grouping key.A
- type of the accumulator used by the aggregate operationR
- type of the aggregation resultaggrOp
- the aggregate operation to performAggregateOperations
@Nonnull <T1,A,R,OUT> BatchStage<OUT> aggregate2(@Nonnull StageWithGrouping<T1,? extends K> stage1, @Nonnull AggregateOperation2<? super T,? super T1,A,R> aggrOp, @Nonnull DistributedBiFunction<? super K,? super R,OUT> mapToOutputFn)
stage1
you supply. For each distinct grouping key it
observes in the input, it performs the supplied aggregate operation
across all the items sharing that key. Once it has received all the
items, it calls the supplied mapToOutputFn
with each key and
the associated aggregation result to create the items to emit.
The aggregate operation must specify a separate accumulator function for
each of the two streams (refer to its Javadoc
for a simple example).
T1
- type of items in stage1
A
- type of the accumulator used by the aggregate operationR
- type of the aggregation resultOUT
- type of the output itemaggrOp
- the aggregate operation to performmapToOutputFn
- the function that creates the output itemAggregateOperations
@Nonnull default <T1,A,R> BatchStage<Map.Entry<K,R>> aggregate2(@Nonnull StageWithGrouping<T1,? extends K> stage1, @Nonnull AggregateOperation2<? super T,? super T1,A,R> aggrOp)
stage1
you supply. It emits one key-value pair (in a Map.Entry
) for each distinct key it observes in its input. The value
is the result of the aggregate operation across all the items with the
given grouping key.
The aggregate operation must specify a separate accumulator function for
each of the two streams (refer to its Javadoc
for a simple example).
T1
- type of items in stage1
A
- type of the accumulator used by the aggregate operationR
- type of the aggregation resultaggrOp
- the aggregate operation to performAggregateOperations
@Nonnull <T1,T2,A,R,OUT> BatchStage<OUT> aggregate3(@Nonnull StageWithGrouping<T1,? extends K> stage1, @Nonnull StageWithGrouping<T2,? extends K> stage2, @Nonnull AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp, @Nonnull DistributedBiFunction<? super K,? super R,OUT> mapToOutputFn)
stage1
and stage2
you supply. For each distinct
grouping key it observes in the input, it performs the supplied
aggregate operation across all the items sharing that key. Once it has
received all the items, it calls the supplied mapToOutputFn
with
each key and the associated aggregation result to create the items to
emit.
The aggregate operation must specify a separate accumulator function for
each of the three streams (refer to its Javadoc
for a simple example).
T1
- type of items in stage1
T2
- type of items in stage2
A
- type of the accumulator used by the aggregate operationR
- type of the aggregation resultOUT
- type of the output itemaggrOp
- the aggregate operation to performmapToOutputFn
- the function that creates the output itemAggregateOperations
@Nonnull default <T1,T2,A,R> BatchStage<Map.Entry<K,R>> aggregate3(@Nonnull StageWithGrouping<T1,? extends K> stage1, @Nonnull StageWithGrouping<T2,? extends K> stage2, @Nonnull AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp)
stage1
and stage2
you supply. It emits one key-value
pair (in a Map.Entry
) for each distinct key it observes in its
input. The value is the result of the aggregate operation across all the
items with the given grouping key.
The aggregate operation must specify a separate accumulator function for
each of the three streams (refer to its Javadoc
for a simple example).
T1
- type of items in stage1
T2
- type of items in stage2
A
- type of the accumulator used by the aggregate operationR
- type of the aggregation resultaggrOp
- the aggregate operation to performAggregateOperations
@Nonnull default GroupAggregateBuilder<T,K> aggregateBuilder()
stage.aggregateN(...)
calls because they offer more
static type safety.Copyright © 2018 Hazelcast, Inc.. All rights reserved.