patch memtable and add ts for wal

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-25 23:09:16 +08:00
parent 89acc23208
commit 218c73f384
11 changed files with 256 additions and 96 deletions

View File

@@ -70,7 +70,9 @@ impl SsTableBuilder {
first_key: std::mem::take(&mut self.first_key).into_key_bytes(),
last_key: std::mem::take(&mut self.last_key).into_key_bytes(),
});
let checksum = crc32fast::hash(&encoded_block);
self.data.extend(encoded_block);
self.data.put_u32(checksum);
}
/// Builds the SSTable and writes it to the given path. Use the `FileObject` structure to manipulate the disk objects.