check compaction converge for simple leveled
Signed-off-by: Alex Chi Z <iskyzh@gmail.com>
This commit is contained in:
@@ -24,7 +24,7 @@ impl BlockBuilder {
|
||||
|
||||
fn estimated_size(&self) -> usize {
|
||||
SIZEOF_U16 /* number of key-value pairs in the block */ + self.offsets.len() * SIZEOF_U16 /* offsets */ + self.data.len()
|
||||
/* key-value pairs */
|
||||
// key-value pairs
|
||||
}
|
||||
|
||||
/// Adds a key-value pair to the block. Returns false when the block is full.
|
||||
|
||||
@@ -33,7 +33,8 @@ impl BlockMeta {
|
||||
// The size of actual key
|
||||
estimated_size += meta.first_key.len();
|
||||
}
|
||||
// Reserve the space to improve performance, especially when the size of incoming data is large
|
||||
// Reserve the space to improve performance, especially when the size of incoming data is
|
||||
// large
|
||||
buf.reserve(estimated_size);
|
||||
let original_len = buf.len();
|
||||
for meta in block_meta {
|
||||
|
||||
Reference in New Issue
Block a user