org.apache.storm.redis.trident.state

## Class RedisClusterMapState<T>

- java.lang.Object
- - org.apache.storm.redis.trident.state.AbstractRedisMapState<T>
  - - org.apache.storm.redis.trident.state.RedisClusterMapState<T>

- All Implemented Interfaces:
    IBackingMap<T>

      public class RedisClusterMapState<T>
      extends AbstractRedisMapState<T>

  IBackingMap implementation for Redis Cluster environment.

  See Also:
    `AbstractRedisMapState`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `RedisClusterMapState.Factory` RedisClusterMapState.Factory provides Redis Cluster environment version of StateFactory.

  - ### Field Summary

    - ### Fields inherited from class org.apache.storm.redis.trident.state.AbstractRedisMapState

      `DEFAULT_SERIALIZERS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RedisClusterMapState(redis.clients.jedis.JedisCluster jedisCluster, Options options, Serializer<T> serializer, KeyFactory keyFactory)` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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(JedisClusterConfig jedisClusterConfig)` Provides StateFactory for non transactional.
    `static StateFactory` | `nonTransactional(JedisClusterConfig jedisClusterConfig, KeyFactory factory)` Provides StateFactory for non transactional.
    `static StateFactory` | `nonTransactional(JedisClusterConfig jedisClusterConfig, Options<Object> opts)` Provides StateFactory for non transactional.
    `static StateFactory` | `nonTransactional(JedisClusterConfig jedisClusterConfig, RedisDataTypeDescription dataTypeDescription)` Provides StateFactory for non transactional.
    `static StateFactory` | `opaque(JedisClusterConfig jedisClusterConfig)` Provides StateFactory for opaque transactional.
    `static StateFactory` | `opaque(JedisClusterConfig jedisClusterConfig, KeyFactory factory)` Provides StateFactory for opaque transactional.
    `static StateFactory` | `opaque(JedisClusterConfig jedisClusterConfig, Options<OpaqueValue> opts)` Provides StateFactory for opaque transactional.
    `static StateFactory` | `opaque(JedisClusterConfig jedisClusterConfig, 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(JedisClusterConfig jedisClusterConfig)` Provides StateFactory for transactional.
    `static StateFactory` | `transactional(JedisClusterConfig jedisClusterConfig, KeyFactory factory)` Provides StateFactory for transactional.
    `static StateFactory` | `transactional(JedisClusterConfig jedisClusterConfig, Options<TransactionalValue> opts)` Provides StateFactory for transactional.
    `static StateFactory` | `transactional(JedisClusterConfig jedisClusterConfig, RedisDataTypeDescription dataTypeDescription)` Provides StateFactory for transactional.
    `protected void` | `updateStatesToRedis(Map<String,String> keyValues)` Updates (key, value) pairs to Redis.

    - ### Methods inherited from class org.apache.storm.redis.trident.state.AbstractRedisMapState

      `multiGet, multiPut`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RedisClusterMapState

          public RedisClusterMapState(redis.clients.jedis.JedisCluster jedisCluster,
                                      Options options,
                                      Serializer<T> serializer,
                                      KeyFactory keyFactory)

      Constructor.

      Parameters:
        `jedisCluster` - JedisCluster
        `options` - options of State
        `serializer` - Serializer
        `keyFactory` - KeyFactory

  - ### Method Detail

    - #### opaque

          public static StateFactory opaque(JedisClusterConfig jedisClusterConfig)

      Provides StateFactory for opaque transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
      Returns:
        StateFactory

    - #### opaque

          public static StateFactory opaque(JedisClusterConfig jedisClusterConfig,
                                            RedisDataTypeDescription dataTypeDescription)

      Provides StateFactory for opaque transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
        `dataTypeDescription` - definition of data type
      Returns:
        StateFactory

    - #### opaque

          public static StateFactory opaque(JedisClusterConfig jedisClusterConfig,
                                            KeyFactory factory)

      Provides StateFactory for opaque transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
        `factory` - key factory
      Returns:
        StateFactory

    - #### opaque

          public static StateFactory opaque(JedisClusterConfig jedisClusterConfig,
                                            Options<OpaqueValue> opts)

      Provides StateFactory for opaque transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
        `opts` - options of State
      Returns:
        StateFactory

    - #### transactional

          public static StateFactory transactional(JedisClusterConfig jedisClusterConfig)

      Provides StateFactory for transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
      Returns:
        StateFactory

    - #### transactional

          public static StateFactory transactional(JedisClusterConfig jedisClusterConfig,
                                                   RedisDataTypeDescription dataTypeDescription)

      Provides StateFactory for transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
        `dataTypeDescription` - definition of data type
      Returns:
        StateFactory

    - #### transactional

          public static StateFactory transactional(JedisClusterConfig jedisClusterConfig,
                                                   KeyFactory factory)

      Provides StateFactory for transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
        `factory` - key factory
      Returns:
        StateFactory

    - #### transactional

          public static StateFactory transactional(JedisClusterConfig jedisClusterConfig,
                                                   Options<TransactionalValue> opts)

      Provides StateFactory for transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
        `opts` - options of State
      Returns:
        StateFactory

    - #### nonTransactional

          public static StateFactory nonTransactional(JedisClusterConfig jedisClusterConfig)

      Provides StateFactory for non transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
      Returns:
        StateFactory

    - #### nonTransactional

          public static StateFactory nonTransactional(JedisClusterConfig jedisClusterConfig,
                                                      RedisDataTypeDescription dataTypeDescription)

      Provides StateFactory for non transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
        `dataTypeDescription` - definition of data type
      Returns:
        StateFactory

    - #### nonTransactional

          public static StateFactory nonTransactional(JedisClusterConfig jedisClusterConfig,
                                                      KeyFactory factory)

      Provides StateFactory for non transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
        `factory` - key factory
      Returns:
        StateFactory

    - #### nonTransactional

          public static StateFactory nonTransactional(JedisClusterConfig jedisClusterConfig,
                                                      Options<Object> opts)

      Provides StateFactory for non transactional.

      Parameters:
        `jedisClusterConfig` - configuration for JedisCluster
        `opts` - options of State
      Returns:
        StateFactory

    - #### getSerializer

          protected Serializer getSerializer()

      Returns Serializer which is used for serializing tuple value and deserializing Redis value.

      Specified by:
        `getSerializer` in class `AbstractRedisMapState<T>`
      Returns:
        serializer

    - #### getKeyFactory

          protected KeyFactory getKeyFactory()

      Returns KeyFactory which is used for converting state key -> Redis key.

      Specified by:
        `getKeyFactory` in class `AbstractRedisMapState<T>`
      Returns:
        key factory

    - #### retrieveValuesFromRedis

          protected List<String> retrieveValuesFromRedis(List<String> keys)

      Retrieves values from Redis that each value is corresponding to each key.

      Specified by:
        `retrieveValuesFromRedis` in class `AbstractRedisMapState<T>`
      Parameters:
        `keys` - keys having state values
      Returns:
        values which are corresponding to keys

    - #### updateStatesToRedis

          protected void updateStatesToRedis(Map<String,String> keyValues)

      Updates (key, value) pairs to Redis.

      Specified by:
        `updateStatesToRedis` in class `AbstractRedisMapState<T>`
      Parameters:
        `keyValues` - (key, value) pairs

Copyright © 2021 The Apache Software Foundation. All rights reserved.