Skip to content

Commit 2ae6ab8

Browse files
Update javadoc.
Original Pull Request: #3142
1 parent a597d3e commit 2ae6ab8

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

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

124124
/**
125-
* Find all keys matching the given {@code pattern}.
125+
* Retrieve all keys matching the given pattern.
126+
* <p>
127+
* <strong>IMPORTANT:</strong> The {@literal KEYS} command is non-interruptible and scans the entire keyspace which
128+
* may cause performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
126129
*
127130
* @param pattern must not be {@literal null}.
128131
* @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(String... 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
@@ -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
@@ -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
@@ -262,10 +262,10 @@ <T> T execute(RedisScript<T> script, RedisSerializer<?> argsSerializer, RedisSer
262262
DataType type(K key);
263263

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

0 commit comments

Comments
 (0)