pub struct CompactConfig {
pub max_space_amplification_percent: u16,
pub min_bottom_merge_bytes: u64,
pub max_files_above_bottom: usize,
pub size_ratio_percent: u16,
pub rewrite_per_fresh_byte: f32,
pub max_merge_jobs: usize,
}Expand description
Configuration for the compaction algorithm.
Fields§
§max_space_amplification_percent: u16A shard is merged into a new bottom run when the files above its bottom run are larger than
this percentage of the bottom run. E.g. 50 merges a shard with a 100MB bottom run once
more than 50MB are above it. 0 merges every shard that has files above its bottom run.
min_bottom_merge_bytes: u64A shard is only merged into a new bottom run when at least this many bytes are above its bottom run. This is to avoid tiny families that always rewrite everything doing constant full merges and starving other work.
max_files_above_bottom: usizeThe files above the bottom run of a shard are merged when there are more than this many (at least one, since merging a single file would only move it).
size_ratio_percent: u16An intermediate merge takes the newest file above the bottom run, and then each next older
one that is at most this percentage larger than the files taken so far, but at least the
two newest. E.g. with 100, a file joins while it’s at most twice the size of the newer
files combined. This is the size ratio of RocksDB’s universal compaction.
rewrite_per_fresh_byte: f32Bottom merges of a family are scheduled until they rewrote this many bytes per byte of its
fresh files; the last one may go past it, and the first one always runs. E.g. with 3.0,
after commits wrote 10MB to a family, no more bottom merges are scheduled once they rewrote
30MB, except for shards far behind.
max_merge_jobs: usizeThe maximum number of merge jobs in a compaction, across all families. Merge jobs run in parallel, so this bounds the work of a compaction. It doesn’t limit the number of files merged by a job.
Implementations§
Source§impl CompactConfig
impl CompactConfig
Trait Implementations§
Source§impl Clone for CompactConfig
impl Clone for CompactConfig
impl Copy for CompactConfig
Source§impl Debug for CompactConfig
impl Debug for CompactConfig
Auto Trait Implementations§
impl Freeze for CompactConfig
impl RefUnwindSafe for CompactConfig
impl Send for CompactConfig
impl Sync for CompactConfig
impl Unpin for CompactConfig
impl UnsafeUnpin for CompactConfig
impl UnwindSafe for CompactConfig
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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