Skip to main content

MessageSourceDriver

Struct MessageSourceDriver 

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

A MessageConsumer as a SourceDriver.

Each page carries a bookmark, so the pipeline flushes the sink after writing it; the page’s messages are acknowledged when the next page is requested (or the stream is polled to its end) — that is, only once the pipeline has written and flushed them. A run that fails before then acknowledges nothing it did not write, and the broker redelivers it.

Implementations§

Source§

impl<C: MessageConsumer> MessageSourceDriver<C>

Source

pub fn new(consumer: C) -> Self

The source driver over consumer.

Source

pub fn consumer(&self) -> &C

The consumer.

Trait Implementations§

Source§

impl<C: MessageConsumer> SourceDriver for MessageSourceDriver<C>

Source§

fn connector_name(&self) -> &'static str

The connector’s name, the connector metric label.
Source§

fn config_schema(&self) -> Value

The JSON Schema of the connector’s config.
Source§

fn dataset_uri(&self) -> String

The dataset this source reads, for lineage (credential-free).
Source§

fn call_context(&self) -> CallContext

The connector’s own call defaults. The run’s context is layered over it.
Source§

fn consumes_destructively(&self) -> bool

Whether reading removes what was read (a queue).
Source§

fn read<'a>( &'a self, calls: &'a CallSlot, _context: &'a HashMap<String, Value>, batch_size: usize, ) -> PageStream<'a>

Stream the dataset in pages of about batch_size records (0: one page). context holds the parent record of a fan-out row.
Source§

fn fetch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, calls: &'life1 CallSlot, _context: &'life2 HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Option<Result<(Vec<Value>, Option<Value>), FaucetError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

A buffered read with its own all-at-once path, returning the records and the bookmark to resume after them. None (the default): the buffered fetches drain read.
Source§

fn check<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, calls: &'life1 CallSlot, ctx: &'life2 CheckContext, ) -> Pin<Box<dyn Future<Output = Result<Option<CheckReport>, FaucetError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

A non-mutating preflight probe. None (the default) reads one page.
Source§

fn state_key(&self) -> Option<String>

The state key bookmarks are stored under, when the source resumes.
Source§

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

Resume after bookmark on the next read.
Source§

fn deterministic_replay(&self) -> bool

Whether a resumed read replays exactly what follows the bookmark.
Source§

fn set_cancel(&self, cancel: CancellationToken) -> bool

Take the run’s cancellation token. Return true when the source then yields what it buffered and ends, so the pipeline polls it to its end.
Source§

fn capabilities(&self, derived: Capabilities) -> Capabilities

Adjust the capabilities DriverSource derived. Default: unchanged.
Source§

fn set_run_clock(&self, now: DateTime<Utc>)

Receive the run clock (the instant ${now.*} renders from).
Source§

fn set_call_context(&self, ctx: CallContext)

The run’s call context, for a driver whose clients hold their own.
Source§

fn set_roundtrip_recorder(&self, recorder: Arc<RoundtripRecorder>)

The run’s round-trip recorder, for a driver whose clients hold their own.
Source§

fn native_output_formats(&self) -> &'static [NativeFormat]

Wire formats read_native can emit (#633).
Source§

fn read_native<'a>( &'a self, calls: &'a CallSlot, context: &'a HashMap<String, Value>, format: NativeFormat, batch_size: usize, ) -> NativeStream<'a>

Stream the dataset as raw bytes in a negotiated format.
Source§

fn supports_columnar(&self) -> bool

Available on crate feature arrow only.
Whether read_columnar is implemented.
Source§

fn read_columnar<'a>( &'a self, calls: &'a CallSlot, context: &'a HashMap<String, Value>, batch_size: usize, ) -> ColumnarStream<'a>

Available on crate feature arrow only.
Stream the dataset as Arrow batches.
Source§

fn supports_discover(&self) -> bool

Whether discover is implemented.
Source§

fn discover<'life0, 'life1, 'async_trait>( &'life0 self, calls: &'life1 CallSlot, ) -> Pin<Box<dyn Future<Output = Result<Vec<DatasetDescriptor>, FaucetError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Enumerate the datasets behind the connection (read-only, cheap).

Auto Trait Implementations§

§

impl<C> !Freeze for MessageSourceDriver<C>

§

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

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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