pub struct ClickHouseWriter { /* private fields */ }Expand description
Writes sealed batches: one INSERT ... FORMAT <fmt> per batch (the
format — RowBinary or Native — is baked into insert_sql), carrying the
batch’s deduplication token so retries — including on other replicas —
are idempotent within the server’s dedup window. The transport is
format-agnostic: frames concatenate to the request body (RowBinary rows
or a stream of Native blocks). write_batch returning Ok is the
durable-ack point (the server confirmed the insert, materialized views
included, thanks to wait_end_of_query=1).
Implementations§
Source§impl ClickHouseWriter
impl ClickHouseWriter
Sourcepub fn insert_sql(&self) -> &str
pub fn insert_sql(&self) -> &str
The exact INSERT statement this writer issues.
Trait Implementations§
Source§impl Clone for ClickHouseWriter
impl Clone for ClickHouseWriter
Source§fn clone(&self) -> ClickHouseWriter
fn clone(&self) -> ClickHouseWriter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClickHouseWriter
impl Debug for ClickHouseWriter
Source§impl ShardWriter for ClickHouseWriter
impl ShardWriter for ClickHouseWriter
Source§type Endpoint = ClickHouseEndpoint
type Endpoint = ClickHouseEndpoint
A connected replica endpoint (e.g. one HTTP client per replica).
Source§async fn write_batch(
&self,
endpoint: &ClickHouseEndpoint,
batch: &SealedBatch,
) -> Result<(), SinkError>
async fn write_batch( &self, endpoint: &ClickHouseEndpoint, batch: &SealedBatch, ) -> Result<(), SinkError>
Source§async fn probe(&self, endpoint: &ClickHouseEndpoint) -> Result<(), SinkError>
async fn probe(&self, endpoint: &ClickHouseEndpoint) -> Result<(), SinkError>
Connectivity probe for readiness. Defaults to healthy.
Source§fn attach_metrics(&mut self, meter: Option<Meter>)
fn attach_metrics(&mut self, meter: Option<Meter>)
Receive a
Meter scoped spate_<component_type>_sink_* for the sink’s
own metric families, pre-labelled with the standard
pipeline/component/component_type. Called once by the builder
before the writer is shared across shard workers; resolve handles here
and store them (they are Arc-backed, so write_batch’s &self can
touch them). None when the sink’s component_type cannot scope a
family: the default "custom" (reserved for pipeline-author metrics) or
a reserved root opts out silently, and a malformed value is logged and
also yields None — so declare a distinct component_type via
SinkParts::with_component_type
to receive a scope. Defaults to ignoring it.Auto Trait Implementations§
impl Freeze for ClickHouseWriter
impl RefUnwindSafe for ClickHouseWriter
impl Send for ClickHouseWriter
impl Sync for ClickHouseWriter
impl Unpin for ClickHouseWriter
impl UnsafeUnpin for ClickHouseWriter
impl UnwindSafe for ClickHouseWriter
Blanket Implementations§
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