Class RedisCacheService<V>

java.lang.Object
com.helixframework.cache.BaseCacheService<String,V>
com.helixframework.cache.redis.RedisCacheService<V>
Type Parameters:
V - The type of values stored in the cache.
All Implemented Interfaces:
com.helixframework.cache.CacheService<String,V>

public class RedisCacheService<V> extends com.helixframework.cache.BaseCacheService<String,V>
RedisCacheService is an implementation of a cache service backed by a Redis datastore. It extends the BaseCacheService and provides methods to interact with Redis for storing, retrieving, and managing cache entries.
  • Method Details

    • builder

      public static <V> RedisCacheService.Builder<V> builder(Class<V> valueClass)
      Constructs a new Builder instance for configuring and creating an instance of RedisCacheService.
      Type Parameters:
      V - The type of the values to be stored in the cache
      Parameters:
      valueClass - The class of the value type. This parameter ensures type safety when building the cache service. Must not be null
      Returns:
      A new Builder instance for configuring and constructing the cache service
    • doGet

      protected Optional<V> doGet(String key)
      Specified by:
      doGet in class com.helixframework.cache.BaseCacheService<String,V>
    • doPut

      protected void doPut(String key, V value)
      Specified by:
      doPut in class com.helixframework.cache.BaseCacheService<String,V>
    • doPut

      protected void doPut(String key, V value, Duration duration)
      Specified by:
      doPut in class com.helixframework.cache.BaseCacheService<String,V>
    • doEvict

      protected void doEvict(String key)
      Specified by:
      doEvict in class com.helixframework.cache.BaseCacheService<String,V>
    • doClear

      protected void doClear()
      Specified by:
      doClear in class com.helixframework.cache.BaseCacheService<String,V>