pub struct CompactionOptions {
pub max_segments: usize,
pub max_segment_bytes: u64,
}Expand description
Settings for Namespace::compact.
Fields§
§max_segments: usizeThe most live segments a namespace may end up with. When one more fold would exceed it, every segment is merged into a single base instead. Zero is treated as one.
max_segment_bytes: u64The most stored bytes one segment’s data.bin may hold. A merge
produces as many size-balanced, contiguous segments as this cap
requires, instead of collapsing everything into one. The trigger looks
at data.bin only, never an index object beside it; a merge sizes its
groups by what each segment charges its budget, sparse.bin included,
so with heavy sparse vectors the outputs come out smaller than the cap.
A merge needs it at or under the handle’s read budget, since it reads
each group under a budget of its own; see
validate.
Implementations§
Source§impl CompactionOptions
impl CompactionOptions
Sourcepub fn validate(&self, read_budget: u64) -> Result<()>
pub fn validate(&self, read_budget: u64) -> Result<()>
Check the options against the read budget of the handle that will run
a merge with them. Namespace::compact
calls this once it knows a merge is due, before any segment is read; a
fold does not need it.
§Errors
ItzmaError::InvalidConfig when max_segment_bytes is above
read_budget: a merge group that size could never be read.
A merge sizes its groups by what each segment charges (data.bin,
sparse.bin and the guesses of a ranged open) and splits any group
over the cap, so once this passes every group fits the budget, unless
one segment alone charges more than it.
Trait Implementations§
Source§impl Clone for CompactionOptions
impl Clone for CompactionOptions
impl Copy for CompactionOptions
Source§impl Debug for CompactionOptions
impl Debug for CompactionOptions
Source§impl Default for CompactionOptions
impl Default for CompactionOptions
impl Eq for CompactionOptions
Source§impl PartialEq for CompactionOptions
impl PartialEq for CompactionOptions
impl StructuralPartialEq for CompactionOptions
Auto Trait Implementations§
impl Forget for CompactionOptions
impl Freeze for CompactionOptions
impl Move for CompactionOptions
impl RefUnwindSafe for CompactionOptions
impl Send for CompactionOptions
impl Sync for CompactionOptions
impl Unpin for CompactionOptions
impl UnsafeUnpin for CompactionOptions
impl UnwindSafe for CompactionOptions
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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