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


##########
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:
   You can just add the StringDigest function, otherwise this PR cannot be 
merged.



##########
tests/cppunit/types/string_test.cc:
##########
@@ -367,4 +528,4 @@ TEST_F(RedisStringTest, LCS) {
                     },
                     4},
                    std::get<StringLCSIdxResult>(rst));
-}
+}

Review Comment:
   ```suggestion
   }
   
   ```



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