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
Modifier and TypeFieldDescriptionprotected final String
protected final RedisDataTypeDescription.RedisDataType
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setExpireInterval
(int expireIntervalSec) Sets expire (time to live) if needed.void
updateState
(T state, List<TridentTuple> inputs, TridentCollector collector) protected abstract void
updateStatesToRedis
(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
-