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<Pipeline, BuildError>
pub fn from_path(path: &Path) -> Result<Pipeline, BuildError>
Load configuration from a YAML file and initialize the process; see
from_config.
Sourcepub fn from_config(config: PipelineConfig) -> Result<Pipeline, BuildError>
pub fn from_config(config: PipelineConfig) -> Result<Pipeline, 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>(&self, future: F) -> <F as Future>::Outputwhere
F: Future,
pub fn block_on<F>(&self, future: F) -> <F as Future>::Outputwhere
F: Future,
Run a future on the I/O runtime, blocking this thread — for async pre-flight steps such as schema validation.
Sourcepub fn sink<B>(self, bundle: B) -> Result<Pipeline, BuildError>where
B: SinkBundle,
pub fn sink<B>(self, bundle: B) -> Result<Pipeline, BuildError>where
B: SinkBundle,
Install the sink with default SinkOptions; see
sink_with.
Sourcepub fn sink_with<B>(
self,
bundle: B,
options: SinkOptions,
) -> Result<Pipeline, BuildError>where
B: SinkBundle,
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.
Sourcepub fn chains<F>(self, factory: F) -> Pipeline
pub fn chains<F>(self, factory: F) -> Pipeline
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) -> Pipeline
pub fn runtime_options(self, options: RuntimeOptions) -> Pipeline
Override the runtime options (signal handling, loop timings).
Sourcepub fn into_runtime<S>(
self,
source: S,
) -> Result<PipelineRuntime<S>, BuildError>where
S: Source + 'static,
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.
Sourcepub fn run<S>(self, source: S) -> Result<ExitReport, PipelineError>where
S: Source + 'static,
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§
Auto Trait Implementations§
impl !Freeze for Pipeline
impl !RefUnwindSafe for Pipeline
impl Send for Pipeline
impl !Sync for Pipeline
impl Unpin for Pipeline
impl UnsafeUnpin for Pipeline
impl !UnwindSafe for Pipeline
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
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