Class AbstractTridentWindowManager<T>
java.lang.Object
org.apache.storm.trident.windowing.AbstractTridentWindowManager<T>
- All Implemented Interfaces:
- ITridentWindowManager
- Direct Known Subclasses:
- InMemoryTridentWindowManager,- StoreBasedTridentWindowManager
public abstract class AbstractTridentWindowManager<T>
extends Object
implements ITridentWindowManager
Basic functionality to manage trident tuple events using 
WindowManager and WindowsStore for storing tuples and triggers
 related information.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Aggregatorprotected final BatchOutputCollectorprotected final Queue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult>protected final AtomicIntegerprotected final WindowManager<T>protected final WindowsStoreprotected final String
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractTridentWindowManager(WindowConfig windowConfig, String windowTaskId, WindowsStore windowStore, Aggregator aggregator, BatchOutputCollector delegateCollector) 
- 
Method SummaryModifier and TypeMethodDescriptionQueue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult>Returns pending triggers to be emitted.protected abstract List<TridentTuple>getTridentTuples(List<T> tupleEvents) ReturnTridentTuples from giventupleEvents.protected abstract voidLoad and initialize any resources into window manager before windowing for component/task is activated.protected abstract voidonTuplesExpired(List<T> expiredEvents) Handle expired tuple events which can be removing from cache or store.voidprepare()This is invoked fromorg.apache.storm.trident.planner.TridentProcessor's prepare method.voidshutdown()This is invoked when fromorg.apache.storm.trident.planner.TridentProcessor's cleanup method.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.storm.trident.windowing.ITridentWindowManageraddTuplesBatch
- 
Field Details- 
windowManager
- 
aggregator
- 
delegateCollector
- 
windowTaskId
- 
windowStore
- 
pendingTriggersprotected final Queue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult> pendingTriggers
- 
triggerId
 
- 
- 
Constructor Details- 
AbstractTridentWindowManagerpublic AbstractTridentWindowManager(WindowConfig windowConfig, String windowTaskId, WindowsStore windowStore, Aggregator aggregator, BatchOutputCollector delegateCollector) 
 
- 
- 
Method Details- 
preparepublic void prepare()Description copied from interface:ITridentWindowManagerThis is invoked fromorg.apache.storm.trident.planner.TridentProcessor's prepare method. So any initialization tasks can be done before the topology starts accepting tuples. For ex: initialize window manager with any earlier stored tuples/triggers and start WindowManager.- Specified by:
- preparein interface- ITridentWindowManager
 
- 
initializeprotected abstract void initialize()Load and initialize any resources into window manager before windowing for component/task is activated.
- 
onTuplesExpiredHandle expired tuple events which can be removing from cache or store.
- 
getTridentTuplesReturnTridentTuples from giventupleEvents.
- 
getPendingTriggerspublic Queue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult> getPendingTriggers()Description copied from interface:ITridentWindowManagerReturns pending triggers to be emitted.- Specified by:
- getPendingTriggersin interface- ITridentWindowManager
 
- 
shutdownpublic void shutdown()Description copied from interface:ITridentWindowManagerThis is invoked when fromorg.apache.storm.trident.planner.TridentProcessor's cleanup method. So, any cleanup operations like clearing cache or close store connection etc can be done.- Specified by:
- shutdownin interface- ITridentWindowManager
 
 
-