Add performance warning to RedisTemplate#keys() and RedisOperations#keys() Javadoc
Description
This pull request updates the Javadoc of both RedisTemplate#keys() and RedisOperations#keys() methods to include a performance warning regarding the use of the KEYS command.
The KEYS command performs a full scan of the Redis keyspace, which can severely impact performance in production environments.
To avoid misuse, the updated Javadocs include a warning and recommend using scan(ScanOptions) as a safer alternative for large datasets.
- The warning has been added to:
RedisTemplate#keys()implementation method.RedisOperations#keys()interface method.
Note: ReactiveRedisOperations#keys() already contains a similar warning and did not require changes.
Checklist
- [x] I have read the Spring Data contribution guidelines.
- [x] I used the code formatters provided here and did not include any formatting-only changes.
- [x] No test cases were needed as this change is limited to documentation (Javadoc only).
- [x] No author header update was required since only a Javadoc comment was changed and no logic was modified.
References
Care to move this documentation bit to RedisOperations? And please cross-check ReactiveRedisOperations for the same mention.
Care to move this documentation bit to
RedisOperations? And please cross-checkReactiveRedisOperationsfor the same mention.
Thanks for the suggestion!
I reviewed ReactiveRedisOperations#keys() and confirmed it already includes a similar warning about performance concerns and recommends using scan().
Therefore, I only applied the Javadoc update to RedisOperations#keys().
Thank you for your contribution. That's merged, polished, and backported now.