-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for CAS/CAD commands #3503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for two new Redis commands (DIGEST and DELEX) and introduces conditional value operations through a new ValueCondition abstraction. The changes enable value-based and digest-based conditional operations for SET, SETGET, and DELEX commands.
- Introduces
ValueCondition<V>class supporting value equality/inequality and digest-based comparisons - Adds
digestKey()command to compute XXH3 64-bit digests of string values - Adds
delex()command for conditional key deletion with value/digest guards - Extends SET and SETGET commands to support conditional operations via ValueCondition
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ValueCondition.java | New class providing abstraction for conditional value comparisons with factory methods for equality, inequality, and digest-based conditions |
| CommandType.java | Adds DIGEST and DELEX command types to the protocol enum |
| CommandKeyword.java | Adds IFEQ, IFNE, IFDEQ, IFDNE keywords for conditional operations |
| ReadOnlyCommands.java | Registers DIGEST as a read-only command |
| RedisCommandBuilder.java | Implements command builders for digestKey, delex, and conditional set/setGet variants |
| RedisStringCommands.java (template) | Adds API signatures for digestKey and conditional set/setGet operations |
| RedisKeyCommands.java (template) | Adds API signature for delex operation |
| Abstract/Reactive/Async implementations | Implements command dispatch for all API variants (sync, async, reactive, coroutines) |
| Cluster node selection interfaces | Adds cluster support for new commands |
| StringCommandIntegrationTests.java | Adds comprehensive tests for digestKey and conditional SET/SETGET operations |
| KeyCommandIntegrationTests.java | Adds tests for delex with various conditions |
| KeyClusterCommandIntegrationTests.java | Adds cluster-specific tests for delex |
| MasterReplicaIntegrationTests.java | Adds test verifying DIGEST can be read from replicas |
| ClusterReadOnlyCommandsUnitTests.java | Updates expected read-only command count from 100 to 101 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
resolves #3498