Struct raft_engine::Config
source · [−]pub struct Config {Show 13 fields
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: Option<ReadableSize>,
pub format_version: Version,
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>,
pub enable_log_recycle: bool,
}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: “16KB”. 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: Option<ReadableSize>Deprecated. Incrementally sync log files after specified bytes have been written. Setting it to zero disables incremental sync.
Default: “4MB”
format_version: VersionVersion of the log file.
Default: 2
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
enable_log_recycle: boolWhether to recycle stale log files.
If true, logically purged log files will be reserved for recycling.
Only available for format_version 2 and above.
Default: true
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Configwhere
Config: Default,
impl<'de> Deserialize<'de> for Configwhere
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
sourceimpl PartialEq<Config> for Config
impl PartialEq<Config> for Config
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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