T - type of the input itempublic interface StageWithWindow<T>
| Modifier and Type | Method and Description |
|---|---|
default <A,R> StreamStage<TimestampedItem<R>> |
aggregate(AggregateOperation1<? super T,A,R> aggrOp)
Attaches to this stage a stage that performs the given aggregate
operation over all the items that belong to a given window.
|
<A,R,OUT> StreamStage<OUT> |
aggregate(AggregateOperation1<? super T,A,R> aggrOp,
WindowResultFunction<? super R,? extends OUT> mapToOutputFn)
Attaches to this stage a stage that performs the given aggregate operation
over all the items that belong to a given window.
|
default <T1,A,R> StreamStage<TimestampedItem<R>> |
aggregate2(StreamStage<T1> stage1,
AggregateOperation2<? super T,? super T1,A,R> aggrOp)
Attaches to this stage a stage that performs the given aggregate
operation over all the items that belong to the same window.
|
<T1,A,R,OUT> |
aggregate2(StreamStage<T1> stage1,
AggregateOperation2<? super T,? super T1,A,R> aggrOp,
WindowResultFunction<? super R,? extends OUT> mapToOutputFn)
Attaches to this stage a stage that performs the given aggregate
operation over all the items that belong to the same window.
|
default <T1,T2,A,R> |
aggregate3(StreamStage<T1> stage1,
StreamStage<T2> stage2,
AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp)
Attaches to this stage a stage that performs the given aggregate
operation over the items it receives from this stage as well as
stage1 and stage2 you supply. |
<T1,T2,A,R,OUT> |
aggregate3(StreamStage<T1> stage1,
StreamStage<T2> stage2,
AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp,
WindowResultFunction<? super R,? extends OUT> mapToOutputFn)
Attaches to this stage a stage that performs the given aggregate
operation over the items it receives from this stage as well as
stage1 and stage2 you supply. |
default WindowAggregateBuilder<T> |
aggregateBuilder()
Returns a fluent API builder object to construct an windowed aggregating
stage with any number of contributing stages.
|
<K> StageWithGroupingAndWindow<T,K> |
groupingKey(DistributedFunction<? super T,? extends K> keyFn)
Specifes the function that will extract the grouping key from the
items in the associated pipeline stage and moves on to the step in
which you'll complete the construction of a windowed group-and-aggregate
stage.
|
StreamStage<T> |
streamStage()
Returns the pipeline stage associated with this object.
|
WindowDefinition |
windowDefinition()
Returns the definition of the window for the windowed aggregation
operation that you are about to construct using this object.
|
@Nonnull StreamStage<T> streamStage()
@Nonnull WindowDefinition windowDefinition()
@Nonnull <K> StageWithGroupingAndWindow<T,K> groupingKey(@Nonnull DistributedFunction<? super T,? extends K> keyFn)
K - type of the keykeyFn - function that extracts the grouping key@Nonnull <A,R,OUT> StreamStage<OUT> aggregate(@Nonnull AggregateOperation1<? super T,A,R> aggrOp, @Nonnull WindowResultFunction<? super R,? extends OUT> mapToOutputFn)
mapToOutputFn with the result of the aggregate
operation and emits its return value as the window result.A - the type of the accumulator used by the aggregate operationR - the type of the resultaggrOp - the aggregate operation to performmapToOutputFn - the function that creates the output itemAggregateOperations@Nonnull default <A,R> StreamStage<TimestampedItem<R>> aggregate(@Nonnull AggregateOperation1<? super T,A,R> aggrOp)
TimestampedItem with the result
of the aggregate operation and the timestamp denoting the window's
ending time.A - the type of the accumulator used by the aggregate operationR - the type of the resultaggrOp - the aggregate operation to performAggregateOperations@Nonnull <T1,A,R,OUT> StreamStage<OUT> aggregate2(@Nonnull StreamStage<T1> stage1, @Nonnull AggregateOperation2<? super T,? super T1,A,R> aggrOp, @Nonnull WindowResultFunction<? super R,? extends OUT> mapToOutputFn)
stage1. Once a given window
is complete, it invokes mapToOutputFn with the result of the
aggregate operation and emits its return value as the window result.
The aggregate operation must specify a separate accumulator function for
each of the two streams (refer to its Javadoc for a simple example).
The aggregating stage emits a single item for each completed window.
T1 - type of items in stage1A - type of the accumulator used by the aggregate operationR - type of the resultaggrOp - the aggregate operation to performmapToOutputFn - the function that creates the output itemAggregateOperations@Nonnull default <T1,A,R> StreamStage<TimestampedItem<R>> aggregate2(@Nonnull StreamStage<T1> stage1, @Nonnull AggregateOperation2<? super T,? super T1,A,R> aggrOp)
stage1. Once a given window
is complete, it emits a TimestampedItem with the result
of the aggregate operation and the timestamp denoting the window's
ending time.
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 resultaggrOp - the aggregate operation to performAggregateOperations@Nonnull <T1,T2,A,R,OUT> StreamStage<OUT> aggregate3(@Nonnull StreamStage<T1> stage1, @Nonnull StreamStage<T2> stage2, @Nonnull AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp, @Nonnull WindowResultFunction<? super R,? extends OUT> mapToOutputFn)
stage1 and stage2 you supply. Once a given window
is complete, it invokes mapToOutputFn with the result of the
aggregate operation and emits its return value as the window result.
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 resultaggrOp - the aggregate operation to performAggregateOperations@Nonnull default <T1,T2,A,R> StreamStage<TimestampedItem<R>> aggregate3(@Nonnull StreamStage<T1> stage1, @Nonnull StreamStage<T2> stage2, @Nonnull AggregateOperation3<? super T,? super T1,? super T2,A,R> aggrOp)
stage1 and stage2 you supply. Once a given window
is complete, it emits a TimestampedItem with the result
of the aggregate operation and the timestamp denoting the window's
ending time.
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 resultaggrOp - the aggregate operation to performAggregateOperations@Nonnull default WindowAggregateBuilder<T> aggregateBuilder()
stage.aggregateN(...) calls because they offer more
static type safety.Copyright © 2018 Hazelcast, Inc.. All rights reserved.