Package org.apache.storm.windowing
Class StatefulWindowManager<T>
java.lang.Object
org.apache.storm.windowing.WindowManager<T>
org.apache.storm.windowing.StatefulWindowManager<T>
- All Implemented Interfaces:
- TriggerHandler
Window manager that handles windows with state persistence.
- 
Field SummaryFields inherited from class org.apache.storm.windowing.WindowManagerevictionPolicy, EXPIRE_EVENTS_THRESHOLD, queue, triggerPolicy, windowLifecycleListener
- 
Constructor SummaryConstructorsConstructorDescriptionStatefulWindowManager(WindowLifecycleListener<T> lifecycleListener) StatefulWindowManager(WindowLifecycleListener<T> lifecycleListener, Collection<Event<T>> queue) Constructs aStatefulWindowManager.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidexpires events that fall out of the window every EXPIRE_EVENTS_THRESHOLD so that the window does not grow too big.booleanThe callback invoked by the trigger policy.Methods inherited from class org.apache.storm.windowing.WindowManageradd, add, add, getEarliestEventTs, getEventCount, getSlidingCountTimestamps, getState, restoreState, setEvictionPolicy, setTriggerPolicy, shutdown, toString
- 
Constructor Details- 
StatefulWindowManager
- 
StatefulWindowManagerpublic StatefulWindowManager(WindowLifecycleListener<T> lifecycleListener, Collection<Event<T>> queue) Constructs aStatefulWindowManager.- Parameters:
- lifecycleListener- the- WindowLifecycleListener
- queue- a collection where the events in the window can be enqueued.
 Note: This collection has to be thread safe.
 
 
- 
- 
Method Details- 
compactWindowprotected void compactWindow()Description copied from class:WindowManagerexpires events that fall out of the window every EXPIRE_EVENTS_THRESHOLD so that the window does not grow too big.- Overrides:
- compactWindowin class- WindowManager<T>
 
- 
onTriggerpublic boolean onTrigger()Description copied from class:WindowManagerThe callback invoked by the trigger policy.- Specified by:
- onTriggerin interface- TriggerHandler
- Overrides:
- onTriggerin class- WindowManager<T>
- Returns:
- true if the window was evaluated with at least one event in the window, false otherwise
 
 
-