pub struct SinkHandoff<F: RecFamily, E, R> { /* private fields */ }Expand description
The chain’s terminal stage. Owns one accumulation buffer per shard,
seals EncodedChunks at ChunkConfig::target_bytes, and hands
them to the sink workers through the bounded ShardQueues — a
try_send that never blocks the pipeline thread.
Trait Implementations§
Source§impl<F: RecFamily, E, R> Drop for SinkHandoff<F, E, R>
Teardown safety: un-sent output (parked chunks after a drain deadline,
partial shard buffers) holds its acknowledgements in fail-on-drop
AckSets, so tearing the handoff down stalls those watermarks and the
records replay after restart — at-least-once over completeness, always.
This Drop only reconciles the in-flight byte budget for parked chunks
(their bytes were added at seal time).
impl<F: RecFamily, E, R> Drop for SinkHandoff<F, E, R>
Teardown safety: un-sent output (parked chunks after a drain deadline,
partial shard buffers) holds its acknowledgements in fail-on-drop
AckSets, so tearing the handoff down stalls those watermarks and the
records replay after restart — at-least-once over completeness, always.
This Drop only reconciles the in-flight byte budget for parked chunks
(their bytes were added at seal time).
Source§impl<F: RecFamily, E, R> StageLifecycle for SinkHandoff<F, E, R>where
E: RowEncoder<F> + Clone,
impl<F: RecFamily, E, R> StageLifecycle for SinkHandoff<F, E, R>where
E: RowEncoder<F> + Clone,
Source§fn on_batch_end(&mut self, elapsed: Duration)
fn on_batch_end(&mut self, elapsed: Duration)
Flush per-batch metric accumulators.
elapsed is the chain-level
batch duration: per-stage attribution inside one inlined loop is
not measurable without per-record clocks, so every stage reports
the chain figure, keeping the histograms comparable.Source§fn take_fatal(&mut self) -> Option<FatalError>
fn take_fatal(&mut self) -> Option<FatalError>
Take the first fatal error recorded by any stage.
Source§fn relieve(&mut self) -> Flow
fn relieve(&mut self) -> Flow
Let the terminal stage drain parked output.
Flow::Blocked means
it is still backed up and the chain must not accept new payloads.Source§fn flush_terminal(&mut self) -> Flow
fn flush_terminal(&mut self) -> Flow
Seal and hand off all terminal buffers, partial chunks included.
Flow::Blocked means not everything could be sent; retry later.Auto Trait Implementations§
impl<F, E, R> Freeze for SinkHandoff<F, E, R>where
R: Freeze,
impl<F, E, R> !RefUnwindSafe for SinkHandoff<F, E, R>
impl<F, E, R> Send for SinkHandoff<F, E, R>
impl<F, E, R> Sync for SinkHandoff<F, E, R>
impl<F, E, R> Unpin for SinkHandoff<F, E, R>
impl<F, E, R> UnsafeUnpin for SinkHandoff<F, E, R>where
R: UnsafeUnpin,
impl<F, E, R> !UnwindSafe for SinkHandoff<F, E, R>
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