Thalweg · API reference ← Main docs

ZerobusSink

Struct ZerobusSink 

Source
pub struct ZerobusSink { /* private fields */ }
Expand description

A Databricks Zerobus sink for one target table.

Implementations§

Source§

impl ZerobusSink

Source

pub async fn start( id: impl Into<String>, table: TableRef, schema: Arc<Schema>, config: ZerobusConfig, deps: ZerobusSinkDeps, peak_mb_per_s: f64, ) -> Result<Self, ZerobusSinkError>

Provision the table and open the stream pool.

peak_mb_per_s sizes the pool (§3.3). Provisioning is delegated to the catalog (create/evolve, register, vend); the primary-raw preconditions are checked against the freshly-described live table.

§Errors

ZerobusSinkError if provisioning, the precondition check, or opening the pool fails.

Source

pub fn metrics(&self) -> &Arc<Metrics>

A snapshot of the sink’s metrics (for observability wiring / tests).

Source

pub async fn close(self)

Drain to durability and close the pool (graceful shutdown). Consumes the sink so no further writes are possible.

Trait Implementations§

Source§

impl BatchSink for ZerobusSink

Source§

fn push<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, batch: &'life1 RecordBatch, span: &'life2 OffsetSpan, ) -> Pin<Box<dyn Future<Output = Result<(), SinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Submit batch (covering source positions span) fire-and-forget. Read more
Source§

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

Close the current batching window; return what was submitted and the submitted high-water span. Does not block on durability. Read more
Source§

impl Debug for ZerobusSink

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Sink for ZerobusSink

Source§

fn send<'life0, 'async_trait>( &'life0 mut self, batch: RecordBatch, span: OffsetSpan, ) -> Pin<Box<dyn Future<Output = Result<Receipt, SinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Accept batch covering source positions span, returning as soon as the transport accepts it. Must not block on durable acknowledgement. Read more
Source§

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

Drain to durability: await outstanding acknowledgements. Used at shutdown and at explicit checkpoint boundaries, not on the hot path. Read more

Auto Trait Implementations§

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

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

impl<L> LayerExt<L> for L

§

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].
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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 = 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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

§

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

§

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