Trait tikv::storage::Snapshot[][src]

pub trait Snapshot: Sync + Send + Clone {
    type Iter: Iterator;
    pub fn get(&self, key: &Key) -> Result<Option<Vec<u8, Global>>, Error>;
pub fn get_cf(
        &self,
        cf: &'static str,
        key: &Key
    ) -> Result<Option<Vec<u8, Global>>, Error>;
pub fn get_cf_opt(
        &self,
        opts: ReadOptions,
        cf: &'static str,
        key: &Key
    ) -> Result<Option<Vec<u8, Global>>, Error>;
pub fn iter(&self, iter_opt: IterOptions) -> Result<Self::Iter, Error>;
pub fn iter_cf(
        &self,
        cf: &'static str,
        iter_opt: IterOptions
    ) -> Result<Self::Iter, Error>; pub fn lower_bound(&self) -> Option<&[u8]> { ... }
pub fn upper_bound(&self) -> Option<&[u8]> { ... }
pub fn get_data_version(&self) -> Option<u64> { ... }
pub fn is_max_ts_synced(&self) -> bool { ... } }

A Snapshot is a consistent view of the underlying engine at a given point in time.

Note that this is not an MVCC snapshot, that is a higher level abstraction of a view of TiKV at a specific timestamp. This snapshot is lower-level, a view of the underlying storage.

Associated Types

type Iter: Iterator[src]

Loading content...

Required methods

pub fn get(&self, key: &Key) -> Result<Option<Vec<u8, Global>>, Error>[src]

Get the value associated with key in default column family

pub fn get_cf(
    &self,
    cf: &'static str,
    key: &Key
) -> Result<Option<Vec<u8, Global>>, Error>
[src]

Get the value associated with key in cf column family

pub fn get_cf_opt(
    &self,
    opts: ReadOptions,
    cf: &'static str,
    key: &Key
) -> Result<Option<Vec<u8, Global>>, Error>
[src]

Get the value associated with key in cf column family, with Options in opts

pub fn iter(&self, iter_opt: IterOptions) -> Result<Self::Iter, Error>[src]

pub fn iter_cf(
    &self,
    cf: &'static str,
    iter_opt: IterOptions
) -> Result<Self::Iter, Error>
[src]

Loading content...

Provided methods

pub fn lower_bound(&self) -> Option<&[u8]>[src]

pub fn upper_bound(&self) -> Option<&[u8]>[src]

pub fn get_data_version(&self) -> Option<u64>[src]

Retrieves a version that represents the modification status of the underlying data. Version should be changed when underlying data is changed.

If the engine does not support data version, then None is returned.

pub fn is_max_ts_synced(&self) -> bool[src]

Loading content...

Implementations on Foreign Types

impl Snapshot for Arc<RocksSnapshot>[src]

type Iter = RocksEngineIterator

impl<S> Snapshot for RegionSnapshot<S> where
    S: Snapshot
[src]

type Iter = RegionIterator<S>

Loading content...

Implementors

impl Snapshot for BTreeEngineSnapshot[src]

type Iter = BTreeEngineIterator

impl<S: Snapshot> Snapshot for TTLSnapshot<S>[src]

type Iter = TTLIterator<S::Iter>

Loading content...