-
Notifications
You must be signed in to change notification settings - Fork 591
feat(delex): Implement DELEX Command #3317
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
base: unstable
Are you sure you want to change the base?
Conversation
| while (parser.Good()) { | ||
| if (parser.EatEqICase("ifdeq")) { | ||
| opt_ = '1'; | ||
| hash_or_val_ = GET_OR_RET(parser.TakeStr()); | ||
| } else if (parser.EatEqICase("ifdne")) { | ||
| opt_ = '2'; | ||
| hash_or_val_ = GET_OR_RET(parser.TakeStr()); | ||
| } else if (parser.EatEqICase("ifeq")) { | ||
| opt_ = '3'; | ||
| hash_or_val_ = GET_OR_RET(parser.TakeStr()); | ||
| } else if (parser.EatEqICase("ifne")) { | ||
| opt_ = '4'; | ||
| hash_or_val_ = GET_OR_RET(parser.TakeStr()); | ||
| } else { | ||
| return {Status::RedisParseErr, errInvalidSyntax}; |
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.
Please use an enum class instead of meaningless chars like 1, 2, 3, 4.
| rocksdb::Status String::DelEX(engine::Context &ctx, const std::string &user_key, std::optional<char> &opt_, | ||
| std::optional<std::string> &hash_or_val_, std::optional<bool> &res_) { |
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 String::DelEX(engine::Context &ctx, const std::string &user_key, std::optional<char> &opt_, | |
| std::optional<std::string> &hash_or_val_, std::optional<bool> &res_) { | |
| rocksdb::Status String::DelEX(engine::Context &ctx, const std::string &user_key, const DelExOption &option, bool &deleted) { |
| if (hash_or_val_.value() == "12345") { // StringDigest(value) | ||
| res_ = true; | ||
| } | ||
| break; | ||
| case '2': | ||
| if (hash_or_val_.value() != "12345") { // StringDigest(value) | ||
| res_ = true; |
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.
You can just add the StringDigest function, otherwise this PR cannot be merged.
| 4}, | ||
| std::get<StringLCSIdxResult>(rst)); | ||
| } | ||
| } |
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.
Hey thank you for your contribution, could you please add some golang test cases?
Fixes #3310
Implement DELEX Command
Digest function commented out