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.Modifier and Type | Field and Description |
---|---|
protected String |
additionalKey |
protected RedisDataTypeDescription.RedisDataType |
dataType |
Constructor and Description |
---|
AbstractRedisStateQuerier(RedisLookupMapper lookupMapper)
Constructor.
|
Modifier and Type | Method and 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.
|
cleanup, prepare
protected final RedisDataTypeDescription.RedisDataType dataType
protected final String additionalKey
public AbstractRedisStateQuerier(RedisLookupMapper lookupMapper)
Constructor.
lookupMapper
- mapper for queryingpublic 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.
state
- State for handling querykeys
- keys having state valuesCopyright © 2022 The Apache Software Foundation. All rights reserved.