Struct bitcoinleveldb_version::Version
source · pub struct Version { /* private fields */ }
Implementations§
source§impl Version
impl Version
pub fn num_files(&self, level: i32) -> i32
pub fn new(vset: *mut VersionSet) -> Self
pub fn new_concatenating_iterator( &self, options: &ReadOptions, level: i32 ) -> *mut LevelDBIterator
sourcepub fn add_iterators(
&mut self,
options: &ReadOptions,
iters: *mut Vec<*mut LevelDBIterator>
)
pub fn add_iterators( &mut self, options: &ReadOptions, iters: *mut Vec<*mut LevelDBIterator> )
| Append to *iters a sequence of iterators that | will yield the contents of this Version when | merged together. | | REQUIRES: This version has been saved (see | VersionSet::SaveTo)
sourcepub fn for_each_overlapping(
&mut self,
user_key_: Slice,
internal_key_: Slice,
arg: *mut c_void,
func: fn(_0: *mut c_void, _1: i32, _2: *mut FileMetaData) -> bool
)
pub fn for_each_overlapping( &mut self, user_key_: Slice, internal_key_: Slice, arg: *mut c_void, func: fn(_0: *mut c_void, _1: i32, _2: *mut FileMetaData) -> bool )
| Call func(arg, level, f) for every file that | overlaps user_key in order from newest to | oldest. If an invocation of func returns | false, makes no more calls. | | REQUIRES: user portion of internal_key == | user_key.
pub fn get( &mut self, options: &ReadOptions, k: &LookupKey, value: *mut String, stats: *mut VersionGetStats ) -> Status
sourcepub fn update_stats(&mut self, stats: &VersionGetStats) -> bool
pub fn update_stats(&mut self, stats: &VersionGetStats) -> bool
| Adds “stats” into the current state. Returns | true if a new compaction may need to be | triggered, false otherwise. | | REQUIRES: lock is held
sourcepub fn record_read_sample(&mut self, internal_key_: Slice) -> bool
pub fn record_read_sample(&mut self, internal_key_: Slice) -> bool
| Record a sample of bytes read at the | specified internal key. | | Samples are taken approximately once every | config::kReadBytesPeriod bytes. Returns true | if a new compaction may need to be triggered. | | REQUIRES: lock is held
sourcepub fn ref_(&mut self)
pub fn ref_(&mut self)
| Reference count management (so Versions | do not disappear out from under live | iterators) |
pub fn unref(&mut self)
sourcepub fn overlap_in_level(
&mut self,
level: i32,
smallest_user_key_: *const Slice,
largest_user_key_: *const Slice
) -> bool
pub fn overlap_in_level( &mut self, level: i32, smallest_user_key_: *const Slice, largest_user_key_: *const Slice ) -> bool
| Returns true iff some file in the specified | level overlaps some part of | [*smallest_user_key,*largest_user_key]. | | smallest_user_key==nullptr represents a key | smaller than all the DB’s keys. | | largest_user_key==nullptr represents a key | largest than all the DB’s keys.
sourcepub fn pick_level_for_mem_table_output(
&mut self,
smallest_user_key_: &Slice,
largest_user_key_: &Slice
) -> i32
pub fn pick_level_for_mem_table_output( &mut self, smallest_user_key_: &Slice, largest_user_key_: &Slice ) -> i32
| Return the level at which we should place | a new memtable compaction result that covers | the range | [smallest_user_key,largest_user_key].
sourcepub fn get_overlapping_inputs(
&mut self,
level: i32,
begin: *const InternalKey,
end: *const InternalKey,
inputs: *mut Vec<*mut FileMetaData>
)
pub fn get_overlapping_inputs( &mut self, level: i32, begin: *const InternalKey, end: *const InternalKey, inputs: *mut Vec<*mut FileMetaData> )
| Store in “*inputs” all files in “level” | that overlap [begin,end] |
sourcepub fn debug_string(&self) -> String
pub fn debug_string(&self) -> String
| Return a human readable string that | describes this version’s contents. |