Trait tikv::storage::lock_manager::LockManager [−][src]
LockManager
manages transactions waiting for locks held by other transactions.
It has responsibility to handle deadlocks between transactions.
Required methods
fn wait_for(
&self,
start_ts: TimeStamp,
cb: StorageCallback,
pr: ProcessResult,
lock: Lock,
is_first_lock: bool,
timeout: Option<WaitTimeout>,
diag_ctx: DiagnosticContext
)
[src]
&self,
start_ts: TimeStamp,
cb: StorageCallback,
pr: ProcessResult,
lock: Lock,
is_first_lock: bool,
timeout: Option<WaitTimeout>,
diag_ctx: DiagnosticContext
)
Transaction with start_ts
waits for lock
released.
If the lock is released or waiting times out or deadlock occurs, the transaction
should be waken up and call cb
with pr
to notify the caller.
If the lock is the first lock the transaction waits for, it won’t result in deadlock.
fn wake_up(
&self,
lock_ts: TimeStamp,
hashes: Vec<u64>,
commit_ts: TimeStamp,
is_pessimistic_txn: bool
)
[src]
&self,
lock_ts: TimeStamp,
hashes: Vec<u64>,
commit_ts: TimeStamp,
is_pessimistic_txn: bool
)
The locks with lock_ts
and hashes
are released, tries to wake up transactions.
fn dump_wait_for_entries(&self, cb: Callback)
[src]
Provided methods
fn has_waiter(&self) -> bool
[src]
Returns true if there are waiters in the LockManager
.
This function is used to avoid useless calculation and wake-up.
Implementors
impl LockManager for LockManager
[src]
fn wait_for(
&self,
start_ts: TimeStamp,
cb: StorageCallback,
pr: ProcessResult,
lock: Lock,
is_first_lock: bool,
timeout: Option<WaitTimeout>,
diag_ctx: DiagnosticContext
)
[src]
&self,
start_ts: TimeStamp,
cb: StorageCallback,
pr: ProcessResult,
lock: Lock,
is_first_lock: bool,
timeout: Option<WaitTimeout>,
diag_ctx: DiagnosticContext
)
fn wake_up(
&self,
lock_ts: TimeStamp,
hashes: Vec<u64>,
commit_ts: TimeStamp,
is_pessimistic_txn: bool
)
[src]
&self,
lock_ts: TimeStamp,
hashes: Vec<u64>,
commit_ts: TimeStamp,
is_pessimistic_txn: bool
)
fn has_waiter(&self) -> bool
[src]
fn dump_wait_for_entries(&self, cb: Callback)
[src]
impl LockManager for DummyLockManager
[src]
fn wait_for(
&self,
_start_ts: TimeStamp,
_cb: StorageCallback,
_pr: ProcessResult,
_lock: Lock,
_is_first_lock: bool,
_wait_timeout: Option<WaitTimeout>,
_diag_ctx: DiagnosticContext
)
[src]
&self,
_start_ts: TimeStamp,
_cb: StorageCallback,
_pr: ProcessResult,
_lock: Lock,
_is_first_lock: bool,
_wait_timeout: Option<WaitTimeout>,
_diag_ctx: DiagnosticContext
)
fn wake_up(
&self,
_lock_ts: TimeStamp,
_hashes: Vec<u64>,
_commit_ts: TimeStamp,
_is_pessimistic_txn: bool
)
[src]
&self,
_lock_ts: TimeStamp,
_hashes: Vec<u64>,
_commit_ts: TimeStamp,
_is_pessimistic_txn: bool
)