poc-write-path:

Add allocation tracking to `BulkMemtable` methods

 - Updated `write_bulk` in `bulk.rs` to track memory allocation using `alloc_tracker.on_allocation`.
 - Modified `freeze` in `bulk.rs` to signal completion of allocation with `alloc_tracker.done_allocating`.
This commit is contained in:
Lei, HUANG
2025-02-06 09:17:37 +00:00
parent 1a73a40bd9
commit d10c207371

View File

@@ -133,6 +133,7 @@ impl Memtable for BulkMemtable {
}
fn write_bulk(&self, fragment: BulkPart) -> Result<()> {
self.alloc_tracker.on_allocation(fragment.data.len());
let mut parts = self.parts.write().unwrap();
parts.push(fragment);
Ok(())
@@ -163,6 +164,7 @@ impl Memtable for BulkMemtable {
}
fn freeze(&self) -> Result<()> {
self.alloc_tracker.done_allocating();
Ok(())
}