Skip to main content

SinkParts

Struct SinkParts 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§writer: W

The connector’s writer, shared by every shard worker.

§shard_endpoints: Vec<Vec<W::Endpoint>>

Per-shard replica endpoints, [shard][replica].

§pool: SinkPoolConfig

Pool tuning (batching, inflight, retry, breaker).

§component_type: String

The 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>

Source

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.

Source

pub fn with_component_type(self, component_type: impl Into<String>) -> Self

Set the component_type metric label.

Source

pub fn with_replica_labels(self, labels: Vec<Vec<String>>) -> Self

Set per-replica display labels (same [shard][replica] shape as the endpoints).

Source

pub fn with_probe(self, probe: SinkProbeFn) -> Self

Attach a readiness probe.

Source

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>

Source§

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

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

impl<W: ShardWriter> SinkBundle for SinkParts<W>

Source§

type Writer = W

The connector’s ShardWriter implementation.
Source§

fn into_parts(self) -> SinkParts<W>

Decompose into the parts the builder wires up. Consuming: the endpoints move into the sink pool.

Auto Trait Implementations§

§

impl<W> Freeze for SinkParts<W>
where W: Freeze,

§

impl<W> !RefUnwindSafe for SinkParts<W>

§

impl<W> Send for SinkParts<W>

§

impl<W> Sync for SinkParts<W>

§

impl<W> Unpin for SinkParts<W>
where W: Unpin, <W as ShardWriter>::Endpoint: Unpin,

§

impl<W> UnsafeUnpin for SinkParts<W>
where W: UnsafeUnpin,

§

impl<W> !UnwindSafe for SinkParts<W>

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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

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