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.
Modifier and Type | Field and Description |
---|---|
protected Aggregator |
aggregator |
protected BatchOutputCollector |
delegateCollector |
protected Queue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult> |
pendingTriggers |
protected AtomicInteger |
triggerId |
protected WindowManager<T> |
windowManager |
protected WindowsStore |
windowStore |
protected String |
windowTaskId |
Constructor and Description |
---|
AbstractTridentWindowManager(WindowConfig windowConfig,
String windowTaskId,
WindowsStore windowStore,
Aggregator aggregator,
BatchOutputCollector delegateCollector) |
Modifier and Type | Method and Description |
---|---|
Queue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult> |
getPendingTriggers()
Returns pending triggers to be emitted.
|
protected abstract List<TridentTuple> |
getTridentTuples(List<T> tupleEvents)
Return
TridentTuple s from given tupleEvents . |
protected abstract void |
initialize()
Load and initialize any resources into window manager before windowing for component/task is activated.
|
protected abstract void |
onTuplesExpired(List<T> expiredEvents)
Handle expired tuple events which can be removing from cache or store.
|
void |
prepare()
This is invoked from
org.apache.storm.trident.planner.TridentProcessor ’s prepare method. |
void |
shutdown()
This is invoked when from
org.apache.storm.trident.planner.TridentProcessor ’s cleanup method. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTuplesBatch
protected final WindowManager<T> windowManager
protected final Aggregator aggregator
protected final BatchOutputCollector delegateCollector
protected final String windowTaskId
protected final WindowsStore windowStore
protected final Queue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult> pendingTriggers
protected final AtomicInteger triggerId
public AbstractTridentWindowManager(WindowConfig windowConfig, String windowTaskId, WindowsStore windowStore, Aggregator aggregator, BatchOutputCollector delegateCollector)
public void prepare()
ITridentWindowManager
This is invoked from org.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.
prepare
in interface ITridentWindowManager
protected abstract void initialize()
Load and initialize any resources into window manager before windowing for component/task is activated.
protected abstract void onTuplesExpired(List<T> expiredEvents)
Handle expired tuple events which can be removing from cache or store.
protected abstract List<TridentTuple> getTridentTuples(List<T> tupleEvents)
Return TridentTuple
s from given tupleEvents
.
public Queue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult> getPendingTriggers()
ITridentWindowManager
Returns pending triggers to be emitted.
getPendingTriggers
in interface ITridentWindowManager
public void shutdown()
ITridentWindowManager
This is invoked when from org.apache.storm.trident.planner.TridentProcessor
’s cleanup method. So, any cleanup operations like clearing cache or close store connection etc can be done.
shutdown
in interface ITridentWindowManager
Copyright © 2022 The Apache Software Foundation. All rights reserved.