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
impl Pipeline
Sourcepub fn from_path(path: &Path) -> Result<Self, BuildError>
pub fn from_path(path: &Path) -> Result<Self, BuildError>
Load configuration from a YAML file and initialize the process; see
from_config.
Sourcepub fn from_config(config: PipelineConfig) -> Result<Self, BuildError>
pub fn from_config(config: PipelineConfig) -> Result<Self, BuildError>
Initialize the process from an already-loaded configuration:
- Telemetry —
telemetry::init(Json, "info"). Idempotent: to customize the format or filter, calltelemetry::inityourself first (the binaries-init convention). - Metrics exporter — installed from the config’s
metricssection before you can construct any handle, so every handle built while holding thePipelineis live. When a foreign recorder already owns the process, the pipeline continues against it with a warning. - The I/O runtime —
pipeline.io_threadsworkers, thread nameetl-io. Connectors that need a handle beforerun(schema fetchers, async pre-flight validation) useio_handle/block_on.
§Errors
BuildError::AsyncContext when called from inside an async
runtime — build pipelines from a plain thread, usually main.
Sourcepub fn config(&self) -> &PipelineConfig
pub fn config(&self) -> &PipelineConfig
The loaded configuration — connector sections (config().source,
.deserializer, .sink) still belong to the caller’s connector
factories.
Sourcepub fn metrics(&self) -> &MetricsHandle
pub fn metrics(&self) -> &MetricsHandle
The installed exporter’s handle (rendering, upkeep).
Sourcepub fn budget(&self) -> &Arc<InflightBudget> ⓘ
pub fn budget(&self) -> &Arc<InflightBudget> ⓘ
The shared in-flight byte budget.
Sourcepub fn io_handle(&self) -> Handle
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.
Sourcepub fn block_on<F: Future>(&self, future: F) -> F::Output
pub fn block_on<F: Future>(&self, future: F) -> F::Output
Run a future on the I/O runtime, blocking this thread — for async pre-flight steps such as schema validation.
Sourcepub fn sink<B: SinkBundle>(self, bundle: B) -> Result<Self, BuildError>
pub fn sink<B: SinkBundle>(self, bundle: B) -> Result<Self, BuildError>
Install the sink with default SinkOptions; see
sink_with.
Sourcepub fn sink_with<B: SinkBundle>(
self,
bundle: B,
options: SinkOptions,
) -> Result<Self, BuildError>
pub fn sink_with<B: SinkBundle>( self, bundle: B, options: SinkOptions, ) -> Result<Self, BuildError>
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.
Sourcepub fn chains<F>(self, factory: F) -> Self
pub fn chains<F>(self, factory: F) -> Self
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.
Sourcepub fn runtime_options(self, options: RuntimeOptions) -> Self
pub fn runtime_options(self, options: RuntimeOptions) -> Self
Override the runtime options (signal handling, loop timings).
Sourcepub fn into_runtime<S: Source + 'static>(
self,
source: S,
) -> Result<PipelineRuntime<S>, BuildError>
pub fn into_runtime<S: Source + 'static>( self, source: S, ) -> Result<PipelineRuntime<S>, BuildError>
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.
Sourcepub fn run<S: Source + 'static>(
self,
source: S,
) -> Result<ExitReport, PipelineError>
pub fn run<S: Source + 'static>( self, source: S, ) -> Result<ExitReport, PipelineError>
into_runtime + PipelineRuntime::run:
run the pipeline to completion, blocking until a shutdown signal
drains it or a fatal error stops it.