Struct tikv::storage::mvcc::PointGetter[][src]

pub struct PointGetter<S: Snapshot> {
    snapshot: S,
    multi: bool,
    omit_value: bool,
    isolation_level: IsolationLevel,
    ts: TimeStamp,
    bypass_locks: TsSet,
    met_newer_ts_data: NewerTsCheckState,
    statistics: Statistics,
    write_cursor: Cursor<S::Iter>,
    drained: bool,
}

This struct can be used to get the value of user keys. Internally, rollbacks are ignored and smaller version will be tried. If the isolation level is Si, locks will be checked first.

Use PointGetterBuilder to build PointGetter.

Fields

snapshot: Smulti: boolomit_value: boolisolation_level: IsolationLevelts: TimeStampbypass_locks: TsSetmet_newer_ts_data: NewerTsCheckStatestatistics: Statisticswrite_cursor: Cursor<S::Iter>drained: bool

Indicating whether or not this structure can serve more requests. It is meaningful only when multi == false, to protect from producing undefined values when trying to get multiple values under multi == false.

Implementations

impl<S: Snapshot> PointGetter<S>[src]

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 get(&mut self, user_key: &Key) -> Result<Option<Value>>[src]

Get the value of a user key.

If multi == false, this function must be called only once. Future calls return nothing.

fn load_and_check_lock(&mut self, user_key: &Key) -> Result<()>[src]

Get a lock of a user key in the lock CF. If lock exists, it will be checked to see whether it conflicts with the given ts.

In common cases we expect to get nothing in lock cf. Using a get_cf instead of seek is fast in such cases due to no need for RocksDB to continue move and skip deleted entries until find a user key.

fn load_data(&mut self, user_key: &Key) -> Result<Option<Value>>[src]

Load the value.

First, a correct version info in the Write CF will be sought. Then, value will be loaded from Default CF if necessary.

fn load_data_from_default_cf(
    &mut self,
    write_start_ts: TimeStamp,
    user_key: &Key
) -> Result<Value>
[src]

Load the value from default CF.

We assume that mostly the keys given to batch get keys are not very close to each other. near_seek will likely fall back to seek in such scenario, which takes 2x time compared to get_cf. Thus we use get_cf directly here.

Auto Trait Implementations

impl<S> !RefUnwindSafe for PointGetter<S>

impl<S> Send for PointGetter<S>

impl<S> !Sync for PointGetter<S>

impl<S> Unpin for PointGetter<S> where
    S: Unpin,
    <S as Snapshot>::Iter: Unpin

impl<S> UnwindSafe for PointGetter<S> where
    S: UnwindSafe,
    <S as Snapshot>::Iter: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<V, W> ConvertFrom<W> for V where
    W: ConvertTo<V>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]