Skip to content

Commit 7bd0a8b

Browse files
christophstroblmp911de
authored andcommitted
Update javadoc.
See: #3142
1 parent 28af64d commit 7bd0a8b

File tree

6 files changed

+23
-12
lines changed

6 files changed

+23
-12
lines changed

src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,10 @@ default Mono<Long> touch(Collection<ByteBuffer> keys) {
231231
Flux<NumericResponse<Collection<ByteBuffer>, Long>> touch(Publisher<Collection<ByteBuffer>> keys);
232232

233233
/**
234-
* Find all keys matching the given {@literal pattern}.<br />
235-
* It is recommended to use {@link #scan(ScanOptions)} to iterate over the keyspace as {@link #keys(ByteBuffer)} is a
236-
* non-interruptible and expensive Redis operation.
234+
* Retrieve all keys matching the given pattern via {@code KEYS} command.
235+
* <p>
236+
* <strong>IMPORTANT:</strong> This command is non-interruptible and scans the entire keyspace which may cause
237+
* performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
237238
*
238239
* @param pattern must not be {@literal null}.
239240
* @return

src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ default Boolean exists(byte[] key) {
120120
Long touch(byte[]... keys);
121121

122122
/**
123-
* Find all keys matching the given {@code pattern}.
123+
* Retrieve all keys matching the given pattern.
124+
* <p>
125+
* <strong>IMPORTANT:</strong> The {@literal KEYS} command is non-interruptible and scans the entire keyspace which
126+
* may cause performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
124127
*
125128
* @param pattern must not be {@literal null}.
126129
* @return empty {@link Set} if no match found. {@literal null} when used in pipeline / transaction.

src/main/java/org/springframework/data/redis/connection/StringRedisConnection.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ interface StringTuple extends Tuple {
186186
Long touch(String... keys);
187187

188188
/**
189-
* Find all keys matching the given {@code pattern}.
189+
* Retrieve all keys matching the given pattern via {@code KEYS} command.
190+
* <p>
191+
* <strong>IMPORTANT:</strong> This command is non-interruptible and scans the entire keyspace which may cause
192+
* performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
190193
*
191194
* @param pattern must not be {@literal null}.
192195
* @return

src/main/java/org/springframework/data/redis/core/ClusterOperations.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
public interface ClusterOperations<K, V> {
3939

4040
/**
41-
* Get all keys located at given node.
41+
* Retrieve all keys located at given node matching the given pattern.
42+
* <p>
43+
* <strong>IMPORTANT:</strong> The {@literal KEYS} command is non-interruptible and scans the entire keyspace which
44+
* may cause performance issues.
4245
*
4346
* @param node must not be {@literal null}.
4447
* @param pattern

src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,10 @@ default Mono<Flux<? extends Message<String, V>>> listenToPatternLater(String...
249249
Mono<DataType> type(K key);
250250

251251
/**
252-
* Find all keys matching the given {@code pattern}. <br />
253-
* <strong>IMPORTANT:</strong> It is recommended to use {@link #scan()} to iterate over the keyspace as
254-
* {@link #keys(Object)} is a non-interruptible and expensive Redis operation.
252+
* Retrieve all keys matching the given pattern via {@code KEYS} command.
253+
* <p>
254+
* <strong>IMPORTANT:</strong> This command is non-interruptible and scans the entire keyspace which may cause
255+
* performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
255256
*
256257
* @param pattern must not be {@literal null}.
257258
* @return the {@link Flux} emitting matching keys one by one.

src/main/java/org/springframework/data/redis/core/RedisOperations.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ <T> T execute(RedisScript<T> script, RedisSerializer<?> argsSerializer, RedisSer
260260
DataType type(K key);
261261

262262
/**
263-
* Retrieve keys matching the given pattern via {@code KEYS} command.
263+
* Retrieve all keys matching the given pattern via {@code KEYS} command.
264264
* <p>
265-
* Note: This command scans the entire keyspace and may cause performance issues
266-
* in production environments. Prefer using {@link #scan(ScanOptions)} for large datasets.
265+
* <strong>IMPORTANT:</strong> This command is non-interruptible and scans the entire keyspace which may cause
266+
* performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
267267
*
268268
* @param pattern key pattern
269269
* @return set of matching keys, or {@literal null} when used in pipeline / transaction

0 commit comments

Comments
 (0)