Skip to content

Commit 3f4f9a9

Browse files
christophstroblmp911de
authored andcommitted
Update javadoc.
See: #3142
1 parent 447dc97 commit 3f4f9a9

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
@@ -242,9 +242,10 @@ default Mono<Long> touch(Collection<ByteBuffer> keys) {
242242
Flux<NumericResponse<Collection<ByteBuffer>, Long>> touch(Publisher<Collection<ByteBuffer>> keys);
243243

244244
/**
245-
* Find all keys matching the given {@literal pattern}.<br />
246-
* It is recommended to use {@link #scan(ScanOptions)} to iterate over the keyspace as {@link #keys(ByteBuffer)} is a
247-
* non-interruptible and expensive Redis operation.
245+
* Retrieve all keys matching the given pattern via {@code KEYS} command.
246+
* <p>
247+
* <strong>IMPORTANT:</strong> This command is non-interruptible and scans the entire keyspace which may cause
248+
* performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
248249
*
249250
* @param pattern must not be {@literal null}.
250251
* @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
@@ -119,7 +119,10 @@ default Boolean exists(byte @NonNull [] key) {
119119
Long touch(byte @NonNull [] @NonNull... keys);
120120

121121
/**
122-
* Find all keys matching the given {@code pattern}.
122+
* Retrieve all keys matching the given pattern.
123+
* <p>
124+
* <strong>IMPORTANT:</strong> The {@literal KEYS} command is non-interruptible and scans the entire keyspace which
125+
* may cause performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
123126
*
124127
* @param pattern must not be {@literal null}.
125128
* @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
@@ -185,7 +185,10 @@ interface StringTuple extends Tuple {
185185
Long touch(@NonNull String @NonNull... keys);
186186

187187
/**
188-
* Find all keys matching the given {@code pattern}.
188+
* Retrieve all keys matching the given pattern via {@code KEYS} command.
189+
* <p>
190+
* <strong>IMPORTANT:</strong> This command is non-interruptible and scans the entire keyspace which may cause
191+
* performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
189192
*
190193
* @param pattern must not be {@literal null}.
191194
* @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
@@ -41,7 +41,10 @@
4141
public interface ClusterOperations<K, V> {
4242

4343
/**
44-
* Get all keys located at given node.
44+
* Retrieve all keys located at given node matching the given pattern.
45+
* <p>
46+
* <strong>IMPORTANT:</strong> The {@literal KEYS} command is non-interruptible and scans the entire keyspace which
47+
* may cause performance issues.
4548
*
4649
* @param node must not be {@literal null}.
4750
* @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
@@ -264,9 +264,10 @@ default Mono<Flux<? extends Message<String, V>>> listenToPatternLater(String...
264264
Mono<DataType> type(K key);
265265

266266
/**
267-
* Find all keys matching the given {@code pattern}. <br />
268-
* <strong>IMPORTANT:</strong> It is recommended to use {@link #scan()} to iterate over the keyspace as
269-
* {@link #keys(Object)} is a non-interruptible and expensive Redis operation.
267+
* Retrieve all keys matching the given pattern via {@code KEYS} command.
268+
* <p>
269+
* <strong>IMPORTANT:</strong> This command is non-interruptible and scans the entire keyspace which may cause
270+
* performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
270271
*
271272
* @param pattern must not be {@literal null}.
272273
* @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
@@ -264,10 +264,10 @@ public interface RedisOperations<K, V> {
264264
DataType type(@NonNull K key);
265265

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

0 commit comments

Comments
 (0)