-
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
HrangebyLex
supports specify intervals
#1120
HrangebyLex
supports specify intervals
#1120
Conversation
Code conflict as we did some refactors. cc @torwig @PragmaTwice could you help with providing the plan on following refactors so that we don't resolve conflicts many times? |
I will try to finish this pr as soon as possible before the big refactoring. |
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.
Cool, LGTM
HRANGE
optionsHrangebyLex
supports specify intervals
…incubator-kvrocks into support_more_hrange_opitons
…incubator-kvrocks into support_more_hrange_opitons
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.
zrangebylex
also has lex range
parser, we should unite the two into one.
return {Status::RedisParseErr, errWrongNumOfArguments}; | ||
CommandParser parser(args, 4); | ||
while (parser.Good()) { | ||
if (parser.EatEqICase("REV")) { |
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.
why support REV
option?
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 can be aligned with zrange and makes sense, for example if you need to take the largest data.
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.
About aligning zrange I will deal with it in the new 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.
i think hrangebylex
is enough currently since i heard there is such a demand. Developers may not be used to that hash
support range operations, we can implement when someone wants it, WDYT?
src/types/redis_hash.cc
Outdated
@@ -355,4 +383,36 @@ rocksdb::Status Hash::Scan(const Slice &user_key, const std::string &cursor, uin | |||
return SubKeyScanner::Scan(kRedisHash, user_key, cursor, limit, field_prefix, fields, values); | |||
} | |||
|
|||
Status Hash::ParseRangeLexSpec(const std::string &min, const std::string &max, HashRangeSpec *spec) { |
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.
We can merge these same structure and methods of HashRangeSpec and ZRangeSpec in next 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.
why not this pr, i don't think we should import different function to deal with similar things
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 have no strong opinion for this. Could you merge these structures and functions in this PR? @tanruixiang
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 have no strong opinion for this. Could you merge these structures and functions in this PR? @tanruixiang
Ok. Sorry to have missed this comment.
src/types/redis_hash.cc
Outdated
@@ -355,4 +383,36 @@ rocksdb::Status Hash::Scan(const Slice &user_key, const std::string &cursor, uin | |||
return SubKeyScanner::Scan(kRedisHash, user_key, cursor, limit, field_prefix, fields, values); | |||
} | |||
|
|||
Status Hash::ParseRangeLexSpec(const std::string &min, const std::string &max, CommonRangeLexSpec *spec) { |
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.
Could you move the function to range_spec.cc, so it can be reused in zset and hash?
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.
OK, I am very sorry for missing this function.
src/common/range_spce.cc
Outdated
@@ -0,0 +1,53 @@ | |||
/* |
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 is a typo in the filename :)
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. cc @git-hulk @ShooterIT
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.
Thanks for your impressive work @tanruixiang
Thanks all. Merging... |
This close #1118 and #1082 .