pub trait WriteBufferManager:
Send
+ Sync
+ Debug {
// Required methods
fn should_flush_engine(&self) -> bool;
fn should_stall(&self) -> bool;
fn reserve_mem(&self, mem: usize);
fn schedule_free_mem(&self, mem: usize);
fn free_mem(&self, mem: usize);
fn memory_usage(&self) -> usize;
fn flush_limit(&self) -> usize;
}Expand description
Global write buffer (memtable) manager.
Tracks write buffer (memtable) usages and decide whether the engine needs to flush.
Required Methods§
Sourcefn should_flush_engine(&self) -> bool
fn should_flush_engine(&self) -> bool
Returns whether to trigger the engine.
Sourcefn should_stall(&self) -> bool
fn should_stall(&self) -> bool
Returns whether to stall write requests.
Sourcefn reserve_mem(&self, mem: usize)
fn reserve_mem(&self, mem: usize)
Reserves mem bytes.
Sourcefn schedule_free_mem(&self, mem: usize)
fn schedule_free_mem(&self, mem: usize)
Tells the manager we are freeing mem bytes.
We are in the process of freeing mem bytes, so it is not considered
when checking the soft limit.
Sourcefn memory_usage(&self) -> usize
fn memory_usage(&self) -> usize
Returns the total memory used by memtables.
Sourcefn flush_limit(&self) -> usize
fn flush_limit(&self) -> usize
Returns the mutable memtable memory limit.
The write buffer manager should flush memtables when the mutable memory usage exceeds this limit.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".