T
- the type of event that this window contains. E.g. Tuple
public interface Window<T>
Modifier and Type | Method and Description |
---|---|
java.util.List<T> |
get()
Gets the list of events in the window.
|
java.lang.Long |
getEndTimestamp()
If processing based on event time, returns the window end time based on watermark otherwise returns the window end time based on
processing time.
|
java.util.List<T> |
getExpired()
Get the list of events expired from the window since the last time the window was generated.
|
default java.util.Iterator<T> |
getIter()
Returns an iterator over the events in the window.
|
java.util.List<T> |
getNew()
Get the list of newly added events in the window since the last time the window was generated.
|
java.lang.Long |
getStartTimestamp()
Returns the window start timestamp.
|
java.util.List<T> get()
Note: If the number of tuples in windows is huge, invoking get
would
load all the tuples into memory and may throw an OOM exception. Use windowing with persistence (BaseStatefulWindowedBolt.withPersistence()
) and getIter()
to retrieve an iterator over the events in the window.
default java.util.Iterator<T> getIter()
Note: This is only supported when using windowing with persistence BaseStatefulWindowedBolt.withPersistence()
.
Iterator
over the events in the current window.java.lang.UnsupportedOperationException
- if not using BaseStatefulWindowedBolt.withPersistence()
java.util.List<T> getNew()
Note: This is not supported when using windowing with persistence (BaseStatefulWindowedBolt.withPersistence()
).
java.lang.UnsupportedOperationException
- if using BaseStatefulWindowedBolt.withPersistence()
java.util.List<T> getExpired()
Note: This is not supported when using windowing with persistence (BaseStatefulWindowedBolt.withPersistence()
).
java.lang.UnsupportedOperationException
- if using BaseStatefulWindowedBolt.withPersistence()
java.lang.Long getEndTimestamp()
java.lang.Long getStartTimestamp()