public interface EvictionPolicy<T>
Eviction policy tracks events and decides whether an event should be evicted from the window or not.
Modifier and Type | Interface and Description |
---|---|
static class |
EvictionPolicy.Action
The action to be taken when
evict(Event) is invoked. |
Modifier and Type | Method and Description |
---|---|
EvictionPolicy.Action |
evict(org.apache.storm.windowing.Event<T> event)
Decides if an event should be expired from the window, processed in the current window or kept for later processing.
|
void |
setContext(EvictionContext context)
Sets a context in the eviction policy that can be used while evicting the events.
|
void |
track(org.apache.storm.windowing.Event<T> event)
Tracks the event to later decide whether
evict(Event) should evict it or not. |
EvictionPolicy.Action evict(org.apache.storm.windowing.Event<T> event)
Decides if an event should be expired from the window, processed in the current window or kept for later processing.
event
- the input eventEvictionPolicy.Action
to be taken based on the input eventvoid track(org.apache.storm.windowing.Event<T> event)
Tracks the event to later decide whether evict(Event)
should evict it or not.
event
- the input event to be trackedvoid setContext(EvictionContext context)
Sets a context in the eviction policy that can be used while evicting the events. E.g. For TimeEvictionPolicy, this could be used to set the reference timestamp.
context
- Copyright © 2019 The Apache Software Foundation. All Rights Reserved.