Skip to main content

InlineSource

Trait InlineSource 

Source
pub trait InlineSource: Send + Sync {
    // Required methods
    fn name(&self) -> String;
    fn tasks(&self) -> usize;
    fn open(&self, cx: SourceCtx) -> Result<Box<dyn Source + Send>, String>;

    // Provided methods
    fn describe(&self) -> String { ... }
    fn estimated_bytes(&self) -> Option<u64> { ... }
}
Expand description

A source provided from outside the engine — a connector’s (a Kafka topic, files, a database table, the Nexmark generator) or a host’s own. The runtime opens tasks of them; task t owns its share of the input (a topic’s partitions p % tasks == t, a generator’s events, a listing’s files), so any task count gives the same stream. A source still stamps watermarks, takes barriers and records its position like any other: the checkpoint protocol does not know the difference.

Required Methods§

Source

fn name(&self) -> String

The name the manifest records this source’s positions under (a topic’s name, a path).

Source

fn tasks(&self) -> usize

The task count the source is sized for (STREAM_CONSUMERS overrides it).

Source

fn open(&self, cx: SourceCtx) -> Result<Box<dyn Source + Send>, String>

Open task cx.task of cx.tasks, continuing from cx.start when restoring. Rows leave with their emission key in __fv_key and their origin in __fv_partition. Err when the source cannot be opened (a missing file, an unreachable broker): the build fails before any task runs, naming the source.

Provided Methods§

Source

fn describe(&self) -> String

One line for the stage log: what this source is (defaults to its name).

Source

fn estimated_bytes(&self) -> Option<u64>

Roughly how many bytes the source’s rows take as Arrow, when known up front (a bounded table’s validation scan, a file listing’s sizes) — what a lookup join’s auto-sized distribution decides on. None = unknown (an unbounded source, a generator).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§