You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "mapleFU (via GitHub)" <gi...@apache.org> on 2024/04/29 02:20:59 UTC
Re: [PR] Use the QUICKLIST encoding to dump the list payload to compatible with Redis >= 4 [kvrocks]
mapleFU commented on code in PR #2277:
URL: https://github.com/apache/kvrocks/pull/2277#discussion_r1582488599
##########
src/storage/rdb.cc:
##########
@@ -1005,3 +1000,35 @@ Status RDB::rdbSaveBinaryDoubleValue(double val) {
memrev64ifbe(&val);
return stream_->Write((const char *)(&val), sizeof(val));
}
+
+Status RDB::rdbSaveZipListObject(const std::string &elem) {
+ // calc total ziplist size
+ uint prevlen = 0;
+ const size_t ziplist_size = zlHeaderSize + zlEndSize + elem.length() +
+ ZipList::ZipStorePrevEntryLength(nullptr, prevlen) +
+ ZipList::ZipStoreEntryEncoding(nullptr, elem.length());
+ auto zl_string = std::string(ziplist_size, 0);
Review Comment:
Why the size would be 0? Isn't it same as `ziplist_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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org