finish 2.1 and tests

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>
This commit is contained in:
Alex Chi Z
2024-01-23 13:44:48 +08:00
parent bb8eb4a1a2
commit 274a2cb7a2
28 changed files with 651 additions and 61 deletions

View File

@@ -5,7 +5,7 @@ use bytes::Bytes;
use crate::{
iterators::StorageIterator,
lsm_storage::BlockCache,
lsm_storage::{BlockCache, LsmStorageInner},
table::{SsTable, SsTableBuilder},
};
@@ -123,3 +123,11 @@ pub fn generate_sst(
}
builder.build(id, block_cache, path.as_ref()).unwrap()
}
pub fn sync(storage: &LsmStorageInner) {
storage
.force_freeze_memtable(&storage.state_lock.lock())
.unwrap();
storage.force_flush_next_imm_memtable().unwrap();
}