Class RedisStateUpdater
- java.lang.Object
-
- org.apache.storm.trident.operation.BaseOperation
-
- org.apache.storm.trident.state.BaseStateUpdater<T>
-
- org.apache.storm.redis.trident.state.AbstractRedisStateUpdater<RedisState>
-
- org.apache.storm.redis.trident.state.RedisStateUpdater
-
- All Implemented Interfaces:
Serializable,Operation,StateUpdater<RedisState>
public class RedisStateUpdater extends AbstractRedisStateUpdater<RedisState>
BaseStateUpdater implementation for single Redis environment.- See Also:
AbstractRedisStateUpdater, Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.storm.redis.trident.state.AbstractRedisStateUpdater
additionalKey, dataType, expireIntervalSec
-
-
Constructor Summary
Constructors Constructor Description RedisStateUpdater(RedisStoreMapper storeMapper)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidupdateStatesToRedis(RedisState redisState, Map<String,String> keyToValue)Updates (key, value) pairs to Redis.RedisStateUpdaterwithExpire(int expireIntervalSec)Sets expire (time to live) if needed.-
Methods inherited from class org.apache.storm.redis.trident.state.AbstractRedisStateUpdater
setExpireInterval, updateState
-
Methods inherited from class org.apache.storm.trident.operation.BaseOperation
cleanup, prepare
-
-
-
-
Constructor Detail
-
RedisStateUpdater
public RedisStateUpdater(RedisStoreMapper storeMapper)
Constructor.- Parameters:
storeMapper- mapper for storing
-
-
Method Detail
-
withExpire
public RedisStateUpdater withExpire(int expireIntervalSec)
Sets expire (time to live) if needed.- Parameters:
expireIntervalSec- time to live in seconds- Returns:
- RedisStateUpdater itself
-
updateStatesToRedis
protected void updateStatesToRedis(RedisState redisState, Map<String,String> keyToValue)
Updates (key, value) pairs to Redis.- Specified by:
updateStatesToRedisin classAbstractRedisStateUpdater<RedisState>- Parameters:
redisState- State for handling querykeyToValue- (key, value) pairs
-
-