add compaction tests and fix bugs in compaction

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-25 15:25:23 +08:00
parent 971d0b1c81
commit 8dbaf54e38
23 changed files with 379 additions and 42 deletions

View File

@@ -90,6 +90,16 @@ impl LsmStorageOptions {
num_memtable_limit: 2,
}
}
pub fn default_for_week2_test(compaction_options: CompactionOptions) -> Self {
Self {
block_size: 4096,
target_sst_size: 1 << 20, // 1MB
compaction_options,
enable_wal: false,
num_memtable_limit: 2,
}
}
}
/// The storage interface of the LSM tree.