zealchen commented on issue #1600: URL: https://github.com/apache/horaedb/issues/1600#issuecomment-2519265285
> The general ideas looks GOOD for me, but I wonder if you put length in the middle the manifest, how would you update it when append new record? Since the Bytes obtained from object storage is a fixed-length object, each time we merge SST files, we need to create a new Vec<u8> with a capacity equal to the original bytes length plus the number of records multiplied by the record length. Following that, We make Vec<u8> as_mut_slice [u8] and then: 1. create the new header struct and write it to slice[0..header_length]. 2. copy original records bytes to slice[header_length..header_length+original_record_length]. 3. for each sstfiles, write record to the rest for slice one by one. Another way is to: 1. copy original bytes to slice [0..header_length+original_record_length] 2. update the slice at length field position with the new length. 3. for each sstfiles, write record to the rest for slice one by one. I prefer the first way, looks more ergonomics. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
