public interface WindowLifecycleListener<T>
A callback for expiry, activation of events tracked by the WindowManager
.
Modifier and Type | Method and Description |
---|---|
default void |
onActivation(List<T> events,
List<T> newEvents,
List<T> expired,
Long referenceTime)
Called on activation of the window due to the
TriggerPolicy . |
default void |
onActivation(Supplier<Iterator<T>> eventsIt,
Supplier<Iterator<T>> newEventsIt,
Supplier<Iterator<T>> expiredIt,
Long referenceTime)
Called on activation of the window due to the
TriggerPolicy . |
void |
onExpiry(List<T> events)
Called on expiry of events from the window due to
EvictionPolicy . |
void onExpiry(List<T> events)
Called on expiry of events from the window due to EvictionPolicy
.
events
- the expired eventsdefault void onActivation(List<T> events, List<T> newEvents, List<T> expired, Long referenceTime)
Called on activation of the window due to the 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(Supplier<Iterator<T>> eventsIt, Supplier<Iterator<T>> newEventsIt, Supplier<Iterator<T>> expiredIt, Long referenceTime)
Called on activation of the window due to the 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 activationCopyright © 2019 The Apache Software Foundation. All rights reserved.