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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
§

impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,

§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> StaticUpcast<T> for T

§

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

Convert type of a const pointer. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

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

§

fn vzip(self) -> V