mapleFU commented on code in PR #2524:
URL: https://github.com/apache/kvrocks/pull/2524#discussion_r1756286475


##########
src/storage/redis_metadata.h:
##########
@@ -335,3 +336,15 @@ class HyperLogLogMetadata : public Metadata {
 
   EncodeType encode_type = EncodeType::DENSE;
 };
+
+class CountMinSketchMetadata : public Metadata {
+ public:
+  uint32_t width;
+  uint32_t depth;
+  uint64_t counter = 0;
+  std::vector<uint32_t> array;

Review Comment:
   @git-hulk @PragmaTwice 
   
   I'm thinking about handling the `array`. Since regarding the cmsketch as a 
string is ok to me, but parsing it to an `std::vector` is a bit weird to me. 
Can we take a `Buffer` and do zero copying when doing this?
   
   Like:
   ```
   LoadMetadata from string. When storing, forcing LittleEndian in the array
   When reading from metadata, report error if not length enough, and hold a 
sliced buffer on underlying data
   When read/write, using memcpy to avoid unaligned access.
   ```



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