pub struct CoordinationDriver { /* private fields */ }Expand description
Source-side coordination choreography, embedded by a coordinated source; see the module docs for the protocol it implements.
Implementations§
Source§impl CoordinationDriver
impl CoordinationDriver
Sourcepub fn new(coordinator: Box<dyn SplitCoordinator>) -> CoordinationDriver
pub fn new(coordinator: Box<dyn SplitCoordinator>) -> CoordinationDriver
Wrap a coordinator handle.
Sourcepub fn stall_drains(self, drains: bool) -> CoordinationDriver
pub fn stall_drains(self, drains: bool) -> CoordinationDriver
Treat CoordinationEvent::Stalled as a drain-with-warning
instead of a fatal error. Default false: a bounded job that
cannot finish because splits are quarantined fails loudly rather
than exiting as if it were complete.
Sourcepub fn start<L>(
&mut self,
planner: Box<dyn SplitPlanner>,
) -> Result<SourceEvent<L>, SourceError>
pub fn start<L>( &mut self, planner: Box<dyn SplitPlanner>, ) -> Result<SourceEvent<L>, SourceError>
Join the job. Returns the event the source must return from the
same poll_events call: the empty LanesAssigned ready signal
(it bumps the controller’s assignment epoch and marks the pipeline
running while splits are still being claimed).
Sourcepub fn poll_events<S>(
&mut self,
source: &mut S,
timeout: Duration,
) -> Result<SourceEvent<<S as SplitSource>::Lane>, SourceError>where
S: SplitSource,
pub fn poll_events<S>(
&mut self,
source: &mut S,
timeout: Duration,
) -> Result<SourceEvent<<S as SplitSource>::Lane>, SourceError>where
S: SplitSource,
Coordinated poll_events body: surfaces at most one controller
event per call, per the module docs.
Sourcepub fn commit<S>(
&mut self,
source: &mut S,
watermarks: &[(PartitionId, i64)],
) -> Result<(), SourceError>where
S: SplitSource,
pub fn commit<S>(
&mut self,
source: &mut S,
watermarks: &[(PartitionId, i64)],
) -> Result<(), SourceError>where
S: SplitSource,
Coordinated commit body: per-split fenced commits keyed by the
tenancy partition ids the driver minted.
Sourcepub fn fail<S>(
&mut self,
source: &mut S,
split: &SplitId,
reason: &str,
) -> Result<(), SourceError>where
S: SplitSource,
pub fn fail<S>(
&mut self,
source: &mut S,
split: &SplitId,
reason: &str,
) -> Result<(), SourceError>where
S: SplitSource,
Report an owned split as poison: consumes a delivery attempt and hands it back for another worker (or quarantine, at the cap). The split’s lane is retired through the normal loss path.
Sourcepub fn release(&mut self)
pub fn release(&mut self)
Best-effort graceful release of every held split, so peers claim
them without waiting out the lease. Call from the source’s Drop.
Sourcepub fn assignments(&self) -> Vec<(SplitId, LaneId)>
pub fn assignments(&self) -> Vec<(SplitId, LaneId)>
Current live split → lane view (pause/resume bookkeeping, tests).