pub struct TickState {
pub examined: u32,
pub committed: u32,
pub attempted: u32,
/* private fields */
}Expand description
Physical-tick counters. Fetching a page reserves its rows before processing them, so an exhausted scan allowance does not discard an already read page.
Fields§
§examined: u32Rows fetched, including unknown, deferred and lookahead rows.
committed: u32Successfully committed timer batches.
attempted: u32Claimed handler invocations, including failures and races.
Implementations§
Source§impl TickState
impl TickState
Sourcepub fn new(clock: &dyn Clock, budget: TickBudget) -> Self
pub fn new(clock: &dyn Clock, budget: TickBudget) -> Self
Begin one physical tick. Reuse this state for all its logical partitions.
Sourcepub fn remaining_scanned(&self) -> u32
pub fn remaining_scanned(&self) -> u32
Rows that another page may fetch.
Sourcepub fn exhausted(&self, clock: &dyn Clock) -> bool
pub fn exhausted(&self, clock: &dyn Clock) -> bool
Whether another page or partition must wait for a later physical tick.
Sourcepub fn work_exhausted(&self, clock: &dyn Clock) -> bool
pub fn work_exhausted(&self, clock: &dyn Clock) -> bool
Whether processing must stop, including inside an already reserved page. The scan allowance is excluded because those rows were charged on fetch.
Sourcepub fn charge_scan(&mut self, rows: u32) -> bool
pub fn charge_scan(&mut self, rows: u32) -> bool
Reserve exactly the number of fetched rows. An oversized charge changes no counters; the caller must limit its query to the remaining allowance.
Sourcepub fn claim_attempt(
&mut self,
kind: TimerKind,
handler_cap: Option<u32>,
) -> bool
pub fn claim_attempt( &mut self, kind: TimerKind, handler_cap: Option<u32>, ) -> bool
Claim one handler invocation before it runs. A handler can lower its kind’s allowance, but cannot enlarge the shared physical-tick ceiling.
Sourcepub fn attempted_for(&self, kind: TimerKind) -> u32
pub fn attempted_for(&self, kind: TimerKind) -> u32
Invocations already claimed by this kind, for verification and reporting.