public class RedisMapState<T> extends AbstractRedisMapState<T>
IBackingMap implementation for single Redis environment.
AbstractRedisMapState
Modifier and Type | Class and Description |
---|---|
protected static class |
RedisMapState.Factory
RedisMapState.Factory provides single Redis environment version of StateFactory.
|
DEFAULT_SERIALIZERS
Constructor and Description |
---|
RedisMapState(redis.clients.jedis.JedisPool jedisPool,
Options options,
Serializer<T> serializer,
KeyFactory keyFactory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected KeyFactory |
getKeyFactory()
Returns KeyFactory which is used for converting state key -> Redis key.
|
protected Serializer |
getSerializer()
Returns Serializer which is used for serializing tuple value and deserializing Redis value.
|
static StateFactory |
nonTransactional(JedisPoolConfig jedisPoolConfig)
Provides StateFactory for non transactional.
|
static StateFactory |
nonTransactional(JedisPoolConfig jedisPoolConfig,
KeyFactory factory)
Provides StateFactory for non transactional.
|
static StateFactory |
nonTransactional(JedisPoolConfig jedisPoolConfig,
Options<Object> opts)
Provides StateFactory for non transactional.
|
static StateFactory |
nonTransactional(JedisPoolConfig jedisPoolConfig,
RedisDataTypeDescription dataTypeDescription)
Provides StateFactory for non transactional.
|
static StateFactory |
opaque(JedisPoolConfig jedisPoolConfig)
Provides StateFactory for opaque transactional.
|
static StateFactory |
opaque(JedisPoolConfig jedisPoolConfig,
KeyFactory factory)
Provides StateFactory for opaque transactional.
|
static StateFactory |
opaque(JedisPoolConfig jedisPoolConfig,
Options<OpaqueValue> opts)
Provides StateFactory for opaque transactional.
|
static StateFactory |
opaque(JedisPoolConfig jedisPoolConfig,
RedisDataTypeDescription dataTypeDescription)
Provides StateFactory for opaque transactional.
|
protected List<String> |
retrieveValuesFromRedis(List<String> keys)
Retrieves values from Redis that each value is corresponding to each key.
|
static StateFactory |
transactional(JedisPoolConfig jedisPoolConfig)
Provides StateFactory for transactional.
|
static StateFactory |
transactional(JedisPoolConfig jedisPoolConfig,
KeyFactory factory)
Provides StateFactory for transactional.
|
static StateFactory |
transactional(JedisPoolConfig jedisPoolConfig,
Options<TransactionalValue> opts)
Provides StateFactory for transactional.
|
static StateFactory |
transactional(JedisPoolConfig jedisPoolConfig,
RedisDataTypeDescription dataTypeDescription)
Provides StateFactory for transactional.
|
protected void |
updateStatesToRedis(Map<String,String> keyValues)
Updates (key, value) pairs to Redis.
|
multiGet, multiPut
public RedisMapState(redis.clients.jedis.JedisPool jedisPool, Options options, Serializer<T> serializer, KeyFactory keyFactory)
Constructor.
jedisPool
- JedisPooloptions
- options of Stateserializer
- SerializerkeyFactory
- KeyFactorypublic static StateFactory opaque(JedisPoolConfig jedisPoolConfig)
Provides StateFactory for opaque transactional.
jedisPoolConfig
- configuration for JedisPoolpublic static StateFactory opaque(JedisPoolConfig jedisPoolConfig, RedisDataTypeDescription dataTypeDescription)
Provides StateFactory for opaque transactional.
jedisPoolConfig
- configuration for JedisPooldataTypeDescription
- definition of data typepublic static StateFactory opaque(JedisPoolConfig jedisPoolConfig, KeyFactory factory)
Provides StateFactory for opaque transactional.
jedisPoolConfig
- configuration for JedisPoolfactory
- key factorypublic static StateFactory opaque(JedisPoolConfig jedisPoolConfig, Options<OpaqueValue> opts)
Provides StateFactory for opaque transactional.
jedisPoolConfig
- configuration for JedisPoolopts
- options of Statepublic static StateFactory transactional(JedisPoolConfig jedisPoolConfig)
Provides StateFactory for transactional.
jedisPoolConfig
- configuration for JedisPoolpublic static StateFactory transactional(JedisPoolConfig jedisPoolConfig, RedisDataTypeDescription dataTypeDescription)
Provides StateFactory for transactional.
jedisPoolConfig
- configuration for JedisPooldataTypeDescription
- definition of data typepublic static StateFactory transactional(JedisPoolConfig jedisPoolConfig, KeyFactory factory)
Provides StateFactory for transactional.
jedisPoolConfig
- configuration for JedisPoolfactory
- key factorypublic static StateFactory transactional(JedisPoolConfig jedisPoolConfig, Options<TransactionalValue> opts)
Provides StateFactory for transactional.
jedisPoolConfig
- configuration for JedisPoolopts
- options of Statepublic static StateFactory nonTransactional(JedisPoolConfig jedisPoolConfig)
Provides StateFactory for non transactional.
jedisPoolConfig
- configuration for JedisPoolpublic static StateFactory nonTransactional(JedisPoolConfig jedisPoolConfig, RedisDataTypeDescription dataTypeDescription)
Provides StateFactory for non transactional.
jedisPoolConfig
- configuration for JedisPooldataTypeDescription
- definition of data typepublic static StateFactory nonTransactional(JedisPoolConfig jedisPoolConfig, KeyFactory factory)
Provides StateFactory for non transactional.
jedisPoolConfig
- configuration for JedisPoolfactory
- key factorypublic static StateFactory nonTransactional(JedisPoolConfig jedisPoolConfig, Options<Object> opts)
Provides StateFactory for non transactional.
jedisPoolConfig
- configuration for JedisPoolopts
- options of Stateprotected Serializer getSerializer()
Returns Serializer which is used for serializing tuple value and deserializing Redis value.
getSerializer
in class AbstractRedisMapState<T>
protected KeyFactory getKeyFactory()
Returns KeyFactory which is used for converting state key -> Redis key.
getKeyFactory
in class AbstractRedisMapState<T>
protected List<String> retrieveValuesFromRedis(List<String> keys)
Retrieves values from Redis that each value is corresponding to each key.
retrieveValuesFromRedis
in class AbstractRedisMapState<T>
keys
- keys having state valuesprotected void updateStatesToRedis(Map<String,String> keyValues)
Updates (key, value) pairs to Redis.
updateStatesToRedis
in class AbstractRedisMapState<T>
keyValues
- (key, value) pairsCopyright © 2019 The Apache Software Foundation. All rights reserved.