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


##########
src/types/redis_json.cc:
##########
@@ -627,4 +627,24 @@ std::vector<rocksdb::Status> Json::readMulti(const 
std::vector<Slice> &ns_keys,
   return statuses;
 }
 
+rocksdb::Status Json::DebugMemory(const std::string &user_key, const 
std::string &path, Optionals<uint64_t> *results) {
+  auto ns_key = AppendNamespacePrefix(user_key);
+  JsonMetadata metadata;
+  if (path == "$") {
+    std::string bytes;
+    Slice rest;
+    auto s = GetMetadata(GetOptions{}, {kRedisJson}, ns_key, &bytes, 
&metadata, &rest);
+    if (!s.ok()) return s;
+    results->emplace_back(bytes.size());

Review Comment:
   ```suggestion
       results->emplace_back(rest.size());
   ```



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