pub struct FifoCompactOptions { /* private fields */ }Implementations§
Source§impl FifoCompactOptions
impl FifoCompactOptions
Sourcepub fn set_max_table_files_size(&mut self, nbytes: u64)
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
Sourcepub fn set_age_for_warm(&mut self, val: u64)
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.
Sourcepub fn get_age_for_warm(&self) -> u64
pub fn get_age_for_warm(&self) -> u64
Returns the value of the age_for_warm option.
Sourcepub fn set_allow_trivial_copy_when_change_temperature(&mut self, val: bool)
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.
Sourcepub fn get_allow_trivial_copy_when_change_temperature(&self) -> bool
pub fn get_allow_trivial_copy_when_change_temperature(&self) -> bool
Returns the value of the allow_trivial_copy_when_change_temperature option.
Sourcepub fn set_trivial_copy_buffer_size(&mut self, val: u64)
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
Sourcepub fn get_trivial_copy_buffer_size(&self) -> u64
pub fn get_trivial_copy_buffer_size(&self) -> u64
Returns the value of the trivial_copy_buffer_size option.
Sourcepub fn get_allow_compaction(&self) -> bool
pub fn get_allow_compaction(&self) -> bool
Returns the current allow_compaction setting.
See Self::set_allow_compaction for what this controls.
Sourcepub fn get_max_data_files_size(&self) -> u64
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.
Sourcepub fn get_max_table_files_size(&self) -> u64
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.
Sourcepub fn get_use_kv_ratio_compaction(&self) -> bool
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.
Sourcepub fn set_allow_compaction(&mut self, val: bool)
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;
Sourcepub fn set_max_data_files_size(&mut self, val: u64)
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).
Sourcepub fn set_use_kv_ratio_compaction(&mut self, val: bool)
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.