Struct bitcoinleveldb_version::VersionSet
source · pub struct VersionSet { /* private fields */ }
Expand description
Implementations§
source§impl VersionSet
impl VersionSet
sourcepub fn manifest_file_number(&self) -> u64
pub fn manifest_file_number(&self) -> u64
| Return the current manifest file number |
sourcepub fn new_file_number(&mut self) -> u64
pub fn new_file_number(&mut self) -> u64
| Allocate and return a new file number |
sourcepub fn reuse_file_number(&mut self, file_number: u64)
pub fn reuse_file_number(&mut self, file_number: u64)
| Arrange to reuse “file_number” unless a newer | file number has already been allocated. | | REQUIRES: “file_number” was returned by | a call to NewFileNumber().
sourcepub fn last_sequence(&self) -> u64
pub fn last_sequence(&self) -> u64
| Return the last sequence number. |
sourcepub fn set_last_sequence(&mut self, s: u64)
pub fn set_last_sequence(&mut self, s: u64)
| Set the last sequence number to s. |
sourcepub fn log_number(&self) -> u64
pub fn log_number(&self) -> u64
| Return the current log file number. |
sourcepub fn prev_log_number(&self) -> u64
pub fn prev_log_number(&self) -> u64
| Return the log file number for the log | file that is currently being compacted, | or zero if there is no such log file. |
sourcepub fn needs_compaction(&self) -> bool
pub fn needs_compaction(&self) -> bool
| Returns true iff some level needs a compaction. |
pub fn new( dbname: &String, options: *const Options, table_cache: *mut TableCache, cmp: *const InternalKeyComparator ) -> Self
pub fn append_version(&mut self, v: *mut Version)
sourcepub fn log_and_apply(
&mut self,
edit: *mut VersionEdit,
mu: *mut RawMutex
) -> Status
pub fn log_and_apply( &mut self, edit: *mut VersionEdit, mu: *mut RawMutex ) -> Status
| Apply *edit to the current version to form | a new descriptor that is both saved to | persistent state and installed as the new | current version. Will release *mu while | actually writing to the file. | | REQUIRES: *mu is held on entry. | | REQUIRES: no other thread concurrently calls | LogAndApply()
sourcepub fn recover(&mut self, save_manifest: *mut bool) -> Status
pub fn recover(&mut self, save_manifest: *mut bool) -> Status
| Recover the last saved descriptor from | persistent storage. |
pub fn reuse_manifest(&mut self, dscname: &String, dscbase: &String) -> bool
sourcepub fn mark_file_number_used(&mut self, number: u64)
pub fn mark_file_number_used(&mut self, number: u64)
| Mark the specified file number as used. |
pub fn finalize(&mut self, v: *mut Version)
sourcepub fn write_snapshot(&mut self, log: *mut LogWriter) -> Status
pub fn write_snapshot(&mut self, log: *mut LogWriter) -> Status
| Save current contents to *log |
sourcepub fn num_level_files(&self, level: i32) -> i32
pub fn num_level_files(&self, level: i32) -> i32
| Return the number of Table files at the | specified level. |
pub fn level_summary( &self, scratch: *mut VersionSetLevelSummaryStorage ) -> *const u8
sourcepub fn approximate_offset_of(
&mut self,
v: *mut Version,
ikey_: &InternalKey
) -> u64
pub fn approximate_offset_of( &mut self, v: *mut Version, ikey_: &InternalKey ) -> u64
| Return the approximate offset in the | database of the data for “key” as of version | “v”. |
sourcepub fn add_live_files(&mut self, live: *mut HashSet<u64>)
pub fn add_live_files(&mut self, live: *mut HashSet<u64>)
| Add all files listed in any live version to | *live. | | May also mutate some internal state.
sourcepub fn num_level_bytes(&self, level: i32) -> i64
pub fn num_level_bytes(&self, level: i32) -> i64
| Return the combined file size of all | files at the specified level. |
sourcepub fn max_next_level_overlapping_bytes(&mut self) -> i64
pub fn max_next_level_overlapping_bytes(&mut self) -> i64
| Return the maximum overlapping data | (in bytes) at next level for any file | at a level >= 1. |
sourcepub fn get_range(
&mut self,
inputs: &Vec<*mut FileMetaData>,
smallest: *mut InternalKey,
largest: *mut InternalKey
)
pub fn get_range( &mut self, inputs: &Vec<*mut FileMetaData>, smallest: *mut InternalKey, largest: *mut InternalKey )
| Stores the minimal range that covers all | entries in inputs in *smallest, *largest. | | REQUIRES: inputs is not empty
sourcepub fn get_range2(
&mut self,
inputs1: &Vec<*mut FileMetaData>,
inputs2: &Vec<*mut FileMetaData>,
smallest: *mut InternalKey,
largest: *mut InternalKey
)
pub fn get_range2( &mut self, inputs1: &Vec<*mut FileMetaData>, inputs2: &Vec<*mut FileMetaData>, smallest: *mut InternalKey, largest: *mut InternalKey )
| Stores the minimal range that covers all | entries in inputs1 and inputs2 in *smallest, | *largest. | | REQUIRES: inputs is not empty
sourcepub fn make_input_iterator(
&mut self,
c: *mut Compaction
) -> *mut LevelDBIterator
pub fn make_input_iterator( &mut self, c: *mut Compaction ) -> *mut LevelDBIterator
| Create an iterator that reads over the | compaction inputs for “*c”. | | The caller should delete the iterator when no | longer needed.
sourcepub fn pick_compaction(&mut self) -> *mut Compaction
pub fn pick_compaction(&mut self) -> *mut Compaction
| Pick level and inputs for a new compaction. | | Returns nullptr if there is no compaction to | be done. | | Otherwise returns a pointer to | a heap-allocated object that describes the | compaction. Caller should delete the result.
pub fn setup_other_inputs(&mut self, c: *mut Compaction)
sourcepub fn compact_range(
&mut self,
level: i32,
begin: *const InternalKey,
end: *const InternalKey
) -> *mut Compaction
pub fn compact_range( &mut self, level: i32, begin: *const InternalKey, end: *const InternalKey ) -> *mut Compaction
| Return a compaction object for compacting the | range [begin,end] in the specified level. | Returns nullptr if there is nothing in that | level that overlaps the specified range. | Caller should delete the result.