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 RENAMENX command. #1332

Merged
merged 6 commits into from
Apr 29, 2024

Conversation

Yury-Fridlyand
Copy link
Collaborator

Issue #, if available:
N/A

Description of changes:
https://redis.io/docs/latest/commands/renamenx/

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

Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand added the java issues and fixes related to the java client label Apr 24, 2024
@Yury-Fridlyand Yury-Fridlyand requested a review from a team as a code owner April 24, 2024 01:19
@@ -1975,6 +1976,21 @@ public T type(@NonNull String key) {
return getThis();
}

/**
* Renames <code>key</code> to <code>newKey</code> if <code>newKey</code> does not yet exist.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't remember, is the api note about keys needing to map to the same hash slot not applicable here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't add to transaction, because

  1. transaction could be routed to one node only
  2. if route not given, GLIDE core picks a route for the transaction according to the keys used referenced in it

A user may still route a transaction to a wrong node intentionally, on it own responsibility.

@Yury-Fridlyand Yury-Fridlyand merged commit a37f6dc into valkey-io:main Apr 29, 2024
41 of 45 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the java/integ_yuryf_RENAMENX branch April 29, 2024 18:49
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Add `RENAMENX` command. (#247)

Signed-off-by: Yury-Fridlyand <[email protected]>

* PR comments.

Signed-off-by: Yury-Fridlyand <[email protected]>

* Update IT.

Signed-off-by: Yury-Fridlyand <[email protected]>

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants