Skip to main content

RowChunkDriver

Struct RowChunkDriver 

Source
pub struct RowChunkDriver<C> { /* private fields */ }
Expand description

Long-lived SourceDriver over a RowChunkSource (CSV-like full-sync pattern).

Each poll loads one chunk, converts rows to upsert changes, and returns them as positioned events. run_source_runtime may poll the next chunk while earlier chunks are still transforming or sinking.

Implementations§

Source§

impl<C> RowChunkDriver<C>

Source

pub fn new(source: C) -> Self

Wrap a chunk source. next_index seeds Row::index / positions.

Source

pub fn sunk_count(&self) -> u64

Rows successfully sunk (pre-transform input count via SourceDriver::note_sunk_events).

Trait Implementations§

Source§

impl<C> SourceDriver for RowChunkDriver<C>
where C: RowChunkSource,

Source§

type Position = u64

Checkpoint / resume position type.
Source§

fn poll_work<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<PositionedEvent<Self::Position>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Next work items (row and/or relation changes). May be empty on idle.
Source§

fn advance_watermark<'life0, 'async_trait>( &'life0 mut self, _position: Self::Position, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Mark position sink-safe. May be in-memory only, broker offset commit, or both — durable store writes belong in persist_checkpoint unless policy is CheckpointPolicy::AdvanceOnly.
Source§

fn is_finished(&self) -> bool

Whether the driver will produce no more work (EOF).
Source§

fn checkpoint_policy(&self) -> CheckpointPolicy

Checkpoint persistence policy. Default: CheckpointPolicy::PersistAfterAdvance.
Source§

fn note_sunk_events(&mut self, count: u64)

Notify the driver that count input (pre-transform) events are accounted for before advance_watermark. Read more
Source§

fn between_events<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ControlSignal>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Polled between apply cycles; return control signals to handle before the next poll_work.
Source§

fn on_schema_refresh<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle ControlSignal::SchemaRefresh. Default: no-op.
Source§

fn on_adhoc_snapshot<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _tables: &'life1 [String], _apply: &'life2 dyn AdhocApply, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn stop_reason(&self) -> Option<StopReason>

If Some, the runtime stops after draining in-flight apply work.
Source§

fn persist_checkpoint<'life0, 'async_trait>( &'life0 mut self, _position: Self::Position, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Persist a sink-safe checkpoint (called after successful sink + advance_watermark according to CheckpointPolicy). Default: no-op.
Source§

fn read_progress_for_persist<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Position>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Optional sink-safe position to persist when CheckpointPolicy::IntervalWhenDrained finds the apply window empty but nothing was advanced since the last persist (e.g. filtered-only binlog traffic that advanced the read cursor with no work items). Read more

Auto Trait Implementations§

§

impl<C> Freeze for RowChunkDriver<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for RowChunkDriver<C>
where C: RefUnwindSafe,

§

impl<C> Send for RowChunkDriver<C>
where C: Send,

§

impl<C> Sync for RowChunkDriver<C>
where C: Sync,

§

impl<C> Unpin for RowChunkDriver<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for RowChunkDriver<C>
where C: UnsafeUnpin,

§

impl<C> UnwindSafe for RowChunkDriver<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more