Class ProtobufRedisLoadingCache.Factory

    • Constructor Summary

      Constructors 
      Constructor Description
      Factory​(dagger.Lazy<io.lettuce.core.cluster.RedisClusterClient> redisClusterClient, dagger.Lazy<io.lettuce.core.RedisClient> redisClient, RedisConfig config, io.micrometer.core.instrument.MeterRegistry meterRegistry)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <K extends com.google.protobuf.Message,​V extends com.google.protobuf.Message>
      ProtobufRedisLoadingCache<K,​V>
      create​(java.lang.String name, K keyPrototype, V valuePrototype, java.time.Duration redisTtl, boolean redisMasterOnly, com.github.benmanes.caffeine.cache.CaffeineSpec localCacheSpec)
      Constructs a new ProtobufRedisLoadingCache that can write protobuf Message keys and values to remoteCache, with an optional local cache layer.
      <K extends com.google.protobuf.Message,​V extends com.google.protobuf.Message>
      ProtobufRedisLoadingCache<K,​V>
      create​(java.lang.String name, K keyPrototype, V valuePrototype, java.time.Duration redisTtl, com.github.benmanes.caffeine.cache.CaffeineSpec localCacheSpec)
      Constructs a new ProtobufRedisLoadingCache that can write protobuf Message keys and values to remoteCache, with an optional local cache layer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Factory

        @Inject
        public Factory​(dagger.Lazy<io.lettuce.core.cluster.RedisClusterClient> redisClusterClient,
                       dagger.Lazy<io.lettuce.core.RedisClient> redisClient,
                       RedisConfig config,
                       io.micrometer.core.instrument.MeterRegistry meterRegistry)
    • Method Detail

      • create

        public <K extends com.google.protobuf.Message,​V extends com.google.protobuf.Message> ProtobufRedisLoadingCache<K,​V> create​(java.lang.String name,
                                                                                                                                               K keyPrototype,
                                                                                                                                               V valuePrototype,
                                                                                                                                               java.time.Duration redisTtl,
                                                                                                                                               @Nullable
                                                                                                                                               com.github.benmanes.caffeine.cache.CaffeineSpec localCacheSpec)
        Constructs a new ProtobufRedisLoadingCache that can write protobuf Message keys and values to remoteCache, with an optional local cache layer.
        Parameters:
        name - name of this cache, will be prefixed onto all keys.
        keyPrototype - a prototype for the key Message, usually gotten from Key.getDefaultInstance().
        valuePrototype - a prototype for the value Message, usually gotten from Value.getDefaultInstance().
        redisTtl - the time until expiration of a value in the remoteCache cache. The local cache should be considered in localCacheSpec.
        localCacheSpec - a CaffeineSpec to control the local cache layer. If null, local caching will be disabled.
      • create

        public <K extends com.google.protobuf.Message,​V extends com.google.protobuf.Message> ProtobufRedisLoadingCache<K,​V> create​(java.lang.String name,
                                                                                                                                               K keyPrototype,
                                                                                                                                               V valuePrototype,
                                                                                                                                               java.time.Duration redisTtl,
                                                                                                                                               boolean redisMasterOnly,
                                                                                                                                               @Nullable
                                                                                                                                               com.github.benmanes.caffeine.cache.CaffeineSpec localCacheSpec)
        Constructs a new ProtobufRedisLoadingCache that can write protobuf Message keys and values to remoteCache, with an optional local cache layer.
        Parameters:
        name - name of this cache, will be prefixed onto all keys.
        keyPrototype - a prototype for the key Message, usually gotten from Key.getDefaultInstance().
        valuePrototype - a prototype for the value Message, usually gotten from Value.getDefaultInstance().
        redisTtl - the time until expiration of a value in the remoteCache cache. The local cache should be considered in localCacheSpec.
        redisMasterOnly - whether remoteCache reads should only happen from master. Best-effort, temporary persistent storage should set this to true.
        localCacheSpec - a CaffeineSpec to control the local cache layer. If null, local caching will be disabled.