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 SummaryFieldsModifier and TypeFieldDescriptionprotected final Stringprotected final RedisDataTypeDescription.RedisDataTypeprotected int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.BaseOperationcleanup, prepare
- 
Field Details- 
dataType
- 
additionalKey
- 
expireIntervalSecprotected int expireIntervalSec
 
- 
- 
Constructor Details- 
AbstractRedisStateUpdaterConstructor.- Parameters:
- storeMapper- mapper for storing
 
 
- 
- 
Method Details- 
setExpireIntervalpublic void setExpireInterval(int expireIntervalSec) Sets expire (time to live) if needed.- Parameters:
- expireIntervalSec- time to live in seconds
 
- 
updateState
- 
updateStatesToRedisUpdates (key, value) pairs to Redis.- Parameters:
- state- State for handling query
- keyToValue- (key, value) pairs
 
 
-