PragmaTwice commented on code in PR #3317:
URL: https://github.com/apache/kvrocks/pull/3317#discussion_r2655089423
##########
src/types/redis_string.cc:
##########
@@ -181,6 +182,47 @@ rocksdb::Status String::GetEx(engine::Context &ctx, const
std::string &user_key,
return rocksdb::Status::OK();
}
+rocksdb::Status String::DelEX(engine::Context &ctx, const std::string
&user_key, DelExOption &option, bool &deleted) {
+ std::string ns_key = AppendNamespacePrefix(user_key);
+ std::string value;
+ rocksdb::Status s = getValue(ctx, ns_key, &value);
+ if (!s.ok()) return s;
+
+ if (option.type == DelExOption::Type::NONE && option.value == "") {
+ return storage_->Delete(ctx, storage_->DefaultWriteOptions(),
metadata_cf_handle_, ns_key);
+ }
Review Comment:
```suggestion
if (option.type == DelExOption::Type::NONE) {
deleted = true;
return storage_->Delete(ctx, storage_->DefaultWriteOptions(),
metadata_cf_handle_, ns_key);
}
```
##########
src/types/redis_string.cc:
##########
@@ -181,6 +182,47 @@ rocksdb::Status String::GetEx(engine::Context &ctx, const
std::string &user_key,
return rocksdb::Status::OK();
}
+rocksdb::Status String::DelEX(engine::Context &ctx, const std::string
&user_key, DelExOption &option, bool &deleted) {
Review Comment:
```suggestion
rocksdb::Status String::DelEX(engine::Context &ctx, const std::string
&user_key, const DelExOption &option, bool &deleted) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]