git-hulk commented on code in PR #3313:
URL: https://github.com/apache/kvrocks/pull/3313#discussion_r2650068790
##########
src/types/redis_string.cc:
##########
@@ -657,4 +659,20 @@ rocksdb::Status String::LCS(engine::Context &ctx, const
std::string &user_key1,
return rocksdb::Status::OK();
}
+std::string String::ComputeXXH3Hash(const std::string &data) {
+ uint64_t hash = XXH3_64bits(data.data(), data.size());
+ return fmt::format("{:016x}", hash);
+}
+
+rocksdb::Status String::Digest(engine::Context &ctx, const std::string
&user_key, std::string *digest) {
+ std::string value;
+ auto s = Get(ctx, user_key, &value);
+ if (!s.ok()) {
+ return s;
+ }
+
+ *digest = ComputeXXH3Hash(value);
+ return rocksdb::Status::OK();
+}
+
Review Comment:
I totally agree to drop the support of bitmap in string, because it might
introduce the unexpected performance issue if users incorrectly read the bitmap
as a string.
--
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]