PragmaTwice commented on code in PR #3072: URL: https://github.com/apache/kvrocks/pull/3072#discussion_r2224158789
########## src/storage/redis_metadata.cc: ########## @@ -537,3 +537,25 @@ rocksdb::Status TDigestMetadata::Decode(Slice *input) { return rocksdb::Status::OK(); } + +void TimeSeriesMetadata::Encode(std::string *dst) const { + Metadata::Encode(dst); + PutFixed64(dst, retention_time); + PutFixed64(dst, chunk_size); + PutFixed8(dst, static_cast<uint8_t>(chunk_type)); + PutFixed8(dst, static_cast<uint8_t>(duplicate_policy)); + PutSizedString(dst, source_key); +} + +rocksdb::Status TimeSeriesMetadata::Decode(Slice *input) { + if (auto s = Metadata::Decode(input); !s.ok()) { + return s; + } + GetFixed64(input, &retention_time); + GetFixed64(input, &chunk_size); + GetFixed8(input, reinterpret_cast<uint8_t *>(&chunk_type)); + GetFixed8(input, reinterpret_cast<uint8_t *>(&duplicate_policy)); + GetSizedString(input, &source_key); + + return rocksdb::Status::OK(); +} Review Comment: ```suggestion } ``` Would you like to add a newline in the end of the file? -- 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-unsubscr...@kvrocks.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org