Struct tikv::storage::txn::scheduler::Scheduler[][src]

pub struct Scheduler<E: Engine, L: LockManager> {
    engine: Option<E>,
    inner: Arc<SchedulerInner<L>>,
}

Scheduler which schedules the execution of storage::Commands.

Fields

engine: Option<E>inner: Arc<SchedulerInner<L>>

Implementations

impl<E: Engine, L: LockManager> Scheduler<E, L>[src]

pub(in storage) fn new(
    engine: E,
    lock_mgr: L,
    concurrency_manager: ConcurrencyManager,
    concurrency: usize,
    worker_pool_size: usize,
    sched_pending_write_threshold: usize,
    pipelined_pessimistic_lock: Arc<AtomicBool>,
    enable_async_apply_prewrite: bool
) -> Self
[src]

Creates a scheduler.

pub fn dump_wait_for_entries(&self, cb: Callback)[src]

pub(in storage) fn run_cmd(
    &self,
    cmd: Command,
    callback: StorageCallback
)
[src]

fn release_lock(&self, lock: &Lock, cid: u64)[src]

Releases all the latches held by a command.

fn schedule_command(&self, cmd: Command, callback: StorageCallback)[src]

fn try_to_wake_up(&self, cid: u64)[src]

Tries to acquire all the necessary latches. If all the necessary latches are acquired, the method initiates a get snapshot operation for further processing.

fn get_sched_pool(&self, priority: CommandPri) -> &SchedPool[src]

fn execute(&self, task: Task)[src]

Initiates an async operation to get a snapshot from the storage engine, then execute the task in the sched pool.

fn finish_with_err<ER>(&self, cid: u64, err: ER) where
    StorageError: From<ER>, 
[src]

Calls the callback with an error.

fn on_read_finished(&self, cid: u64, pr: ProcessResult, tag: CommandKind)[src]

Event handler for the success of read.

If a next command is present, continues to execute; otherwise, delivers the result to the callback.

fn on_write_finished(
    &self,
    cid: u64,
    pr: Option<ProcessResult>,
    result: EngineResult<()>,
    lock_guards: Vec<KeyHandleGuard>,
    pipelined: bool,
    async_apply_prewrite: bool,
    tag: CommandKind
)
[src]

Event handler for the success of write.

fn on_wait_for_lock(
    &self,
    cid: u64,
    start_ts: TimeStamp,
    pr: ProcessResult,
    lock: Lock,
    is_first_lock: bool,
    wait_timeout: Option<WaitTimeout>,
    diag_ctx: DiagnosticContext
)
[src]

Event handler for the request of waiting for lock

fn early_response(
    cid: u64,
    cb: StorageCallback,
    pr: ProcessResult,
    tag: CommandKind,
    stage: CommandStageKind
)
[src]

fn process_by_worker(self, snapshot: E::Snap, task: Task)[src]

Delivers a command to a worker thread for processing.

fn process_read(
    self,
    snapshot: E::Snap,
    task: Task,
    statistics: &mut Statistics
)
[src]

Processes a read command within a worker thread, then posts ReadFinished message back to the Scheduler.

fn process_write(
    self,
    engine: &E,
    snapshot: E::Snap,
    task: Task,
    statistics: &mut Statistics
)
[src]

Processes a write command within a worker thread, then posts either a WriteFinished message if successful or a FinishedWithErr message back to the Scheduler.

fn check_task_deadline_exceeded(&self, task: &Task) -> bool[src]

If the task has expired, return true and call the callback of the task with a DeadlineExceeded error.

Trait Implementations

impl<E: Engine, L: LockManager> Clone for Scheduler<E, L>[src]

impl<E: Engine, L: LockManager> Send for Scheduler<E, L>[src]

Auto Trait Implementations

impl<E, L> !RefUnwindSafe for Scheduler<E, L>

impl<E, L> Sync for Scheduler<E, L> where
    E: Sync,
    L: Sync

impl<E, L> Unpin for Scheduler<E, L> where
    E: Unpin

impl<E, L> !UnwindSafe for Scheduler<E, L>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<V, W> ConvertFrom<W> for V where
    W: ConvertTo<V>, 
[src]

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]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]