Package org.apache.storm.redis.trident.state

# Class AbstractRedisStateQuerier<T extends State>

java.lang.Object
org.apache.storm.trident.operation.BaseOperation
org.apache.storm.trident.state.BaseQueryFunction<T,List<Values>>
org.apache.storm.redis.trident.state.AbstractRedisStateQuerier<T>

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:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final String`
  `additionalKey`
  `protected final RedisDataTypeDescription.RedisDataType`
  `dataType`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractRedisStateQuerier(RedisLookupMapper lookupMapper)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<List<Values>>`
  `batchRetrieve(T state, List<TridentTuple> inputs)`
  `void`
  `execute(TridentTuple tuple, List<Values> values, TridentCollector collector)`
  `protected abstract List<String>`
  `retrieveValuesFromRedis(T state, List<String> keys)`
  Retrieves values from Redis that each value is corresponding to each key.

  ### Methods inherited from class org.apache.storm.trident.operation.BaseOperation

  `cleanup, prepare`

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

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

  ### Methods inherited from interface org.apache.storm.trident.operation.Operation

  `cleanup, prepare`

- ## Field Details

  - ### dataType

    protected final RedisDataTypeDescription.RedisDataType dataType

  - ### additionalKey

    protected final String additionalKey

- ## 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