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 Details

    • windowManager

      protected final WindowManager<T> windowManager
    • aggregator

      protected final Aggregator aggregator
    • delegateCollector

      protected final BatchOutputCollector delegateCollector
    • windowTaskId

      protected final String windowTaskId
    • windowStore

      protected final WindowsStore windowStore
    • pendingTriggers

      protected final Queue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult> pendingTriggers
    • triggerId

      protected final AtomicInteger triggerId
  • Constructor Details

  • Method Details

    • prepare

      public void prepare()
      Description copied from interface: 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.
      Specified by:
      prepare in interface ITridentWindowManager
    • initialize

      protected abstract void initialize()
      Load and initialize any resources into window manager before windowing for component/task is activated.
    • onTuplesExpired

      protected abstract void onTuplesExpired(List<T> expiredEvents)
      Handle expired tuple events which can be removing from cache or store.
    • getTridentTuples

      protected abstract List<TridentTuple> getTridentTuples(List<T> tupleEvents)
      Return TridentTuples from given tupleEvents.
    • getPendingTriggers

      public Queue<org.apache.storm.trident.windowing.AbstractTridentWindowManager.TriggerResult> getPendingTriggers()
      Description copied from interface: ITridentWindowManager
      Returns pending triggers to be emitted.
      Specified by:
      getPendingTriggers in interface ITridentWindowManager
    • shutdown

      public void shutdown()
      Description copied from interface: 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.
      Specified by:
      shutdown in interface ITridentWindowManager