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 the XRANGE command #1501

Merged

Conversation

acarbonetto
Copy link
Collaborator

Issue #, if available:

Description of changes:

Adds the XRANGE cmd for the Java client

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

* Java: Add the XRANGE command

Signed-off-by: Andrew Carbonetto <[email protected]>

* CARGO FMT

Signed-off-by: Andrew Carbonetto <[email protected]>

* Clean documentation

Signed-off-by: Andrew Carbonetto <[email protected]>

* Add empty test

Signed-off-by: Andrew Carbonetto <[email protected]>

* Add empty test

Signed-off-by: Andrew Carbonetto <[email protected]>

* Update XRANGE for self-review

Signed-off-by: Andrew Carbonetto <[email protected]>

* Use XRANGE bounding objects

Signed-off-by: Andrew Carbonetto <[email protected]>

* Add StreamRange documentation

Signed-off-by: Andrew Carbonetto <[email protected]>

* SPOTLESS

Signed-off-by: Andrew Carbonetto <[email protected]>

* Fix transaction tests

Signed-off-by: Andrew Carbonetto <[email protected]>

* SPOTLESS

Signed-off-by: Andrew Carbonetto <[email protected]>

---------

Signed-off-by: Andrew Carbonetto <[email protected]>
@acarbonetto acarbonetto added the java issues and fixes related to the java client label May 31, 2024
@acarbonetto acarbonetto self-assigned this May 31, 2024
@acarbonetto acarbonetto requested a review from a team as a code owner May 31, 2024 00:12
@acarbonetto acarbonetto changed the title Java: Add the XRANGE command (#325) Java: Add the XRANGE command May 31, 2024
Comment on lines 122 to 123
* @return A <code>Map</code> of key to stream entry data, where entry data is an array with pairs
* of item, data.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @return A <code>Map</code> of key to stream entry data, where entry data is an array with pairs
* of item, data.
* @return A <code>Map</code> of entry ID to entry data.

We don't have pairs there - I mean we don't return data as pairs. I'd like to say that the data is usually flat pairs, but I don't know how.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could say "pairings" to distinguish from the Pair object.

Signed-off-by: Andrew Carbonetto <[email protected]>
@@ -2659,12 +2661,55 @@ public T xlen(@NonNull String key) {
* less than the number of entries in <code>ids</code>, if the specified <code>ids</code>
* don't exist in the stream.
*/
public T xdel(String key, String[] ids) {
public T xdel(@NonNull String key, @NonNull String[] ids) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably small enough to sneak in but was this intentional? changes on another command?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. This was an intentionally sneaky move...

Signed-off-by: Andrew Carbonetto <[email protected]>
@acarbonetto acarbonetto merged commit abb4306 into valkey-io:main May 31, 2024
46 checks passed
@acarbonetto acarbonetto deleted the java/integ_acarbo_add_xrange_command branch May 31, 2024 22:36
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Java: Add the XRANGE command (#325)

* Java: Add the XRANGE command

Signed-off-by: Andrew Carbonetto <[email protected]>

* CARGO FMT

Signed-off-by: Andrew Carbonetto <[email protected]>

* Clean documentation

Signed-off-by: Andrew Carbonetto <[email protected]>

* Add empty test

Signed-off-by: Andrew Carbonetto <[email protected]>

* Add empty test

Signed-off-by: Andrew Carbonetto <[email protected]>

* Update XRANGE for self-review

Signed-off-by: Andrew Carbonetto <[email protected]>

* Use XRANGE bounding objects

Signed-off-by: Andrew Carbonetto <[email protected]>

* Add StreamRange documentation

Signed-off-by: Andrew Carbonetto <[email protected]>

* SPOTLESS

Signed-off-by: Andrew Carbonetto <[email protected]>

* Fix transaction tests

Signed-off-by: Andrew Carbonetto <[email protected]>

* SPOTLESS

Signed-off-by: Andrew Carbonetto <[email protected]>

---------

Signed-off-by: Andrew Carbonetto <[email protected]>

* XRANGE udpates for review

Signed-off-by: Andrew Carbonetto <[email protected]>

* SPOTLESS

Signed-off-by: Andrew Carbonetto <[email protected]>

---------

Signed-off-by: Andrew Carbonetto <[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