Package org.apache.storm.redis.trident.state

## 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 void` | `updateStatesToRedis​(RedisState redisState, Map<String,​String> keyToValue)` | Updates (key, value) pairs to Redis.
    `RedisStateUpdater` | `withExpire​(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`

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

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

    - ### Methods inherited from interface org.apache.storm.trident.operation.Operation

      `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:
        `updateStatesToRedis` in class `AbstractRedisStateUpdater<RedisState>`
      Parameters:
        `redisState` - State for handling query
        `keyToValue` - (key, value) pairs