Struct VersionSet

Source
pub struct VersionSet { /* private fields */ }
Expand description

Implementations§

Source§

impl VersionSet

Source

pub fn current(&self) -> *mut Version

| Return the current version. |

Source

pub fn manifest_file_number(&self) -> u64

| Return the current manifest file number |

Source

pub fn new_file_number(&mut self) -> u64

| Allocate and return a new file number |

Source

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().

Source

pub fn last_sequence(&self) -> u64

| Return the last sequence number. |

Source

pub fn set_last_sequence(&mut self, s: u64)

| Set the last sequence number to s. |

Source

pub fn log_number(&self) -> u64

| Return the current log file number. |

Source

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. |

Source

pub fn needs_compaction(&self) -> bool

| Returns true iff some level needs a compaction. |

Source

pub fn new( dbname: &String, options: *const Options, table_cache: *mut TableCache, cmp: *const InternalKeyComparator, ) -> Self

Source

pub fn append_version(&mut self, v: *mut Version)

Source

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()

Source

pub fn recover(&mut self, save_manifest: *mut bool) -> Status

| Recover the last saved descriptor from | persistent storage. |

Source

pub fn reuse_manifest(&mut self, dscname: &String, dscbase: &String) -> bool

Source

pub fn mark_file_number_used(&mut self, number: u64)

| Mark the specified file number as used. |

Source

pub fn finalize(&mut self, v: *mut Version)

Source

pub fn write_snapshot(&mut self, log: *mut LogWriter) -> Status

| Save current contents to *log |

Source

pub fn num_level_files(&self, level: i32) -> i32

| Return the number of Table files at the | specified level. |

Source

pub fn level_summary( &self, scratch: *mut VersionSetLevelSummaryStorage, ) -> *const u8

Source

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”. |

Source

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.

Source

pub fn num_level_bytes(&self, level: i32) -> i64

| Return the combined file size of all | files at the specified level. |

Source

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. |

Source

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

Source

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

Source

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.

Source

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.

Source

pub fn setup_other_inputs(&mut self, c: *mut Compaction)

Source

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.

Trait Implementations§

Source§

impl Drop for VersionSet

Source§

fn drop(&mut self)

Executes the destructor for this type. 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, U> CastInto<U> for T
where U: CastFrom<T>,

Source§

unsafe fn cast_into(self) -> U

Performs the conversion. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> StaticUpcast<T> for T

Source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V