Trait engine_traits::raft_engine::RaftEngine [−][src]
Associated Types
type LogBatch: RaftLogBatch
[src]
Required methods
fn log_batch(&self, capacity: usize) -> Self::LogBatch
[src]
fn sync(&self) -> Result<()>
[src]
Synchronize the Raft engine.
fn get_raft_state(&self, raft_group_id: u64) -> Result<Option<RaftLocalState>>
[src]
fn get_entry(&self, raft_group_id: u64, index: u64) -> Result<Option<Entry>>
[src]
fn fetch_entries_to(
&self,
raft_group_id: u64,
begin: u64,
end: u64,
max_size: Option<usize>,
to: &mut Vec<Entry>
) -> Result<usize>
[src]
&self,
raft_group_id: u64,
begin: u64,
end: u64,
max_size: Option<usize>,
to: &mut Vec<Entry>
) -> Result<usize>
Return count of fetched entries.
fn consume(&self, batch: &mut Self::LogBatch, sync: bool) -> Result<usize>
[src]
Consume the write batch by moving the content into the engine itself and return written bytes.
fn consume_and_shrink(
&self,
batch: &mut Self::LogBatch,
sync: bool,
max_capacity: usize,
shrink_to: usize
) -> Result<usize>
[src]
&self,
batch: &mut Self::LogBatch,
sync: bool,
max_capacity: usize,
shrink_to: usize
) -> Result<usize>
Like consume
but shrink batch
if need.
fn clean(
&self,
raft_group_id: u64,
state: &RaftLocalState,
batch: &mut Self::LogBatch
) -> Result<()>
[src]
&self,
raft_group_id: u64,
state: &RaftLocalState,
batch: &mut Self::LogBatch
) -> Result<()>
fn append(&self, raft_group_id: u64, entries: Vec<Entry>) -> Result<usize>
[src]
Append some log entries and return written bytes.
Note: RaftLocalState
won’t be updated in this call.
fn put_raft_state(
&self,
raft_group_id: u64,
state: &RaftLocalState
) -> Result<()>
[src]
&self,
raft_group_id: u64,
state: &RaftLocalState
) -> Result<()>
fn gc(&self, raft_group_id: u64, from: u64, to: u64) -> Result<usize>
[src]
Like cut_logs
but the range could be very large. Return the deleted count.
Generally, from
can be passed in 0
.
fn purge_expired_files(&self) -> Result<Vec<u64>>
[src]
Purge expired logs files and return a set of Raft group ids which needs to be compacted ASAP.
fn dump_stats(&self) -> Result<String>
[src]
Provided methods
fn has_builtin_entry_cache(&self) -> bool
[src]
The RaftEngine
has a builtin entry cache or not.
fn gc_entry_cache(&self, _raft_group_id: u64, _to: u64)
[src]
GC the builtin entry cache.