Class AbstractRedisMapState<T>
java.lang.Object
org.apache.storm.redis.trident.state.AbstractRedisMapState<T>
- Type Parameters:
T
- value's type class
- All Implemented Interfaces:
IBackingMap<T>
- Direct Known Subclasses:
RedisClusterMapState
,RedisMapState
AbstractRedisMapState is base class of any RedisMapState, which implements IBackingMap.
Derived classes should provide
- which Serializer it uses
- which KeyFactory it uses
- how to retrieve values from Redis
- how to store values to Redis
and AbstractRedisMapState takes care of rest things.
- which Serializer it uses
- which KeyFactory it uses
- how to retrieve values from Redis
- how to store values to Redis
and AbstractRedisMapState takes care of rest things.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract KeyFactory
Returns KeyFactory which is used for converting state key -> Redis key.protected abstract Serializer
Returns Serializer which is used for serializing tuple value and deserializing Redis value.void
retrieveValuesFromRedis
(List<String> keys) Retrieves values from Redis that each value is corresponding to each key.protected abstract void
updateStatesToRedis
(Map<String, String> keyValues) Updates (key, value) pairs to Redis.
-
Field Details
-
DEFAULT_SERIALIZERS
-
-
Constructor Details
-
AbstractRedisMapState
public AbstractRedisMapState()
-
-
Method Details
-
multiGet
- Specified by:
multiGet
in interfaceIBackingMap<T>
-
multiPut
- Specified by:
multiPut
in interfaceIBackingMap<T>
-
getSerializer
Returns Serializer which is used for serializing tuple value and deserializing Redis value.- Returns:
- serializer
-
getKeyFactory
Returns KeyFactory which is used for converting state key -> Redis key.- Returns:
- key factory
-
retrieveValuesFromRedis
Retrieves values from Redis that each value is corresponding to each key.- Parameters:
keys
- keys having state values- Returns:
- values which are corresponding to keys
-
updateStatesToRedis
Updates (key, value) pairs to Redis.- Parameters:
keyValues
- (key, value) pairs
-