Class AbstractRedisStateUpdater<T extends State>

Type Parameters:
T - type of State
All Implemented Interfaces:
Serializable, Operation, StateUpdater<T>
Direct Known Subclasses:
RedisClusterStateUpdater, RedisStateUpdater

public abstract class AbstractRedisStateUpdater<T extends State> extends BaseStateUpdater<T>
AbstractRedisStateUpdater is base class of any RedisStateUpdater, which implements BaseStateUpdater.

Derived classes should provide how to update (key, value) pairs to Redis, and AbstractRedisStateUpdater takes care of rest things.

See Also:
  • Field Details

  • Constructor Details

    • AbstractRedisStateUpdater

      public AbstractRedisStateUpdater(RedisStoreMapper storeMapper)
      Constructor.
      Parameters:
      storeMapper - mapper for storing
  • Method Details

    • setExpireInterval

      public void setExpireInterval(int expireIntervalSec)
      Sets expire (time to live) if needed.
      Parameters:
      expireIntervalSec - time to live in seconds
    • updateState

      public void updateState(T state, List<TridentTuple> inputs, TridentCollector collector)
    • updateStatesToRedis

      protected abstract void updateStatesToRedis(T state, Map<String,String> keyToValue)
      Updates (key, value) pairs to Redis.
      Parameters:
      state - State for handling query
      keyToValue - (key, value) pairs