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: TimeStampcb: StorageCallbackpr: ProcessResultThe 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: Lockdiag_ctx: DiagnosticContextdelay: Delay_lifetime_timer: HistogramTimerImplementations
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,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>, [src]
W: ConvertTo<V>,
pub fn convert_from(ctx: &mut EvalContext, from: W) -> Result<V, Error>[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointable for T[src]
pub const ALIGN: usize[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T[src]
pub unsafe fn drop(ptr: usize)[src]
impl<T> Pointable for T[src]
pub const ALIGN: usize[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T[src]
pub unsafe fn drop(ptr: usize)[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>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>, [src]
V: MultiLane<T>,