Struct tikv::server::lock_manager::waiter_manager::Waiter [−][src]
If a pessimistic transaction meets a lock, it will wait for the lock
released in WaiterManager
.
Waiter
contains the context of the pessimistic transaction. Each Waiter
has a timeout. Transaction will be notified when the lock is released
or the corresponding waiter times out.
Fields
start_ts: TimeStamp
cb: StorageCallback
pr: ProcessResult
The result of Command::AcquirePessimisticLock
.
It contains a KeyIsLocked
error at the beginning. It will be changed
to WriteConflict
error if the lock is released or Deadlock
error if
it causes deadlock.
lock: Lock
diag_ctx: DiagnosticContext
delay: Delay
_lifetime_timer: HistogramTimer
Implementations
impl Waiter
[src][−]
fn new(
start_ts: TimeStamp,
cb: StorageCallback,
pr: ProcessResult,
lock: Lock,
deadline: Instant,
diag_ctx: DiagnosticContext
) -> Self
[src]
start_ts: TimeStamp,
cb: StorageCallback,
pr: ProcessResult,
lock: Lock,
deadline: Instant,
diag_ctx: DiagnosticContext
) -> Self
fn on_timeout<F: FnOnce()>(&self, f: F) -> impl Future<Output = ()>
[src][−]
The F
will be invoked if the Waiter
times out normally.
fn reset_timeout(&self, deadline: Instant)
[src]
fn notify(self)
[src][−]
Notify
consumes the Waiter
to notify the corresponding transaction
going on.
fn conflict_with(&mut self, lock_ts: TimeStamp, commit_ts: TimeStamp)
[src][−]
Changes the ProcessResult
to WriteConflict
.
It may be invoked more than once.
fn deadlock_with(
&mut self,
deadlock_key_hash: u64,
wait_chain: Vec<WaitForEntry>
)
[src][−]
&mut self,
deadlock_key_hash: u64,
wait_chain: Vec<WaitForEntry>
)
Changes the ProcessResult
to Deadlock
.
fn extract_key_info(&mut self) -> (Vec<u8>, Vec<u8>)
[src][−]
Extracts key and primary key from ProcessResult
.
Auto Trait Implementations
impl !RefUnwindSafe for Waiter
impl !Send for Waiter
impl !Sync for Waiter
impl Unpin for Waiter
impl !UnwindSafe for Waiter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>,
[src][+]
W: ConvertTo<V>,
impl<T> From<T> for T
[src][+]
impl<T> Instrument for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Pointable for T
[src][+]
impl<T> Pointable for T
[src][+]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,