Interface RedisCacheWriter.RedisCacheWriterConfigurer
- Enclosing interface:
- RedisCacheWriter
RedisCacheWriter.- Since:
- 4.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionbatchStrategy(BatchStrategy batchStrategy) Configure theBatchStrategywhen clearing the cache (i.e. bulk removal of cache keys).cacheLocking(Consumer<RedisCacheWriter.CacheLockingConfigurer> configurerConsumer) Configure cache locking to synchronize cache access across multiple cache instances.Configure theCacheStatisticsCollectorto use.collectStatistics(CacheStatisticsCollector cacheStatisticsCollector) Configure theCacheStatisticsCollectorto use.Enable cache locking to synchronize cache access across multiple cache instances.enableLocking(Consumer<RedisCacheWriter.CacheLockingConfiguration> configurerConsumer) Enable cache locking to synchronize cache access across multiple cache instances.Use immediate writes (i.e. write operations such asRedisCacheWriter.put(String, byte[], byte[], Duration)orRedisCacheWriter.clear(String, byte[])) shall apply immediately.immediateWrites(boolean enableImmediateWrites) Configure whether to use immediate writes (i.e. write operations such asRedisCacheWriter.put(String, byte[], byte[], Duration)orRedisCacheWriter.clear(String, byte[])) shall apply immediately.
-
Method Details
-
collectStatistics
Configure theCacheStatisticsCollectorto use. This is useful for plugging in and/or customizing statistics collection. -
collectStatistics
RedisCacheWriter.RedisCacheWriterConfigurer collectStatistics(CacheStatisticsCollector cacheStatisticsCollector) Configure theCacheStatisticsCollectorto use. This is useful for plugging in and/or customizing statistics collection.If no statistics collector is specified, no statistics will be recorded. Statistics collection can be reconfigured on the built RedisCacheWriter by invoking
RedisCacheWriter#withStatisticsCollector(CacheStatisticsCollector).- Parameters:
cacheStatisticsCollector- the statistics collector to use.
-
batchStrategy
Configure theBatchStrategywhen clearing the cache (i.e. bulk removal of cache keys).If no batch strategy is specified, the RedisCacheWriter uses
BatchStrategies.keys();- Parameters:
batchStrategy- the batch strategy to use.
-
enableLocking
Enable cache locking to synchronize cache access across multiple cache instances. -
enableLocking
default RedisCacheWriter.RedisCacheWriterConfigurer enableLocking(Consumer<RedisCacheWriter.CacheLockingConfiguration> configurerConsumer) Enable cache locking to synchronize cache access across multiple cache instances.- Parameters:
configurerConsumer- a configuration function that configuresRedisCacheWriter.CacheLockingConfiguration.
-
cacheLocking
RedisCacheWriter.RedisCacheWriterConfigurer cacheLocking(Consumer<RedisCacheWriter.CacheLockingConfigurer> configurerConsumer) Configure cache locking to synchronize cache access across multiple cache instances.- Parameters:
configurerConsumer- a configuration function that configuresRedisCacheWriter.CacheLockingConfigurer.
-
immediateWrites
Use immediate writes (i.e. write operations such asRedisCacheWriter.put(String, byte[], byte[], Duration)orRedisCacheWriter.clear(String, byte[])) shall apply immediately.Several
Cacheoperations can be performed asynchronously or deferred and this is the default behavior forRedisCacheWriter. Enable immediate writes in case a particular cache requires stronger consistency (i.e. Cache writes must be visible immediately).When using a
reactive Redis driver, immediate writes lead to blocking. -
immediateWrites
Configure whether to use immediate writes (i.e. write operations such asRedisCacheWriter.put(String, byte[], byte[], Duration)orRedisCacheWriter.clear(String, byte[])) shall apply immediately.Several
Cacheoperations can be performed asynchronously or deferred and this is the default behavior forRedisCacheWriter. Enable immediate writes in case a particular cache requires stronger consistency (i.e. Cache writes must be visible immediately).When using a
reactive Redis driver, immediate writes lead to blocking.- Parameters:
enableImmediateWrites- whether write operations must be visible immediately.
-