-
Notifications
You must be signed in to change notification settings - Fork 442
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
feat: Catch up ZRANGE
options
#1428
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
bool with_scores_ = false; | ||
}; | ||
Status Execute(Server *svr, Connection *conn, std::string *output) override { | ||
if (range_type_ == kZRangeAuto || range_type_ == kZRangeRank) { |
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.
This staff can be later refactor to dedup. But I keep it as is so that we don't introduce too much unstable in one PR
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.
LGTM
@@ -557,7 +558,7 @@ rocksdb::Status ZSet::Remove(const Slice &user_key, const std::vector<Slice> &me | |||
return storage_->Write(storage_->DefaultWriteOptions(), batch->GetWriteBatch()); | |||
} | |||
|
|||
rocksdb::Status ZSet::RemoveRangeByScore(const Slice &user_key, ZRangeSpec spec, int *ret) { | |||
rocksdb::Status ZSet::RemoveRangeByScore(const Slice &user_key, CommonRangeScoreSpec &spec, int *ret) { |
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.
rocksdb::Status ZSet::RemoveRangeByScore(const Slice &user_key, const CommonRangeScoreSpec &spec, int *ret) {
?
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.
Good to have. Perhaps we focus on the functionality in this PR, and unless the style is regression or quite unacceptable, I can gather them to do in a follow-up.
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.
After a closer look, it writes:
spec.removed = true;
so that we cannot use const
here. But it comes to me a smell we can investigate further later.
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 guess we can just pass-by-value. I guess copying it is lightweight :)
All existing tests passed without change. Merging as no regression... I'm preparing a follow-up to clean up code a bit. |
This closes #1117.
I'll add tests later.