T - type of the input itemK - type of the keypublic interface StageWithGroupingAndWindow<T,K>
| Modifier and Type | Method and Description |
|---|---|
<A,R> StreamStage<TimestampedEntry<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> StreamStage<OUT> |
aggregate(AggregateOperation1<? super T,A,R> aggrOp,
KeyedWindowResultFunction<? super K,? super R,OUT> mapToOutputFn)
Attaches to this stage a stage that performs the given
group-and-aggregate operation over the window described by the window
definition captured by this object.
|
<T1,A,R> StreamStage<TimestampedEntry<K,R>> |
aggregate2(StreamStageWithGrouping<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(StreamStageWithGrouping<T1,? extends K> stage1,
AggregateOperation2<? super T,? super T1,A,R> aggrOp,
KeyedWindowResultFunction<? 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. |
<T1,T2,A,R> |
aggregate3(StreamStageWithGrouping<T1,? extends K> stage1,
StreamStageWithGrouping<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(StreamStageWithGrouping<T1,? extends K> stage1,
StreamStageWithGrouping<T2,? extends K> stage2,
AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp,
KeyedWindowResultFunction<? 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 WindowGroupAggregateBuilder<T,K> |
aggregateBuilder()
Returns a fluent API builder object to construct a windowed
cogroup-and-aggregate stage with any number of contributing stages.
|
DistributedFunction<? super T,? extends K> |
keyFn()
Returns the function that extracts the grouping key from stream items.
|
WindowDefinition |
windowDefinition()
Returns the definition of the window for the windowed aggregation
operation that you are about to construct using this object.
|
@Nonnull DistributedFunction<? super T,? extends K> keyFn()
@Nonnull WindowDefinition windowDefinition()
@Nonnull <A,R,OUT> StreamStage<OUT> aggregate(@Nonnull AggregateOperation1<? super T,A,R> aggrOp, @Nonnull KeyedWindowResultFunction<? 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 <A,R> StreamStage<TimestampedEntry<K,R>> aggregate(@Nonnull AggregateOperation1<? super T,A,R> aggrOp)
Map.Entry) for each distinct key it observes in its input belonging to
a given window. 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> StreamStage<OUT> aggregate2(@Nonnull StreamStageWithGrouping<T1,? extends K> stage1, @Nonnull AggregateOperation2<? super T,? super T1,A,R> aggrOp, @Nonnull KeyedWindowResultFunction<? super K,? super R,OUT> mapToOutputFn)
stage1 you supply. For each distinct grouping key it
observes in the input belonging to a given window, 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.
T1 - type of items in stage1A - 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
The aggregate operation must specify a separate accumulator function for
each of the two streams (refer to its {@link AggregateOperation2 Javadoc}
for a simple example).,
AggregateOperations@Nonnull <T1,A,R> StreamStage<TimestampedEntry<K,R>> aggregate2(@Nonnull StreamStageWithGrouping<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 the input belonging to
a given window. 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 stage1A - 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> StreamStage<OUT> aggregate3(@Nonnull StreamStageWithGrouping<T1,? extends K> stage1, @Nonnull StreamStageWithGrouping<T2,? extends K> stage2, @Nonnull AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp, @Nonnull KeyedWindowResultFunction<? super K,? super R,OUT> mapToOutputFn)
stage1 and stage2 you supply. For each distinct
grouping key it observes in the input belonging to a given window, 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 stage1T2 - type of items in stage2A - 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 <T1,T2,A,R> StreamStage<TimestampedEntry<K,R>> aggregate3(@Nonnull StreamStageWithGrouping<T1,? extends K> stage1, @Nonnull StreamStageWithGrouping<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 the
input belonging to a given window. 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 stage1T2 - type of items in stage2A - type of the accumulator used by the aggregate operationR - type of the aggregation resultaggrOp - the aggregate operation to performAggregateOperations@Nonnull default WindowGroupAggregateBuilder<T,K> aggregateBuilder()
stage.aggregateN(...) calls because
they offer more static type safety.Copyright © 2018 Hazelcast, Inc.. All rights reserved.