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

GEODE-9950: Add LRANGE command #7389

Merged
merged 7 commits into from
Mar 7, 2022

Conversation

Kris-10-0
Copy link
Contributor

This implements a version of the Redis LRANGE command, which is used for list data types. Associated tests were also added.

Given a key, it returns a list of elements in the range (inclusive) for the specified start index and stop index. Both the start and stop indexes are zero based, which starts at the head of the list. Negative indexes start at the tail of the list.

LINDEX was modified to use a new method created in this commit. The method converts negative indexes to the corresponding positive index.

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

  • Has your PR been rebased against the latest commit within the target branch (typically develop)?

  • Is your initial contribution a single, squashed commit?

  • Does gradlew build run cleanly?

  • Have you written or updated unit tests to verify your changes?

  • [NA] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

Copy link
Contributor

@onichols-pivotal onichols-pivotal left a comment

Choose a reason for hiding this comment

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

comment deleted

@jdeppe-pivotal jdeppe-pivotal added the redis Issues related to the geode-for-redis module label Feb 23, 2022
Copy link
Contributor

@DonalEvans DonalEvans left a comment

Choose a reason for hiding this comment

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

A few suggestions, but none of them are mandatory. If you don't want to go to the trouble of refactoring the tests to be parameterized, then some clarification in the test names around whether the range being tested is valid (expected to contain elements) or invalid (expected to be empty) would be good, to avoid potential confusion.

This implements a version of the Redis LRANGE command, which is used for list data types. Associated tests were also added.

Given a key, it returns a list of elements in the range (inclusive) for the specified start index and stop index. Both the start and stop indexes are zero based, which starts at the head of the list. Negative indexes start at the tail of the list.

LINDEX was modified to use a new method created in this commit. The method converts negative indexes to the corresponding positive index.
@jdeppe-pivotal jdeppe-pivotal merged commit 2cd5d82 into apache:develop Mar 7, 2022
mhansonp pushed a commit to mhansonp/geode that referenced this pull request Mar 11, 2022
This implements a version of the Redis LRANGE command, which is used for list data types. Associated tests were also added.

Given a key, it returns a list of elements in the range (inclusive) for the specified start index and stop index. Both the start and stop indexes are zero based, which starts at the head of the list. Negative indexes start at the tail of the list.

LINDEX was modified to use a new method created in this commit. The method converts negative indexes to the corresponding positive index.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
redis Issues related to the geode-for-redis module
Projects
None yet
5 participants