mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-26 16:10:02 +00:00
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:
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user