Struct tikv::storage::txn::scheduler::Scheduler [−][src]
Scheduler which schedules the execution of storage::Command
s.
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]
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
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]
&self,
cmd: Command,
callback: StorageCallback
)
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]
StorageError: From<ER>,
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]
&self,
cid: u64,
pr: Option<ProcessResult>,
result: EngineResult<()>,
lock_guards: Vec<KeyHandleGuard>,
pipelined: bool,
async_apply_prewrite: bool,
tag: CommandKind
)
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]
&self,
cid: u64,
start_ts: TimeStamp,
pr: ProcessResult,
lock: Lock,
is_first_lock: bool,
wait_timeout: Option<WaitTimeout>,
diag_ctx: DiagnosticContext
)
Event handler for the request of waiting for lock
fn early_response(
cid: u64,
cb: StorageCallback,
pr: ProcessResult,
tag: CommandKind,
stage: CommandStageKind
)
[src]
cid: u64,
cb: StorageCallback,
pr: ProcessResult,
tag: CommandKind,
stage: CommandStageKind
)
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]
self,
snapshot: E::Snap,
task: Task,
statistics: &mut Statistics
)
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]
self,
engine: &E,
snapshot: E::Snap,
task: Task,
statistics: &mut Statistics
)
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]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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,
E: Sync,
L: Sync,
impl<E, L> Unpin for Scheduler<E, L> where
E: Unpin,
E: Unpin,
impl<E, L> !UnwindSafe for Scheduler<E, L>
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,