pub struct ScriptedCoordinator { /* private fields */ }Expand description
A SplitCoordinator whose events and outcomes are scripted by the
paired CoordinatorScript. Build both with scripted_coordinator.
Trait Implementations§
Source§impl Debug for ScriptedCoordinator
impl Debug for ScriptedCoordinator
Source§impl SplitCoordinator for ScriptedCoordinator
impl SplitCoordinator for ScriptedCoordinator
Source§fn start(
&mut self,
planner: Box<dyn SplitPlanner>,
) -> Result<(), CoordinationError>
fn start( &mut self, planner: Box<dyn SplitPlanner>, ) -> Result<(), CoordinationError>
Join the job: verify the fingerprint, hand over this worker’s
planner (used only if and while this instance is elected leader),
and start the backend’s claim and renewal machinery. Called exactly
once, before any other method.
Source§fn set_waker(&mut self, waker: ControlWaker)
fn set_waker(&mut self, waker: ControlWaker)
Source§fn poll(&mut self) -> Result<Vec<CoordinationEvent>, CoordinationError>
fn poll(&mut self) -> Result<Vec<CoordinationEvent>, CoordinationError>
Ownership and job-state changes since the last call. Must not
block — return whatever is pending, including nothing. The driver
parks on the
ControlWaker instead.Source§fn commit(
&mut self,
split: &SplitId,
progress: &SplitProgress,
) -> Result<(), CoordinationError>
fn commit( &mut self, split: &SplitId, progress: &SplitProgress, ) -> Result<(), CoordinationError>
Fenced durable commit of one owned split’s progress.
Ok means
durable. Fenced means the split
is no longer owned and nothing was written — stop the split,
never retry the write. Retryable
leaves the previous committed state authoritative; re-committing
the merged progress on the next tick is idempotent. Read moreSource§fn fail(
&mut self,
split: &SplitId,
reason: &str,
) -> Result<(), CoordinationError>
fn fail( &mut self, split: &SplitId, reason: &str, ) -> Result<(), CoordinationError>
Report an owned split as unprocessable by this tenancy: consumes
one delivery attempt and releases it for another worker to retry.
At the backend’s attempt cap the split is quarantined instead
(
CoordinationEvent::Quarantined). Use for poison input; a
transient local problem is better handled by
release, which consumes nothing.Source§fn release(&mut self, splits: &[SplitId]) -> Result<(), CoordinationError>
fn release(&mut self, splits: &[SplitId]) -> Result<(), CoordinationError>
Voluntarily hand back owned splits (shutdown, scale-down) so peers
claim them without waiting out a lease. Consumes no delivery
attempts. Best-effort and idempotent; splits not released simply
expire.
Source§fn release_drained(
&mut self,
splits: &[SplitId],
) -> Result<(), CoordinationError>
fn release_drained( &mut self, splits: &[SplitId], ) -> Result<(), CoordinationError>
Release splits given up through a cooperative revocation — the owner
has drained each split, committed its tail, and is now handing it
back. Semantically a
release
(attempt-free, best-effort, idempotent), but distinguished so a
revocation-aware backend can record the drain as having completed
and never mistake a single-split revocation for a departure from the
fleet. Read moreSource§fn decline_revoke(&mut self, _split: &SplitId) -> Result<(), CoordinationError>
fn decline_revoke(&mut self, _split: &SplitId) -> Result<(), CoordinationError>
Decline a
RevokeRequested
the embedder cannot serve — the source refused to stop the split’s
intake, or the split is not in a drainable state. Read moreAuto Trait Implementations§
impl Freeze for ScriptedCoordinator
impl RefUnwindSafe for ScriptedCoordinator
impl Send for ScriptedCoordinator
impl Sync for ScriptedCoordinator
impl Unpin for ScriptedCoordinator
impl UnsafeUnpin for ScriptedCoordinator
impl UnwindSafe for ScriptedCoordinator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more