Skip to main content

Pipeline

Struct Pipeline 

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

The pipeline builder — see the module docs for the full picture.

Non-generic, nameable, and storable: the source type enters only at the terminal into_runtime/run call.

Implementations§

Source§

impl Pipeline

Source

pub fn from_path(path: &Path) -> Result<Pipeline, BuildError>

Load configuration from a YAML file and initialize the process; see from_config.

Source

pub fn from_config(config: PipelineConfig) -> Result<Pipeline, BuildError>

Initialize the process from an already-loaded configuration:

  1. Telemetrytelemetry::init(Json, "info"). Idempotent: to customize the format or filter, call telemetry::init yourself first (the binaries-init convention).
  2. Metrics exporter — installed from the config’s metrics section before you can construct any handle, so every handle built while holding the Pipeline is live. When a foreign recorder already owns the process, the pipeline continues against it with a warning.
  3. The I/O runtimepipeline.io_threads workers, thread name etl-io. Connectors that need a handle before run (schema fetchers, async pre-flight validation) use io_handle/block_on.
§Errors

BuildError::AsyncContext when called from inside an async runtime — build pipelines from a plain thread, usually main.

Source

pub fn config(&self) -> &PipelineConfig

The loaded configuration — connector sections (config().source, .deserializer, .sink) still belong to the caller’s connector factories.

Source

pub fn metrics(&self) -> &MetricsHandle

The installed exporter’s handle (rendering, upkeep).

Source

pub fn budget(&self) -> &Arc<InflightBudget>

The shared in-flight byte budget.

Source

pub fn io_handle(&self) -> Handle

A handle to the I/O runtime, for connector edge work that must start before the chain exists (schema-registry fetchers, …). Valid until run returns.

Source

pub fn block_on<F>(&self, future: F) -> <F as Future>::Output
where F: Future,

Run a future on the I/O runtime, blocking this thread — for async pre-flight steps such as schema validation.

Source

pub fn sink<B>(self, bundle: B) -> Result<Pipeline, BuildError>
where B: SinkBundle,

Install the sink with default SinkOptions; see sink_with.

Source

pub fn sink_with<B>( self, bundle: B, options: SinkOptions, ) -> Result<Pipeline, BuildError>
where B: SinkBundle,

Install the sink: builds the per-shard chunk queues, registers the per-shard metrics (E2E basis from the config), spawns the SinkPool workers on the I/O runtime, and wires the drain and readiness probe.

§Errors

BuildError::SinkAlreadySet on a second call; BuildError::Sink for an empty or ragged topology, label shapes that do not match it, or a zero queue capacity.

Source

pub fn chains<F>(self, factory: F) -> Pipeline
where F: FnMut(ChainCtx) -> Box<dyn RunnableChain> + Send + 'static,

Install the chain factory, called once per pipeline thread with that thread’s ChainCtx. Composition inside the closure is fully monomorphized (chain_owned and friends); the returned Box<dyn RunnableChain> is the same single per-batch erasure boundary as always.

Source

pub fn runtime_options(self, options: RuntimeOptions) -> Pipeline

Override the runtime options (signal handling, loop timings).

Source

pub fn into_runtime<S>( self, source: S, ) -> Result<PipelineRuntime<S>, BuildError>
where S: Source + 'static,

Finish assembly into a PipelineRuntime — for callers that need shutdown_handle before a spawned run (tests, embedded pipelines). The I/O runtime moves into it and is shut down when run returns.

§Errors

BuildError::MissingSink / BuildError::MissingChains when a step was skipped.

Source

pub fn run<S>(self, source: S) -> Result<ExitReport, PipelineError>
where S: Source + 'static,

into_runtime + PipelineRuntime::run: run the pipeline to completion, blocking until a shutdown signal drains it or a fatal error stops it.

Trait Implementations§

Source§

impl Debug for Pipeline

Source§

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

Formats the value using the given formatter. 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
§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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> Is for T
where T: ?Sized,

§

type EqTo = T

§

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
§

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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

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