Trait EventListener

Source
pub trait EventListener: Sync + Send {
    // Provided methods
    fn post_new_log_file(&self, _file_id: FileId) { ... }
    fn on_append_log_file(&self, _handle: FileBlockHandle) { ... }
    fn post_apply_memtables(&self, _file_id: FileId) { ... }
    fn first_file_not_ready_for_purge(
        &self,
        _queue: LogQueue,
    ) -> Option<FileSeq> { ... }
    fn post_purge(&self, _file_id: FileId) { ... }
}
Expand description

EventListener contains a set of callback functions that will be notified on specific events inside Raft Engine.

§Threading

Different callbacks are called under different threading contexts. on_append_log_file, for example, will be called under a global lock of one specific queue.

Provided Methods§

Source

fn post_new_log_file(&self, _file_id: FileId)

Called after a new log file is created.

Source

fn on_append_log_file(&self, _handle: FileBlockHandle)

Called before a LogBatch has been written into a log file.

Source

fn post_apply_memtables(&self, _file_id: FileId)

Called after a LogBatch has been applied to the MemTable.

Source

fn first_file_not_ready_for_purge(&self, _queue: LogQueue) -> Option<FileSeq>

Returns the oldest file sequence number that are not ready to be purged.

Source

fn post_purge(&self, _file_id: FileId)

Called after a log file is purged.

Implementors§