-
Notifications
You must be signed in to change notification settings - Fork 472
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
Add the support of the HRANDFIELD command #1565
Conversation
- Add parse for hrandfield - Implemented the case where the requested data is a positive number greater than the size of the hash. Signed-off-by: Zewen Xu <zevin9427@gmail.com>
- add test for hrandfield - Fix output (nil) when the key does not exist Signed-off-by: Zewen Xu <zevin9427@gmail.com>
You can also add some go tests. |
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.
I didn't review the Hash::RandField
implements, just some style nits
I will do it later |
- call the GetAll function to get all elements - add some cpp tests - wrap functions with lambdas - updated random selection Signed-off-by: Zewen Xu <zevin9427@gmail.com>
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.
Looks much better now!
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.
Looks much better! I didn't check the tests carefully
Seems here are some clang-tidy reports that need to be fixed. https://github.com/apache/kvrocks/actions/runs/5542464594/jobs/10117205769?pr=1565 |
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.
Rest LGTM!
By the way, I noticed that you have written:
// TODO: Add test to verify randomness of the selected random fields
Would this be added in this patch or later?
This patch will not implement that |
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.
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.
Others are good to me. :)
@zevin02 Thanks for your contribution and patience and greater thanks to reviewers: @mapleFU @PragmaTwice @Yangsx-1 |
Close :#1510