mito2::flush

Trait WriteBufferManager

Source
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;
}
Expand description

Global write buffer (memtable) manager.

Tracks write buffer (memtable) usages and decide whether the engine needs to flush.

Required Methods§

Source

fn should_flush_engine(&self) -> bool

Returns whether to trigger the engine.

Source

fn should_stall(&self) -> bool

Returns whether to stall write requests.

Source

fn reserve_mem(&self, mem: usize)

Reserves mem bytes.

Source

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.

Source

fn free_mem(&self, mem: usize)

We have freed mem bytes.

Source

fn memory_usage(&self) -> usize

Returns the total memory used by memtables.

Implementors§