Class BatchStrategies
java.lang.Object
org.springframework.data.redis.cache.BatchStrategies
- Since:
- 2.6
- Author:
- Mark Paluch, Christoph Strobl, John Blum
-
Method Summary
Modifier and TypeMethodDescriptionstatic BatchStrategykeys()static BatchStrategyscan(int batchSize) ABatchStrategyusing aSCANcursors and potentially multipleDELcommands to remove all matching keys.
-
Method Details
-
keys
ABatchStrategyusing a singleKEYSandDELcommand to remove all matching keys.KEYSscans the entire keyspace of the Redis database and can block the Redis worker thread for a long time on large keyspaces.KEYSis supported for standalone and clustered (sharded) Redis operation modes.- Returns:
- batching strategy using
KEYS.
-
scan
ABatchStrategyusing aSCANcursors and potentially multipleDELcommands to remove all matching keys. This strategy allows a configurable batch size to optimize for scan batching.Note that using the
SCANstrategy might be not supported on all drivers and Redis operation modes.- Returns:
- batching strategy using
SCAN.
-