public interface Window<T>
A view of events in a sliding window.
Modifier and Type | Method and Description |
---|---|
List<T> |
get()
Gets the list of events in the window.
|
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.
|
List<T> |
getExpired()
Get the list of events expired from the window since the last time the window was generated.
|
default Iterator<T> |
getIter()
Returns an iterator over the events in the window.
|
List<T> |
getNew()
Get the list of newly added events in the window since the last time the window was generated.
|
Long |
getStartTimestamp()
Returns the window start timestamp.
|
List<T> get()
Gets the list of events in the window.
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 Iterator<T> getIter()
Returns an iterator over the events in the window.
Note: This is only supported when using windowing with persistence BaseStatefulWindowedBolt.withPersistence()
.
Iterator
over the events in the current window.UnsupportedOperationException
- if not using BaseStatefulWindowedBolt.withPersistence()
List<T> getNew()
Get the list of newly added events in the window since the last time the window was generated.
Note: This is not supported when using windowing with persistence (BaseStatefulWindowedBolt.withPersistence()
).
UnsupportedOperationException
- if using BaseStatefulWindowedBolt.withPersistence()
List<T> getExpired()
Get the list of events expired from the window since the last time the window was generated.
Note: This is not supported when using windowing with persistence (BaseStatefulWindowedBolt.withPersistence()
).
UnsupportedOperationException
- if using BaseStatefulWindowedBolt.withPersistence()
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.
Long getStartTimestamp()
Returns the window start timestamp. Will return null if the window length is not based on time duration.
Copyright © 2019 The Apache Software Foundation. All rights reserved.