17
mini-lsm-starter/src/debug.rs
Normal file
17
mini-lsm-starter/src/debug.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use crate::lsm_storage::MiniLsm;
|
||||
|
||||
impl MiniLsm {
|
||||
pub fn dump_structure(&self) {
|
||||
let snapshot = self.inner.state.read();
|
||||
if !snapshot.l0_sstables.is_empty() {
|
||||
println!(
|
||||
"L0 ({}): {:?}",
|
||||
snapshot.l0_sstables.len(),
|
||||
snapshot.l0_sstables,
|
||||
);
|
||||
}
|
||||
for (level, files) in &snapshot.levels {
|
||||
println!("L{level} ({}): {:?}", files.len(), files);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user