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 BatchStrategy
keys()
static BatchStrategy
scan
(int batchSize) ABatchStrategy
using aSCAN
cursors and potentially multipleDEL
commands to remove all matching keys.
-
Method Details
-
keys
ABatchStrategy
using a singleKEYS
andDEL
command to remove all matching keys.KEYS
scans the entire keyspace of the Redis database and can block the Redis worker thread for a long time on large keyspaces.KEYS
is supported for standalone and clustered (sharded) Redis operation modes.- Returns:
- batching strategy using
KEYS
.
-
scan
ABatchStrategy
using aSCAN
cursors and potentially multipleDEL
commands to remove all matching keys. This strategy allows a configurable batch size to optimize for scan batching.Note that using the
SCAN
strategy might be not supported on all drivers and Redis operation modes.- Returns:
- batching strategy using
SCAN
.
-