public class TWindowImpl<T,K> extends AbstractTWindow<T,K>
Modifier and Type | Method and Description |
---|---|
<U> TStream<U> |
aggregate(BiFunction<java.util.List<T>,K,U> processor)
Declares a stream that is a continuous, sliding, aggregation of
partitions in this window.
|
<U> TStream<U> |
batch(BiFunction<java.util.List<T>,K,U> batcher)
Declares a stream that represents a batched aggregation of
partitions in this window.
|
int |
getSize() |
feeder, getKeyFunction, topology
public <U> TStream<U> aggregate(BiFunction<java.util.List<T>,K,U> processor)
TWindow
Changes in a partition's contents trigger an invocation of
aggregator.apply(tuples, key)
, where tuples
is
a List<T>
containing all the tuples in the partition in
insertion order from oldest to newest. The list is stable
during the aggregator invocation.
aggregator
result is added to the returned stream.
Thus the returned stream will contain a sequence of tuples where the most recent tuple represents the most up to date aggregation of a partition.
U
- Tuple typeprocessor
- Logic to aggregation a partition.public <U> TStream<U> batch(BiFunction<java.util.List<T>,K,U> batcher)
TWindow
Each partition "batch" triggers an invocation of
batcher.apply(tuples, key)
, where tuples
is
a List<T>
containing all the tuples in the partition in
insertion order from oldest to newest The list is stable
during the batcher invocation.
batcher
result is added to the returned stream.
The partition's contents are cleared after a batch is processed.
Thus the returned stream will contain a sequence of tuples where the most recent tuple represents the most up to date aggregation of a partition.
U
- Tuple typebatcher
- Logic to aggregation a partition.public int getSize()
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641