Struct tikv::storage::mvcc::reader::scanner::backward::BackwardKvScanner [−][src]
This struct can be used to scan keys starting from the given user key in the reverse order (less than).
Internally, for each key, rollbacks are ignored and smaller version will be tried. If the isolation level is SI, locks will be checked first.
Use ScannerBuilder
to build BackwardKvScanner
.
Fields
cfg: ScannerConfig<S>
lock_cursor: Cursor<S::Iter>
write_cursor: Cursor<S::Iter>
default_cursor: Option<Cursor<S::Iter>>
default cursor
is lazy created only when it’s needed.
is_started: bool
Is iteration started
statistics: Statistics
met_newer_ts_data: NewerTsCheckState
Implementations
impl<S: Snapshot> BackwardKvScanner<S>
[src]
pub fn new(
cfg: ScannerConfig<S>,
lock_cursor: Cursor<S::Iter>,
write_cursor: Cursor<S::Iter>
) -> BackwardKvScanner<S>
[src]
cfg: ScannerConfig<S>,
lock_cursor: Cursor<S::Iter>,
write_cursor: Cursor<S::Iter>
) -> BackwardKvScanner<S>
pub fn take_statistics(&mut self) -> Statistics
[src]
Take out and reset the statistics collected so far.
pub fn met_newer_ts_data(&self) -> NewerTsCheckState
[src]
Whether we met newer ts data.
The result is always Unknown
if check_has_newer_ts_data
is not set.
pub fn read_next(&mut self) -> Result<Option<(Key, Value)>>
[src]
Get the next key-value pair, in backward order.
fn reverse_get(
&mut self,
user_key: &Key,
ts: TimeStamp,
met_prev_user_key: &mut bool
) -> Result<Option<Value>>
[src]
&mut self,
user_key: &Key,
ts: TimeStamp,
met_prev_user_key: &mut bool
) -> Result<Option<Value>>
Attempt to get the value of a key specified by user_key
and self.cfg.ts
in reverse order.
This function requires that the write cursor is currently pointing to the earliest version
of user_key
.
fn handle_last_version(
&mut self,
some_write: Option<Write>,
user_key: &Key
) -> Result<Option<Value>>
[src]
&mut self,
some_write: Option<Write>,
user_key: &Key
) -> Result<Option<Value>>
Handle last version. Last version may be PUT or DELETE. If it is a PUT, value should be load.
fn reverse_load_data_by_write(
&mut self,
write: Write,
user_key: &Key
) -> Result<Value>
[src]
&mut self,
write: Write,
user_key: &Key
) -> Result<Value>
Load the value by the given some_write
. If value is carried in some_write
, it will be
returned directly. Otherwise there will be a default CF look up.
The implementation is similar to PointGetter::load_data_by_write
.
fn move_write_cursor_to_prev_user_key(
&mut self,
current_user_key: &Key
) -> Result<()>
[src]
&mut self,
current_user_key: &Key
) -> Result<()>
After self.reverse_get()
, our write cursor may be pointing to current user key (if we
found a desired version), or previous user key (if there is no desired version), or
out of bound.
If it is pointing to current user key, we need to step it until we meet a new
key. We first try to prev()
a few times. If still not reaching another user
key, we seek_for_prev()
.
fn ensure_default_cursor(&mut self) -> Result<()>
[src]
Create the default cursor if it doesn’t exist.
Auto Trait Implementations
impl<S> !RefUnwindSafe for BackwardKvScanner<S>
impl<S> Send for BackwardKvScanner<S>
impl<S> !Sync for BackwardKvScanner<S>
impl<S> Unpin for BackwardKvScanner<S> where
S: Unpin,
<S as Snapshot>::Iter: Unpin,
S: Unpin,
<S as Snapshot>::Iter: Unpin,
impl<S> UnwindSafe for BackwardKvScanner<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>,