Trait tikv::storage::Engine [−][src]
Engine defines the common behaviour for a storage engine type.
Associated Types
Loading content...Required methods
pub fn kv_engine(&self) -> Self::Local
[src]
Local storage engine.
pub fn snapshot_on_kv_engine(
&self,
start_key: &[u8],
end_key: &[u8]
) -> Result<Self::Snap, Error>
[src]
&self,
start_key: &[u8],
end_key: &[u8]
) -> Result<Self::Snap, Error>
pub fn modify_on_kv_engine(
&self,
modifies: Vec<Modify, Global>
) -> Result<(), Error>
[src]
&self,
modifies: Vec<Modify, Global>
) -> Result<(), Error>
Write modifications into internal local engine directly.
pub fn async_snapshot(
&self,
ctx: SnapContext<'_>,
cb: Box<dyn FnOnce((CbContext, Result<Self::Snap, Error>)) + 'static + Send, Global>
) -> Result<(), Error>
[src]
&self,
ctx: SnapContext<'_>,
cb: Box<dyn FnOnce((CbContext, Result<Self::Snap, Error>)) + 'static + Send, Global>
) -> Result<(), Error>
pub fn async_write(
&self,
ctx: &Context,
batch: WriteData,
write_cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>
) -> Result<(), Error>
[src]
&self,
ctx: &Context,
batch: WriteData,
write_cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>
) -> Result<(), Error>
Provided methods
pub fn async_write_ext(
&self,
ctx: &Context,
batch: WriteData,
write_cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>,
_proposed_cb: Option<Box<dyn FnOnce() + 'static + Send, Global>>,
_committed_cb: Option<Box<dyn FnOnce() + 'static + Send, Global>>
) -> Result<(), Error>
[src]
&self,
ctx: &Context,
batch: WriteData,
write_cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>,
_proposed_cb: Option<Box<dyn FnOnce() + 'static + Send, Global>>,
_committed_cb: Option<Box<dyn FnOnce() + 'static + Send, Global>>
) -> Result<(), Error>
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.
pub fn write(&self, ctx: &Context, batch: WriteData) -> Result<(), Error>
[src]
pub fn release_snapshot(&self)
[src]
pub fn snapshot(&self, ctx: SnapContext<'_>) -> Result<Self::Snap, Error>
[src]
pub fn put(
&self,
ctx: &Context,
key: Key,
value: Vec<u8, Global>
) -> Result<(), Error>
[src]
&self,
ctx: &Context,
key: Key,
value: Vec<u8, Global>
) -> Result<(), Error>
pub fn put_cf(
&self,
ctx: &Context,
cf: &'static str,
key: Key,
value: Vec<u8, Global>
) -> Result<(), Error>
[src]
&self,
ctx: &Context,
cf: &'static str,
key: Key,
value: Vec<u8, Global>
) -> Result<(), Error>
pub fn delete(&self, ctx: &Context, key: Key) -> Result<(), Error>
[src]
pub fn delete_cf(
&self,
ctx: &Context,
cf: &'static str,
key: Key
) -> Result<(), Error>
[src]
&self,
ctx: &Context,
cf: &'static str,
key: Key
) -> Result<(), Error>
pub fn get_mvcc_properties_cf(
&self,
&'static str,
_safe_point: TimeStamp,
_start: &[u8],
_end: &[u8]
) -> Option<MvccProperties>
[src]
&self,
&'static str,
_safe_point: TimeStamp,
_start: &[u8],
_end: &[u8]
) -> Option<MvccProperties>
Implementors
impl Engine for BTreeEngine
[src]
type Snap = BTreeEngineSnapshot
type Local = PanicEngine
pub fn kv_engine(&self) -> PanicEngine
[src]
pub fn snapshot_on_kv_engine(
&self,
&[u8],
&[u8]
) -> Result<<BTreeEngine as Engine>::Snap, Error>
[src]
&self,
&[u8],
&[u8]
) -> Result<<BTreeEngine as Engine>::Snap, Error>
pub fn modify_on_kv_engine(&self, Vec<Modify, Global>) -> Result<(), Error>
[src]
pub fn async_write(
&self,
_ctx: &Context,
batch: WriteData,
cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>
) -> Result<(), Error>
[src]
&self,
_ctx: &Context,
batch: WriteData,
cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>
) -> Result<(), Error>
pub fn async_snapshot(
&self,
_ctx: SnapContext<'_>,
cb: Box<dyn FnOnce((CbContext, Result<<BTreeEngine as Engine>::Snap, Error>)) + 'static + Send, Global>
) -> Result<(), Error>
[src]
&self,
_ctx: SnapContext<'_>,
cb: Box<dyn FnOnce((CbContext, Result<<BTreeEngine as Engine>::Snap, Error>)) + 'static + Send, Global>
) -> Result<(), Error>
warning: It returns a fake snapshot whose content will be affected by the later modifies!
impl Engine for RocksEngine
[src]
type Snap = Arc<RocksSnapshot>
type Local = RocksEngine
pub fn kv_engine(&self) -> RocksEngine
[src]
pub fn snapshot_on_kv_engine(
&self,
&[u8],
&[u8]
) -> Result<<RocksEngine as Engine>::Snap, Error>
[src]
&self,
&[u8],
&[u8]
) -> Result<<RocksEngine as Engine>::Snap, Error>
pub fn modify_on_kv_engine(
&self,
modifies: Vec<Modify, Global>
) -> Result<(), Error>
[src]
&self,
modifies: Vec<Modify, Global>
) -> Result<(), Error>
pub fn async_write(
&self,
ctx: &Context,
batch: WriteData,
cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>
) -> Result<(), Error>
[src]
&self,
ctx: &Context,
batch: WriteData,
cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>
) -> Result<(), Error>
pub fn async_write_ext(
&self,
&Context,
batch: WriteData,
cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>,
proposed_cb: Option<Box<dyn FnOnce() + 'static + Send, Global>>,
committed_cb: Option<Box<dyn FnOnce() + 'static + Send, Global>>
) -> Result<(), Error>
[src]
&self,
&Context,
batch: WriteData,
cb: Box<dyn FnOnce((CbContext, Result<(), Error>)) + 'static + Send, Global>,
proposed_cb: Option<Box<dyn FnOnce() + 'static + Send, Global>>,
committed_cb: Option<Box<dyn FnOnce() + 'static + Send, Global>>
) -> Result<(), Error>
pub fn async_snapshot(
&self,
SnapContext<'_>,
cb: Box<dyn FnOnce((CbContext, Result<<RocksEngine as Engine>::Snap, Error>)) + 'static + Send, Global>
) -> Result<(), Error>
[src]
&self,
SnapContext<'_>,
cb: Box<dyn FnOnce((CbContext, Result<<RocksEngine as Engine>::Snap, Error>)) + 'static + Send, Global>
) -> Result<(), Error>
impl<E, S> Engine for RaftKv<E, S> where
E: KvEngine,
S: RaftStoreRouter<E> + LocalReadRouter<E> + 'static,
[src]
E: KvEngine,
S: RaftStoreRouter<E> + LocalReadRouter<E> + 'static,
type Snap = RegionSnapshot<E::Snapshot>
type Local = E
fn kv_engine(&self) -> E
[src]
fn snapshot_on_kv_engine(
&self,
start_key: &[u8],
end_key: &[u8]
) -> Result<Self::Snap>
[src]
&self,
start_key: &[u8],
end_key: &[u8]
) -> Result<Self::Snap>
fn modify_on_kv_engine(&self, modifies: Vec<Modify>) -> Result<()>
[src]
fn async_write(
&self,
ctx: &Context,
batch: WriteData,
write_cb: Callback<()>
) -> Result<()>
[src]
&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<()>
[src]
&self,
ctx: &Context,
batch: WriteData,
write_cb: Callback<()>,
proposed_cb: Option<ExtCallback>,
committed_cb: Option<ExtCallback>
) -> Result<()>
fn async_snapshot(
&self,
ctx: SnapContext<'_>,
cb: Callback<Self::Snap>
) -> Result<()>
[src]
&self,
ctx: SnapContext<'_>,
cb: Callback<Self::Snap>
) -> Result<()>
fn release_snapshot(&self)
[src]
fn get_mvcc_properties_cf(
&self,
cf: CfName,
safe_point: TimeStamp,
start: &[u8],
end: &[u8]
) -> Option<MvccProperties>
[src]
&self,
cf: CfName,
safe_point: TimeStamp,
start: &[u8],
end: &[u8]
) -> Option<MvccProperties>