Struct raft_engine::Config
source · [−]pub struct Config {
pub dir: String,
pub recovery_mode: RecoveryMode,
pub recovery_read_block_size: ReadableSize,
pub recovery_threads: usize,
pub batch_compression_threshold: ReadableSize,
pub bytes_per_sync: ReadableSize,
pub target_file_size: ReadableSize,
pub purge_threshold: ReadableSize,
pub purge_rewrite_threshold: Option<ReadableSize>,
pub purge_rewrite_garbage_ratio: f64,
pub memory_limit: Option<ReadableSize>,
}Fields
dir: StringDirectory to store log files. Will create on startup if not exists.
Default: “”
recovery_mode: RecoveryModeHow to deal with file corruption during recovery.
Default: “tolerate-tail-corruption”.
recovery_read_block_size: ReadableSizeMinimum I/O size for reading log files during recovery.
Default: “4KB”. Minimum: “512B”.
recovery_threads: usizeThe number of threads used to scan and recovery log files.
Default: 4. Minimum: 1.
batch_compression_threshold: ReadableSizeCompress a log batch if its size exceeds this value. Setting it to zero disables compression.
Default: “8KB”
bytes_per_sync: ReadableSizeIncrementally sync log files after specified bytes have been written. Setting it to zero disables incremental sync.
Default: “4MB”
target_file_size: ReadableSizeTarget file size for rotating log files.
Default: “128MB”
purge_threshold: ReadableSizePurge append log queue if its size exceeds this value.
Default: “10GB”
purge_rewrite_threshold: Option<ReadableSize>Purge rewrite log queue if its size exceeds this value.
Default: MAX(purge_threshold / 10, target_file_size)
purge_rewrite_garbage_ratio: f64Purge rewrite log queue if its garbage ratio exceeds this value.
Default: “0.6”
memory_limit: Option<ReadableSize>Maximum memory bytes allowed for the in-memory index.
Effective under the swap feature only.
Default: None
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Config where
Config: Default,
impl<'de> Deserialize<'de> for Config where
Config: Default,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Config
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more