Class AbstractRedisMapState<T>

  • Type Parameters:
    T - value's type class
    All Implemented Interfaces:
    IBackingMap<T>
    Direct Known Subclasses:
    RedisClusterMapState, RedisMapState

    public abstract class AbstractRedisMapState<T>
    extends Object
    implements IBackingMap<T>
    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.

    • Constructor Detail

      • AbstractRedisMapState

        public AbstractRedisMapState()
    • Method Detail

      • getSerializer

        protected abstract Serializer getSerializer()
        Returns Serializer which is used for serializing tuple value and deserializing Redis value.
        Returns:
        serializer
      • getKeyFactory

        protected abstract KeyFactory getKeyFactory()
        Returns KeyFactory which is used for converting state key -> Redis key.
        Returns:
        key factory
      • retrieveValuesFromRedis

        protected abstract List<String> retrieveValuesFromRedis​(List<String> keys)
        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

        protected abstract void updateStatesToRedis​(Map<String,​String> keyValues)
        Updates (key, value) pairs to Redis.
        Parameters:
        keyValues - (key, value) pairs