pub struct Config {Show 17 fields
pub dir: String,
pub spill_dir: Option<String>,
pub recovery_mode: RecoveryMode,
pub recovery_read_block_size: ReadableSize,
pub recovery_threads: usize,
pub batch_compression_threshold: ReadableSize,
pub compression_level: Option<usize>,
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,
pub prefill_for_recycle: bool,
pub prefill_limit: Option<ReadableSize>,
}
Fields§
§dir: String
Main directory to store log files. Will create on startup if not exists.
Default: “”
spill_dir: Option<String>
Auxiliary directory to store log files. Will create on startup if set but not exists.
Newly logs will be put into this dir when the main dir
is full
and no spare space for new logs.
Default: None
recovery_mode: RecoveryMode
How to deal with file corruption during recovery.
Default: “tolerate-tail-corruption”.
recovery_read_block_size: ReadableSize
Minimum I/O size for reading log files during recovery.
Default: “16KB”. Minimum: “512B”.
recovery_threads: usize
The number of threads used to scan and recovery log files.
Default: 4. Minimum: 1.
batch_compression_threshold: ReadableSize
Compress a log batch if its size exceeds this value. Setting it to zero disables compression.
Default: “8KB”
compression_level: Option<usize>
Acceleration factor for LZ4 compression. It can be fine tuned, with each successive value providing roughly +~3% to speed. The value will be capped within [1, 65537] by LZ4.
Default: 1.
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: Version
Version of the log file.
Default: 2
target_file_size: ReadableSize
Target file size for rotating log files.
Default: “128MB”
purge_threshold: ReadableSize
Purge 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: f64
Purge 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: bool
Whether 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
prefill_for_recycle: bool
Whether to prepare log files for recycling when start.
If true
, batch empty log files will be prepared for recycling when
starting engine.
Only available for enable-log-reycle
is true.
Default: false
prefill_limit: Option<ReadableSize>
Maximum capacity for preparing log files for recycling when start.
If None
, its size is equal to purge-threshold
*1.5.
Only available for prefill-for-recycle
is true.
Default: None
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn 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>,
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more