Valay17 commented on code in PR #3317:
URL: https://github.com/apache/kvrocks/pull/3317#discussion_r2653886070


##########
src/types/redis_string.cc:
##########
@@ -181,6 +182,48 @@ 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, std::optional<char> &opt_,
+                              std::optional<std::string> &hash_or_val_, 
std::optional<bool> &res_) {
+  std::string ns_key = AppendNamespacePrefix(user_key);
+  std::string value;
+  rocksdb::Status s = getValue(ctx, ns_key, &value);
+  if (!s.ok() || s.IsNotFound()) {
+    return s;
+  }
+  if (!opt_.has_value() && !hash_or_val_.has_value()) {
+    return storage_->Delete(ctx, storage_->DefaultWriteOptions(), 
metadata_cf_handle_, ns_key);
+  }
+  switch (opt_.value()) {
+    case '1':
+      if (hash_or_val_.value() == "12345") {  // StringDigest(value)
+        res_ = true;
+      }
+      break;
+    case '2':
+      if (hash_or_val_.value() != "12345") {  // StringDigest(value)
+        res_ = true;

Review Comment:
   Understood. I’ll add the StringDigest function before the final PR.



-- 
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]

Reply via email to