Struct bitcoinleveldb_version::Compaction
source · pub struct Compaction { /* private fields */ }
Expand description
| A Compaction encapsulates information | about a compaction. |
Implementations§
source§impl Compaction
impl Compaction
pub fn new(options: *const Options, level: i32) -> Self
sourcepub fn is_trivial_move(&self) -> bool
pub fn is_trivial_move(&self) -> bool
| Is this a trivial compaction that can be | implemented by just moving a single input | file to the next level (no merging or | splitting)
sourcepub fn add_input_deletions(&mut self, edit: *mut VersionEdit)
pub fn add_input_deletions(&mut self, edit: *mut VersionEdit)
| Add all inputs to this compaction as | delete operations to *edit. |
sourcepub fn is_base_level_for_key(&mut self, user_key_: &Slice) -> bool
pub fn is_base_level_for_key(&mut self, user_key_: &Slice) -> bool
| Returns true if the information we have | available guarantees that the compaction is | producing data in “level+1” for which no data | exists in levels greater than “level+1”.
sourcepub fn should_stop_before(&mut self, internal_key_: &Slice) -> bool
pub fn should_stop_before(&mut self, internal_key_: &Slice) -> bool
| Returns true iff we should stop building | the current output before processing | “internal_key”. |
sourcepub fn release_inputs(&mut self)
pub fn release_inputs(&mut self)
| Release the input version for the compaction, | once the compaction is successful. |
sourcepub fn level(&self) -> i32
pub fn level(&self) -> i32
| Return the level that is being compacted. | | Inputs from “level” and “level+1” will | be merged to produce a set of “level+1” | files. |
sourcepub fn edit(&mut self) -> *mut VersionEdit
pub fn edit(&mut self) -> *mut VersionEdit
| Return the object that holds the edits | to the descriptor done by this compaction. |
sourcepub fn num_input_files(&self, which: i32) -> i32
pub fn num_input_files(&self, which: i32) -> i32
| “which” must be either 0 or 1 |
sourcepub fn input(&self, which: i32, i: i32) -> *mut FileMetaData
pub fn input(&self, which: i32, i: i32) -> *mut FileMetaData
| Return the ith input file at “level()+which” | (“which” must be 0 or 1). |
sourcepub fn max_output_file_size(&self) -> u64
pub fn max_output_file_size(&self) -> u64
| Maximum size of files to build during | this compaction. |