Class AbstractRedisStateUpdater<T extends State>
java.lang.Object
org.apache.storm.trident.operation.BaseOperation
org.apache.storm.trident.state.BaseStateUpdater<T>
org.apache.storm.redis.trident.state.AbstractRedisStateUpdater<T>
- Type Parameters:
T- type of State
- All Implemented Interfaces:
Serializable,Operation,StateUpdater<T>
- Direct Known Subclasses:
RedisClusterStateUpdater,RedisStateUpdater
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final RedisDataTypeDescription.RedisDataTypeprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetExpireInterval(int expireIntervalSec) Sets expire (time to live) if needed.voidupdateState(T state, List<TridentTuple> inputs, TridentCollector collector) protected abstract voidupdateStatesToRedis(T state, Map<String, String> keyToValue) Updates (key, value) pairs to Redis.Methods inherited from class org.apache.storm.trident.operation.BaseOperation
cleanup, prepare
-
Field Details
-
dataType
-
additionalKey
-
expireIntervalSec
protected int expireIntervalSec
-
-
Constructor Details
-
AbstractRedisStateUpdater
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
-
updateStatesToRedis
Updates (key, value) pairs to Redis.- Parameters:
state- State for handling querykeyToValue- (key, value) pairs
-