pub struct CoordinatorScript { /* private fields */ }Expand description
Scripting and observation handle for a ScriptedCoordinator.
Events queued between two poll calls are delivered as one batch,
matching the trait contract (“all pending events at once”) — queue a
lose and a gain
back to back to exercise same-batch interleavings.
Implementations§
Source§impl CoordinatorScript
impl CoordinatorScript
Sourcepub fn gain(
&self,
split: SplitSpec,
epoch: u64,
progress: Option<SplitProgress>,
)
pub fn gain( &self, split: SplitSpec, epoch: u64, progress: Option<SplitProgress>, )
Queue a CoordinationEvent::Gained for the next poll.
Sourcepub fn lose(&self, split: &SplitId)
pub fn lose(&self, split: &SplitId)
Queue a CoordinationEvent::Lost for the next poll.
Sourcepub fn quarantine(&self, split: &SplitId, attempts: u32)
pub fn quarantine(&self, split: &SplitId, attempts: u32)
Queue a CoordinationEvent::Quarantined for the next poll.
Sourcepub fn all_complete(&self)
pub fn all_complete(&self)
Queue CoordinationEvent::AllComplete for the next poll.
Sourcepub fn stalled(&self, completed: u64, quarantined: u64)
pub fn stalled(&self, completed: u64, quarantined: u64)
Queue CoordinationEvent::Stalled for the next poll.
Sourcepub fn fail_next_commit(&self, split: &SplitId, kind: CoordinationErrorKind)
pub fn fail_next_commit(&self, split: &SplitId, kind: CoordinationErrorKind)
Script the outcome of the next commit for split (repeat to
script a sequence). Unscripted commits succeed and are recorded.
Sourcepub fn commits(&self) -> Vec<(SplitId, SplitProgress)>
pub fn commits(&self) -> Vec<(SplitId, SplitProgress)>
Every successful commit so far, in order.
Sourcepub fn last_commit(&self, split: &SplitId) -> Option<SplitProgress>
pub fn last_commit(&self, split: &SplitId) -> Option<SplitProgress>
The last successful commit for split, if any.
Sourcepub fn take_planner(&self) -> Option<Box<dyn SplitPlanner>>
pub fn take_planner(&self) -> Option<Box<dyn SplitPlanner>>
Take the planner captured at start: run it directly to inspect
its plan, then feed the resulting splits back through
gain — this is how a source tests its
planner and its driver choreography together.
Trait Implementations§
Source§impl Clone for CoordinatorScript
impl Clone for CoordinatorScript
Source§fn clone(&self) -> CoordinatorScript
fn clone(&self) -> CoordinatorScript
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more