Skip to main content

ShardWriter

Trait ShardWriter 

Source
pub trait ShardWriter:
    Send
    + Sync
    + 'static {
    type Endpoint: Send + Sync + 'static;

    // Required method
    fn write_batch(
        &self,
        endpoint: &Self::Endpoint,
        batch: &SealedBatch,
    ) -> impl Future<Output = Result<(), SinkError>> + Send;

    // Provided method
    fn probe(
        &self,
        endpoint: &Self::Endpoint,
    ) -> impl Future<Output = Result<(), SinkError>> + Send { ... }
}
Expand description

The I/O half of a sink connector: writes one sealed batch to one replica endpoint. Returning Ok is the durable-ack point — only then may the framework resolve the batch’s acknowledgements.

Required Associated Types§

Source

type Endpoint: Send + Sync + 'static

A connected replica endpoint (e.g. one HTTP client per replica).

Required Methods§

Source

fn write_batch( &self, endpoint: &Self::Endpoint, batch: &SealedBatch, ) -> impl Future<Output = Result<(), SinkError>> + Send

Write batch to endpoint durably.

Provided Methods§

Source

fn probe( &self, endpoint: &Self::Endpoint, ) -> impl Future<Output = Result<(), SinkError>> + Send

Connectivity probe for readiness. Defaults to healthy.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl ShardWriter for ClickHouseWriter

§

type Endpoint = ClickHouseEndpoint

§

async fn write_batch( &self, endpoint: &ClickHouseEndpoint, batch: &SealedBatch, ) -> Result<(), SinkError>

§

async fn probe(&self, endpoint: &ClickHouseEndpoint) -> Result<(), SinkError>

Implementors§