Added support for Redis 8.4 DELEX command.#3318
Added support for Redis 8.4 DELEX command.#3318Dgramada wants to merge 2 commits intospring-projects:mainfrom
Conversation
Implemented the DELEX command that conditionally deletes a key based on value comparison. Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
mp911de
left a comment
There was a problem hiding this comment.
Only two minor things to address. We need to discuss method naming for the API. CAS-wise, compareAndDelete(…) would be a great fit, but we have to accomodate the ifNotEquals factor.
| } | ||
|
|
||
| @Test | ||
| @EnabledOnRedisVersion("8.4") |
There was a problem hiding this comment.
We prefer @EnabledOnCommand("DELEX") gurards
| * @see <a href="https://redis.io/commands/delex">Redis Documentation: DELEX</a> | ||
| * @since 4.2 | ||
| */ | ||
| @NonNull Boolean deleteIfNotEqual(@NonNull K key, @NonNull V value); |
There was a problem hiding this comment.
@NonNull Boolean isn't right here as the return value can be null when used in transactions. Just Boolean is fine.
…Operations.java and replaced test annotation to be command-specific instead of version-specific. Signed-off-by: Yordan Tsintsov <yordan.tsintsov@redis.com>
|
I should mention that CAS/CAD operations in Redis also support two more options - IF_DIGEST_EQUAL and IF_DIGEST_NOT_EQUAL, which could be added at some point as well. Maybe we should take this into consideration, while naming the current template CAS/CAD methods. We could then name the methods something like:
|
|
We want to avoid uncontrolled growth in method (name) overload variants. Our current thinking is at |
This change introduces the DELEX string command feature as part of the features provided by the spring-data-redis project.
This feature is available starting from Redis OSS version 8.4 and later