Package org.apache.storm.trident.windowing

# Class StoreBasedTridentWindowManager

java.lang.Object
org.apache.storm.trident.windowing.AbstractTridentWindowManager<TridentBatchTuple>
org.apache.storm.trident.windowing.StoreBasedTridentWindowManager

All Implemented Interfaces:
  `ITridentWindowManager`

public class StoreBasedTridentWindowManager extends AbstractTridentWindowManager<TridentBatchTuple>
This window manager uses `WindowsStore` for storing tuples and other trigger related information. It maintains tuples cache of `maxCachedTuplesSize` without accessing store for getting them.

- ## Field Summary

  ### Fields inherited from class org.apache.storm.trident.windowing.AbstractTridentWindowManager

  `aggregator, delegateCollector, pendingTriggers, triggerId, windowManager, windowStore, windowTaskId`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StoreBasedTridentWindowManager(WindowConfig windowConfig, String windowTaskId, WindowsStore windowStore, Aggregator aggregator, BatchOutputCollector delegateCollector, Long maxTuplesCacheSize, Fields inputFields)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addTuplesBatch(Object batchId, List<TridentTuple> tuples)`
  Add received batch of tuples to cache/store and add them to `WindowManager`.
  `TridentTuple`
  `collectTridentTupleOrKey(TridentBatchTuple tridentBatchTuple, List<String> keys)`
  `String`
  `getBatchTxnId(Object batchId)`
  `List<TridentTuple>`
  `getTridentTuples(List<TridentBatchTuple> tridentBatchTuples)`
  Return `TridentTuple`s from given `tupleEvents`.
  `protected void`
  `initialize()`
  Load and initialize any resources into window manager before windowing for component/task is activated.
  `String`
  `keyOf(Object batchId)`
  `void`
  `onTuplesExpired(List<TridentBatchTuple> expiredTuples)`
  Handle expired tuple events which can be removing from cache or store.

  ### Methods inherited from class org.apache.storm.trident.windowing.AbstractTridentWindowManager

  `getPendingTriggers, prepare, shutdown`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### StoreBasedTridentWindowManager

    public StoreBasedTridentWindowManager(WindowConfig windowConfig, String windowTaskId, WindowsStore windowStore, Aggregator aggregator, BatchOutputCollector delegateCollector, Long maxTuplesCacheSize, Fields inputFields)

- ## Method Details

  - ### initialize

    protected void initialize()
    Description copied from class: `AbstractTridentWindowManager`
    Load and initialize any resources into window manager before windowing for component/task is activated.
    Specified by:
      `initialize` in class `AbstractTridentWindowManager<TridentBatchTuple>`

  - ### addTuplesBatch

    public void addTuplesBatch(Object batchId, List<TridentTuple> tuples)
    Description copied from interface: `ITridentWindowManager`
    Add received batch of tuples to cache/store and add them to `WindowManager`.

  - ### getBatchTxnId

    public String getBatchTxnId(Object batchId)

  - ### keyOf

    public String keyOf(Object batchId)

  - ### getTridentTuples

    public List<TridentTuple> getTridentTuples(List<TridentBatchTuple> tridentBatchTuples)
    Description copied from class: `AbstractTridentWindowManager`
    Return `TridentTuple`s from given `tupleEvents`.
    Specified by:
      `getTridentTuples` in class `AbstractTridentWindowManager<TridentBatchTuple>`

  - ### collectTridentTupleOrKey

    public TridentTuple collectTridentTupleOrKey(TridentBatchTuple tridentBatchTuple, List<String> keys)

  - ### onTuplesExpired

    public void onTuplesExpired(List<TridentBatchTuple> expiredTuples)
    Description copied from class: `AbstractTridentWindowManager`
    Handle expired tuple events which can be removing from cache or store.
    Specified by:
      `onTuplesExpired` in class `AbstractTridentWindowManager<TridentBatchTuple>`