Skip to main content

FifoCompactOptions

Struct FifoCompactOptions 

Source
pub struct FifoCompactOptions { /* private fields */ }

Implementations§

Source§

impl FifoCompactOptions

Source

pub fn set_max_table_files_size(&mut self, nbytes: u64)

Sets the max table file size.

Once the total sum of table files reaches this, we will delete the oldest table file

Default: 1GB

Source

pub fn set_age_for_warm(&mut self, val: u64)

DEPRECATED When not 0, if the data in the file is older than this threshold, RocksDB will soon move the file to warm temperature.

Source

pub fn get_age_for_warm(&self) -> u64

Returns the value of the age_for_warm option.

Source

pub fn set_allow_trivial_copy_when_change_temperature(&mut self, val: bool)

EXPERIMENTAL If true, when compaction is picked for kChangeTemperature reason, allow the trivia copy of the sst file from source FileSystem to destination FileSystem. If false, the changeTemperature will be the non-trivial copy by iterating/appending blocks by blocks of the sst file.

Source

pub fn get_allow_trivial_copy_when_change_temperature(&self) -> bool

Returns the value of the allow_trivial_copy_when_change_temperature option.

Source

pub fn set_trivial_copy_buffer_size(&mut self, val: u64)

EXPERIMENTAL If ‘allow_trivia_copy_op_when_change_temperature=true’, the tmp buffer size to copy the file from the source FileSystem to the destnation FileSystem. If ‘allow_trivia_copy_op_when_change_temperature=false’, this field will not be used. The minmum buffer size must be at least 4KiB

Source

pub fn get_trivial_copy_buffer_size(&self) -> u64

Returns the value of the trivial_copy_buffer_size option.

Source

pub fn get_allow_compaction(&self) -> bool

Returns the current allow_compaction setting.

See Self::set_allow_compaction for what this controls.

Source

pub fn get_max_data_files_size(&self) -> u64

Returns the current max_data_files_size setting.

See Self::set_max_data_files_size for what this controls.

Source

pub fn get_max_table_files_size(&self) -> u64

Returns the current max_table_files_size setting.

See Self::set_max_table_files_size for what this controls.

Source

pub fn get_use_kv_ratio_compaction(&self) -> bool

Returns the current use_kv_ratio_compaction setting.

See Self::set_use_kv_ratio_compaction for what this controls.

Source

pub fn set_allow_compaction(&mut self, val: bool)

If true, try to do compaction to compact smaller files into larger ones. Minimum files to compact follows options.level0_file_num_compaction_trigger and compaction won’t trigger if average compact bytes per del file is larger than options.write_buffer_size. This is to protect large files from being compacted again. Default: false;

Source

pub fn set_max_data_files_size(&mut self, val: u64)

When non-zero, FIFO compaction uses the combined size of SST files and blob files for size-based trimming decisions. When the total data size (SST + blob) exceeds this limit, the oldest SST files are dropped along with their associated blob files.

When non-zero, this takes precedence over max_table_files_size for all FIFO compaction decisions: size-based dropping, TTL threshold checks, and compaction score computation. max_table_files_size is ignored.

When zero (default), FIFO compaction uses max_table_files_size which only considers SST file sizes, maintaining backward compatibility.

This option is primarily intended for use with integrated BlobDB where blob files can represent a significant portion of the total data.

Dynamically changeable through SetOptions() API. Default: 0 (use max_table_files_size behavior).

Source

pub fn set_use_kv_ratio_compaction(&mut self, val: bool)

When true, enables a capacity-derived intra-L0 compaction strategy optimized for BlobDB workloads where SST files are much smaller than write_buffer_size. Uses the observed key/value size ratio (SST vs blob file sizes) to compute a target compacted file size, producing uniform files for predictable FIFO trimming.

Uses level0_file_num_compaction_trigger as the target max L0 file count.

When max_compaction_bytes is 0, the target is auto-calculated from the data capacity and observed SST/blob ratio. When max_compaction_bytes is explicitly set to a non-zero value, it overrides the auto-calculated target.

Recommends:

  • allow_compaction = true (master switch for intra-L0 compaction)
  • max_data_files_size > 0 (needed to compute the target file size) If these are not met, kv_ratio compaction is skipped and the old cost-based intra-L0 compaction algorithm is used as a fallback.

When false, the old intra-L0 strategy is used if allow_compaction is true (PickCostBasedIntraL0Compaction with 1.1 * write_buffer_size guard).

Dynamically changeable through SetOptions() API. Default: false.

Trait Implementations§

Source§

impl Default for FifoCompactOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for FifoCompactOptions

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.