T
- The type of Event in the window (e.g. Tuple).public interface WindowLifecycleListener<T>
WindowManager
Modifier and Type | Method and Description |
---|---|
default void |
onActivation(java.util.List<T> events,
java.util.List<T> newEvents,
java.util.List<T> expired,
java.lang.Long referenceTime)
Called on activation of the window due to the
TriggerPolicy |
default void |
onActivation(java.util.function.Supplier<java.util.Iterator<T>> eventsIt,
java.util.function.Supplier<java.util.Iterator<T>> newEventsIt,
java.util.function.Supplier<java.util.Iterator<T>> expiredIt,
java.lang.Long referenceTime)
Called on activation of the window due to the
TriggerPolicy . |
void |
onExpiry(java.util.List<T> events)
Called on expiry of events from the window due to
EvictionPolicy |
void onExpiry(java.util.List<T> events)
EvictionPolicy
events
- the expired eventsdefault void onActivation(java.util.List<T> events, java.util.List<T> newEvents, java.util.List<T> expired, java.lang.Long referenceTime)
TriggerPolicy
events
- the list of current events in the window.newEvents
- the newly added events since last activation.expired
- the expired events since last activation.referenceTime
- the reference (event or processing) time that resulted in activationdefault void onActivation(java.util.function.Supplier<java.util.Iterator<T>> eventsIt, java.util.function.Supplier<java.util.Iterator<T>> newEventsIt, java.util.function.Supplier<java.util.Iterator<T>> expiredIt, java.lang.Long referenceTime)
TriggerPolicy
. This is typically invoked when the windows are persisted in
state and is huge to be loaded entirely in memory.eventsIt
- a supplier of iterator over the list of current events in the windownewEventsIt
- a supplier of iterator over the newly added events since the last ativationexpiredIt
- a supplier of iterator over the expired events since the last activationreferenceTime
- the reference (event or processing) time that resulted in activation