#[non_exhaustive]pub struct SinkParts<W: ShardWriter> {
pub writer: W,
pub shard_endpoints: Vec<Vec<W::Endpoint>>,
pub pool: SinkPoolConfig,
pub component_type: String,
pub replica_labels: Vec<Vec<String>>,
pub probe: Option<SinkProbeFn>,
}Expand description
The decomposed sink. Construct with SinkParts::new and refine with
the with_* methods (the struct is #[non_exhaustive]; fields may be
added without breaking implementors).
shard_endpoints is indexed [shard][replica] and must be non-empty
with every shard holding at least one replica — the builder rejects
ragged or empty topologies before anything spawns.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.writer: WThe connector’s writer, shared by every shard worker.
shard_endpoints: Vec<Vec<W::Endpoint>>Per-shard replica endpoints, [shard][replica].
pool: SinkPoolConfigPool tuning (batching, inflight, retry, breaker).
component_type: StringThe component_type metric label (e.g. "clickhouse").
replica_labels: Vec<Vec<String>>Per-replica display labels for shard metrics, same shape as
shard_endpoints. Defaults to "{component_type}-{shard}-{replica}".
probe: Option<SinkProbeFn>Optional readiness probe. Probes should use their own client set — sharing the writer’s connections would report the insert path healthy simply because probing keeps it warm.
Implementations§
Source§impl<W: ShardWriter> SinkParts<W>
impl<W: ShardWriter> SinkParts<W>
Sourcepub fn new(
writer: W,
shard_endpoints: Vec<Vec<W::Endpoint>>,
pool: SinkPoolConfig,
) -> Self
pub fn new( writer: W, shard_endpoints: Vec<Vec<W::Endpoint>>, pool: SinkPoolConfig, ) -> Self
Minimal parts: component_type defaults to "custom", replica
labels to "{component_type}-{shard}-{replica}", no probe.
Sourcepub fn with_component_type(self, component_type: impl Into<String>) -> Self
pub fn with_component_type(self, component_type: impl Into<String>) -> Self
Set the component_type metric label.
Sourcepub fn with_replica_labels(self, labels: Vec<Vec<String>>) -> Self
pub fn with_replica_labels(self, labels: Vec<Vec<String>>) -> Self
Set per-replica display labels (same [shard][replica] shape as
the endpoints).
Sourcepub fn with_probe(self, probe: SinkProbeFn) -> Self
pub fn with_probe(self, probe: SinkProbeFn) -> Self
Attach a readiness probe.
Sourcepub fn effective_replica_labels(&self) -> Vec<Vec<String>>
pub fn effective_replica_labels(&self) -> Vec<Vec<String>>
The replica labels to use: the configured ones, or the
"{component_type}-{shard}-{replica}" defaults. Manual assemblies
can feed these to
SinkShardMetrics::new.
Trait Implementations§
Source§impl<W: ShardWriter> Debug for SinkParts<W>
impl<W: ShardWriter> Debug for SinkParts<W>
Source§impl<W: ShardWriter> SinkBundle for SinkParts<W>
impl<W: ShardWriter> SinkBundle for SinkParts<W>
Source§type Writer = W
type Writer = W
ShardWriter implementation.