Skip to content
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

Java: Add WATCH and UNWATCH command #1539

Merged
merged 10 commits into from
Jun 17, 2024

Conversation

GumpacG
Copy link
Collaborator

@GumpacG GumpacG commented Jun 6, 2024

Issue #, if available:

Description of changes:
Implements WATCH and UNWATCH commands in the java client.

Note: This is blocked and depends on amazon-contributing/redis-rs#157

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@GumpacG GumpacG requested a review from a team as a code owner June 6, 2024 18:22
@Yury-Fridlyand Yury-Fridlyand added the java issues and fixes related to the java client label Jun 6, 2024
@aaron-congo
Copy link
Collaborator

Our review checklist includes the following, are they applicable for UNWATCH or no?
For keyless commands:

  • if policies exist: ensure API documents default routing
  • ensure there are distinct APIs for cluster and standalone clients, with the cluster API containing routing args
  • add new commands to the cluster_routing.rs file based on their default routing

@GumpacG
Copy link
Collaborator Author

GumpacG commented Jun 8, 2024

Add Route option to UNWATCH

@GumpacG GumpacG force-pushed the java/dev_guiang_watch branch 2 times, most recently from 1c1e123 to 57f03b6 Compare June 13, 2024 15:03
@@ -575,4 +578,10 @@ public CompletableFuture<ClusterValue<Object>> fcall(
? ClusterValue.ofSingleValue(handleObjectOrNullResponse(response))
: ClusterValue.ofMultiValue(handleMapResponse(response)));
}

@Override
public CompletableFuture<String> unwatch(@NonNull Route route) {
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBD do we need this? Does user need this?

@@ -781,7 +781,8 @@ public static Stream<Arguments> callCrossSlotCommandsWhichShouldPass() {
Arguments.of("del", clusterClient.del(new String[] {"abc", "zxy", "lkn"})),
Arguments.of("mget", clusterClient.mget(new String[] {"abc", "zxy", "lkn"})),
Arguments.of("mset", clusterClient.mset(Map.of("abc", "1", "zxy", "2", "lkn", "3"))),
Arguments.of("touch", clusterClient.touch(new String[] {"abc", "zxy", "lkn"})));
Arguments.of("touch", clusterClient.touch(new String[] {"abc", "zxy", "lkn"})),
Arguments.of("watch", clusterClient.watch(new String[] {"ghi", "zxy", "lkn"})));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

@GumpacG GumpacG force-pushed the java/dev_guiang_watch branch from 4691a96 to e1611ae Compare June 13, 2024 21:40
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve conflicts

@GumpacG GumpacG force-pushed the java/dev_guiang_watch branch 2 times, most recently from b1d3565 to d2a873b Compare June 14, 2024 02:30
@GumpacG GumpacG force-pushed the java/dev_guiang_watch branch from 2cb8365 to f605ee6 Compare June 17, 2024 18:39
@acarbonetto acarbonetto merged commit a7eccad into valkey-io:main Jun 17, 2024
46 checks passed
@GumpacG GumpacG deleted the java/dev_guiang_watch branch June 17, 2024 23:32
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 19, 2024
* Java: Add `WATCH` and `UNWATCH` command

* Addressed PR comments

* Added unwatch with route and improved tests

* Fixed test based on submodule changes

* Addressed PR comments

* Added example for watch returning null

* Added crossSlot test

* Addressed comments

* Commented out a test due to a bug

* Address PR comments
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Java: Add `WATCH` and `UNWATCH` command

* Addressed PR comments

* Added unwatch with route and improved tests

* Fixed test based on submodule changes

* Addressed PR comments

* Added example for watch returning null

* Added crossSlot test

* Addressed comments

* Commented out a test due to a bug

* Address PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java issues and fixes related to the java client
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

5 participants