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>
impl<C: MessageConsumer> MessageSourceDriver<C>
Trait Implementations§
Source§impl<C: MessageConsumer> SourceDriver for MessageSourceDriver<C>
impl<C: MessageConsumer> SourceDriver for MessageSourceDriver<C>
Source§fn connector_name(&self) -> &'static str
fn connector_name(&self) -> &'static str
The connector’s name, the
connector metric label.Source§fn config_schema(&self) -> Value
fn config_schema(&self) -> Value
The JSON Schema of the connector’s config.
Source§fn dataset_uri(&self) -> String
fn dataset_uri(&self) -> String
The dataset this source reads, for lineage (credential-free).
Source§fn call_context(&self) -> CallContext
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
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>
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,
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,
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>
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,
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
fn deterministic_replay(&self) -> bool
Whether a resumed read replays exactly what follows the bookmark.
Source§fn set_cancel(&self, cancel: CancellationToken) -> bool
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
fn capabilities(&self, derived: Capabilities) -> Capabilities
Adjust the capabilities
DriverSource derived. Default: unchanged.Source§fn set_run_clock(&self, now: DateTime<Utc>)
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)
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>)
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]
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>
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
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>
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
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,
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§
impl<T> Allocation for T
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request