ShooterIT commented on code in PR #538:
URL: https://github.com/apache/incubator-kvrocks/pull/538#discussion_r876918837
##########
src/server.cc:
##########
@@ -1422,3 +1412,24 @@ void Server::AdjustOpenFilesLimit() {
<< " (it's originally set to " << old_limit << ")";
}
}
+
+std::string ServerLogData::Encode() {
+ if (type_ == kReplIdLog) {
+ return std::string(1, kReplIdTag) + " " + content_;
+ } else {
+ return content_;
+ }
+}
+
+Status ServerLogData::Decode(const rocksdb::Slice &blob) {
+ if (blob.size() == 0) {
+ return Status(Status::NotOK);
+ }
+
+ const char *header = blob.data();
+ if (*header == kReplIdTag) {
+ type_ = kReplIdLog;
+ }
+ content_ = std::string(blob.data()+2, blob.size()-2);
Review Comment:
ok, it is more strict
--
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]