Trait tikv_kv::Snapshot[][src]

pub trait Snapshot: Sync + Send + Clone {
    type Iter: Iterator;
    fn get(&self, key: &Key) -> Result<Option<Value>>;
fn get_cf(&self, cf: CfName, key: &Key) -> Result<Option<Value>>;
fn get_cf_opt(
        &self,
        opts: ReadOptions,
        cf: CfName,
        key: &Key
    ) -> Result<Option<Value>>;
fn iter(&self, iter_opt: IterOptions) -> Result<Self::Iter>;
fn iter_cf(&self, cf: CfName, iter_opt: IterOptions) -> Result<Self::Iter>; fn lower_bound(&self) -> Option<&[u8]> { ... }
fn upper_bound(&self) -> Option<&[u8]> { ... }
fn get_data_version(&self) -> Option<u64> { ... }
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

fn get(&self, key: &Key) -> Result<Option<Value>>[src]

Get the value associated with key in default column family

fn get_cf(&self, cf: CfName, key: &Key) -> Result<Option<Value>>[src]

Get the value associated with key in cf column family

fn get_cf_opt(
    &self,
    opts: ReadOptions,
    cf: CfName,
    key: &Key
) -> Result<Option<Value>>
[src]

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

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

fn iter_cf(&self, cf: CfName, iter_opt: IterOptions) -> Result<Self::Iter>[src]

Loading content...

Provided methods

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

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

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.

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

Loading content...

Implementations on Foreign Types

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

type Iter = RegionIterator<S>

impl Snapshot for Arc<RocksSnapshot>[src]

type Iter = RocksEngineIterator

Loading content...

Implementors

impl Snapshot for BTreeEngineSnapshot[src]

type Iter = BTreeEngineIterator

Loading content...