Trait tikv_kv::Engine[][src]

pub trait Engine: Send + Clone + 'static {
    type Snap: Snapshot;
    type Local: LocalEngine;
    fn kv_engine(&self) -> Self::Local;
fn snapshot_on_kv_engine(
        &self,
        start_key: &[u8],
        end_key: &[u8]
    ) -> Result<Self::Snap>;
fn modify_on_kv_engine(&self, modifies: Vec<Modify>) -> Result<()>;
fn async_snapshot(
        &self,
        ctx: SnapContext<'_>,
        cb: Callback<Self::Snap>
    ) -> Result<()>;
fn async_write(
        &self,
        ctx: &Context,
        batch: WriteData,
        write_cb: Callback<()>
    ) -> Result<()>; fn async_write_ext(
        &self,
        ctx: &Context,
        batch: WriteData,
        write_cb: Callback<()>,
        _proposed_cb: Option<ExtCallback>,
        _committed_cb: Option<ExtCallback>
    ) -> Result<()> { ... }
fn write(&self, ctx: &Context, batch: WriteData) -> Result<()> { ... }
fn release_snapshot(&self) { ... }
fn snapshot(&self, ctx: SnapContext<'_>) -> Result<Self::Snap> { ... }
fn put(&self, ctx: &Context, key: Key, value: Value) -> Result<()> { ... }
fn put_cf(
        &self,
        ctx: &Context,
        cf: CfName,
        key: Key,
        value: Value
    ) -> Result<()> { ... }
fn delete(&self, ctx: &Context, key: Key) -> Result<()> { ... }
fn delete_cf(&self, ctx: &Context, cf: CfName, key: Key) -> Result<()> { ... }
fn get_mvcc_properties_cf(
        &self,
        _: CfName,
        _safe_point: TimeStamp,
        _start: &[u8],
        _end: &[u8]
    ) -> Option<MvccProperties> { ... } }

Engine defines the common behaviour for a storage engine type.

Associated Types

type Snap: Snapshot[src]

type Local: LocalEngine[src]

Loading content...

Required methods

fn kv_engine(&self) -> Self::Local[src]

Local storage engine.

fn snapshot_on_kv_engine(
    &self,
    start_key: &[u8],
    end_key: &[u8]
) -> Result<Self::Snap>
[src]

fn modify_on_kv_engine(&self, modifies: Vec<Modify>) -> Result<()>[src]

Write modifications into internal local engine directly.

fn async_snapshot(
    &self,
    ctx: SnapContext<'_>,
    cb: Callback<Self::Snap>
) -> Result<()>
[src]

fn async_write(
    &self,
    ctx: &Context,
    batch: WriteData,
    write_cb: Callback<()>
) -> Result<()>
[src]

Loading content...

Provided methods

fn async_write_ext(
    &self,
    ctx: &Context,
    batch: WriteData,
    write_cb: Callback<()>,
    _proposed_cb: Option<ExtCallback>,
    _committed_cb: Option<ExtCallback>
) -> Result<()>
[src]

Writes data to the engine asynchronously with some extensions.

When the write request is proposed successfully, the proposed_cb is invoked. When the write request is finished, the write_cb is invoked.

fn write(&self, ctx: &Context, batch: WriteData) -> Result<()>[src]

fn release_snapshot(&self)[src]

fn snapshot(&self, ctx: SnapContext<'_>) -> Result<Self::Snap>[src]

fn put(&self, ctx: &Context, key: Key, value: Value) -> Result<()>[src]

fn put_cf(
    &self,
    ctx: &Context,
    cf: CfName,
    key: Key,
    value: Value
) -> Result<()>
[src]

fn delete(&self, ctx: &Context, key: Key) -> Result<()>[src]

fn delete_cf(&self, ctx: &Context, cf: CfName, key: Key) -> Result<()>[src]

fn get_mvcc_properties_cf(
    &self,
    _: CfName,
    _safe_point: TimeStamp,
    _start: &[u8],
    _end: &[u8]
) -> Option<MvccProperties>
[src]

Loading content...

Implementors

impl Engine for BTreeEngine[src]

type Snap = BTreeEngineSnapshot

type Local = PanicEngine

fn async_snapshot(
    &self,
    _ctx: SnapContext<'_>,
    cb: EngineCallback<Self::Snap>
) -> EngineResult<()>
[src]

warning: It returns a fake snapshot whose content will be affected by the later modifies!

impl Engine for MockEngine[src]

type Snap = <RocksEngine as Engine>::Snap

type Local = <RocksEngine as Engine>::Local

impl Engine for RocksEngine[src]

type Snap = Arc<RocksSnapshot>

type Local = BaseRocksEngine

Loading content...