public class TWindowTimeImpl<T,K> extends AbstractTWindow<T,K>
Modifier and Type | Method and Description |
---|---|
<U> TStream<U> |
aggregate(BiFunction<java.util.List<T>,K,U> processor)
Window behaviour here is that:
Tuples are always inserted into the partition.
|
<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.
|
long |
getTime() |
java.util.concurrent.TimeUnit |
getUnit() |
feeder, getKeyFunction, topology
public <U> TStream<U> aggregate(BiFunction<java.util.List<T>,K,U> processor)
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 long getTime()
public java.util.concurrent.TimeUnit getUnit()
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641