Struct tikv::storage::mvcc::MvccReader [−][src]
Fields
snapshot: S
statistics: Statistics
data_cursor: Option<Cursor<S::Iter>>
lock_cursor: Option<Cursor<S::Iter>>
write_cursor: Option<Cursor<S::Iter>>
scan_mode: Option<ScanMode>
None means following operations are performed on a single user key, i.e., different versions of the same key. It can use prefix seek to speed up reads from the write-cf.
current_key: Option<Key>
fill_cache: bool
Implementations
impl<S: EngineSnapshot> MvccReader<S>
[src]
pub fn new(snapshot: S, scan_mode: Option<ScanMode>, fill_cache: bool) -> Self
[src]
fn load_data(&mut self, key: &Key, write: Write) -> Result<Value>
[src]
load the value associated with key
and pointed by write
pub fn load_lock(&mut self, key: &Key) -> Result<Option<Lock>>
[src]
fn get_scan_mode(&self, allow_backward: bool) -> ScanMode
[src]
pub fn seek_write(
&mut self,
key: &Key,
ts: TimeStamp
) -> Result<Option<(TimeStamp, Write)>>
[src]
&mut self,
key: &Key,
ts: TimeStamp
) -> Result<Option<(TimeStamp, Write)>>
Return:
(commit_ts, write_record) of the write record for key
committed before or equal tots
Post Condition:
leave the write_cursor at the first record which key is less or equal to the ts
encoded version of key
fn get(
&mut self,
key: &Key,
ts: TimeStamp,
gc_fence_limit: Option<TimeStamp>
) -> Result<Option<Value>>
[src]
&mut self,
key: &Key,
ts: TimeStamp,
gc_fence_limit: Option<TimeStamp>
) -> Result<Option<Value>>
Gets the value of the specified key’s latest version before specified ts
.
It tries to ensure the write record’s gc_fence
’s ts, if any, greater than specified
gc_fence_limit
. Pass None
to gc_fence_limit
to skip the check.
The caller must guarantee that there’s no other PUT
or DELETE
versions whose commit_ts
is between the found version and the provided gc_fence_limit
(gc_fence_limit
is
inclusive).
For transactional reads, the gc_fence_limit
must be provided to ensure the result is
correct. Generally, it should be the read_ts of the current transaction, which might be
different from the ts
passed to this function.
Note that this function does not check for locks on key
.
pub fn get_write(
&mut self,
key: &Key,
ts: TimeStamp,
gc_fence_limit: Option<TimeStamp>
) -> Result<Option<Write>>
[src]
&mut self,
key: &Key,
ts: TimeStamp,
gc_fence_limit: Option<TimeStamp>
) -> Result<Option<Write>>
Gets the write record of the specified key’s latest version before specified ts
.
It tries to ensure the write record’s gc_fence
’s ts, if any, greater than specified
gc_fence_limit
. Pass None
to gc_fence_limit
to skip the check.
The caller must guarantee that there’s no other PUT
or DELETE
versions whose commit_ts
is between the found version and the provided gc_fence_limit
(gc_fence_limit
is
inclusive).
For transactional reads, the gc_fence_limit
must be provided to ensure the result is
correct. Generally, it should be the read_ts of the current transaction, which might be
different from the ts
passed to this function.
fn get_txn_commit_record(
&mut self,
key: &Key,
start_ts: TimeStamp
) -> Result<TxnCommitRecord>
[src]
&mut self,
key: &Key,
start_ts: TimeStamp
) -> Result<TxnCommitRecord>
fn create_data_cursor(&mut self) -> Result<()>
[src]
fn create_write_cursor(&mut self) -> Result<()>
[src]
fn create_lock_cursor(&mut self) -> Result<()>
[src]
pub fn seek_ts(&mut self, ts: TimeStamp) -> Result<Option<Key>>
[src]
Return the first committed key for which start_ts
equals to ts
pub fn scan_locks<F>(
&mut self,
start: Option<&Key>,
end: Option<&Key>,
filter: F,
limit: usize
) -> Result<(Vec<(Key, Lock)>, bool)> where
F: Fn(&Lock) -> bool,
[src]
&mut self,
start: Option<&Key>,
end: Option<&Key>,
filter: F,
limit: usize
) -> Result<(Vec<(Key, Lock)>, bool)> where
F: Fn(&Lock) -> bool,
Scan locks that satisfies filter(lock)
returns true, from the given start key start
.
At most limit
locks will be returned. If limit
is set to 0
, it means unlimited.
The return type is (locks, is_remain)
. is_remain
indicates whether there MAY be
remaining locks that can be scanned.
pub fn scan_keys(
&mut self,
start: Option<Key>,
limit: usize
) -> Result<(Vec<Key>, Option<Key>)>
[src]
&mut self,
start: Option<Key>,
limit: usize
) -> Result<(Vec<Key>, Option<Key>)>
pub fn scan_values_in_default(
&mut self,
key: &Key
) -> Result<Vec<(TimeStamp, Value)>>
[src]
&mut self,
key: &Key
) -> Result<Vec<(TimeStamp, Value)>>
fn get_old_value(
&mut self,
key: &Key,
start_ts: TimeStamp,
prev_write_loaded: bool,
prev_write: Option<Write>
) -> Result<OldValue>
[src]
&mut self,
key: &Key,
start_ts: TimeStamp,
prev_write_loaded: bool,
prev_write: Option<Write>
) -> Result<OldValue>
Read the old value for key for CDC.
prev_write
stands for the previous write record of the key
it must be read in the caller and be passed in for optimization
Auto Trait Implementations
impl<S> !RefUnwindSafe for MvccReader<S>
impl<S> Send for MvccReader<S>
impl<S> !Sync for MvccReader<S>
impl<S> Unpin for MvccReader<S> where
S: Unpin,
<S as Snapshot>::Iter: Unpin,
S: Unpin,
<S as Snapshot>::Iter: Unpin,
impl<S> UnwindSafe for MvccReader<S> where
S: UnwindSafe,
<S as Snapshot>::Iter: UnwindSafe,
S: UnwindSafe,
<S as Snapshot>::Iter: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>,
[src]
W: ConvertTo<V>,
pub fn convert_from(ctx: &mut EvalContext, from: W) -> Result<V, Error>
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,