Class AbstractRedisStateQuerier<T extends State>

Type Parameters:
T - type of State
All Implemented Interfaces:
Serializable, EachOperation, Operation, QueryFunction<T,List<Values>>
Direct Known Subclasses:
RedisClusterStateQuerier, RedisStateQuerier

public abstract class AbstractRedisStateQuerier<T extends State> extends BaseQueryFunction<T,List<Values>>
AbstractRedisStateQuerier is base class of any RedisStateQuerier, which implements BaseQueryFunction.

Derived classes should provide how to retrieve values from Redis, and AbstractRedisStateQuerier takes care of rest things.

See Also:
  • Field Details

  • Constructor Details

    • AbstractRedisStateQuerier

      public AbstractRedisStateQuerier(RedisLookupMapper lookupMapper)
      Constructor.
      Parameters:
      lookupMapper - mapper for querying
  • Method Details

    • batchRetrieve

      public List<List<Values>> batchRetrieve(T state, List<TridentTuple> inputs)
    • execute

      public void execute(TridentTuple tuple, List<Values> values, TridentCollector collector)
    • retrieveValuesFromRedis

      protected abstract List<String> retrieveValuesFromRedis(T state, List<String> keys)
      Retrieves values from Redis that each value is corresponding to each key.
      Parameters:
      state - State for handling query
      keys - keys having state values
      Returns:
      values which are corresponding to keys