pub struct S3Source { /* private fields */ }Expand description
Coordinated object-storage backfill source. See the crate docs for the delivery model and the split identity/drift contract.
Implementations§
Source§impl S3Source
impl S3Source
Sourcepub fn new(config: S3SourceConfig, io: Handle) -> S3Source
pub fn new(config: S3SourceConfig, io: Handle) -> S3Source
A source over config, doing its network I/O on io — pass the
pipeline’s I/O runtime handle
(Pipeline::io_handle).
The handle must belong to a multi-thread runtime that outlives the pipeline (the pipeline’s I/O runtime satisfies both): the source, its lanes, and the coordinator briefly block pipeline threads on it, which a current-thread runtime cannot drive.
Sourcepub fn from_component_config(
section: &ComponentConfig,
io: Handle,
) -> Result<S3Source, ConfigError>
pub fn from_component_config( section: &ComponentConfig, io: Handle, ) -> Result<S3Source, ConfigError>
Build from the pipeline’s opaque source: { s3: ... } section.
Sourcepub fn with_framer<F>(self, factory: F) -> S3Source
pub fn with_framer<F>(self, factory: F) -> S3Source
Set the record framer that cuts each object’s byte stream into records.
spate-s3 is a transport and owns no framing, so this is required:
supply the framer for the objects’ format — e.g. spate-json’s
NdjsonFramer for NDJSON — before the pipeline opens the source.
factory builds a fresh
RecordFramer per object (framers are
per-object stateful and each lane frames its own split). A framed source
always emits one record per payload, so its
FramingContract is PerRecord and the
paired deserializer decodes a single unit.
Sourcepub fn with_coordinator(
self,
coordinator: Box<dyn SplitCoordinator>,
) -> S3Source
pub fn with_coordinator( self, coordinator: Box<dyn SplitCoordinator>, ) -> S3Source
Hand the source its coordinator — the multi-instance seam.
Build any SplitCoordinator at assembly time (e.g.
StoreCoordinator over the NATS store from spate-coordination,
with your own tuning) and inject it here; run more replicas of the
same pipeline against the same backend and they share the
backfill. Must be called before the pipeline opens the source.
Without it the source runs solo over an in-process store: correct and self-terminating, but progress is ephemeral — a restart replays the whole prefix (a startup WARN says so).
Trait Implementations§
Source§impl Source for S3Source
impl Source for S3Source
Source§fn component_type(&self) -> &str
fn component_type(&self) -> &str
component_type metric label for this source (e.g. "kafka"),
mirroring SinkParts::with_component_type
on the sink side. It is also the namespace of the source’s custom-metrics
Meter: declaring "kafka" scopes the source’s own
families under spate_kafka_source_*. The default "source" is a reserved
root, so a source that does not override this gets no custom Meter
(its framework stage metrics are unaffected).Source§fn framing_contract(&self) -> FramingContract
fn framing_contract(&self) -> FramingContract
FramingContract). A source that splits its own bytes into one
record per payload returns FramingContract::PerRecord; the default
is FramingContract::WholePayload — the source emits whole payloads
and the deserializer owns framing (Kafka, and any source that does not
frame).Source§fn open(&mut self, ctx: SourceCtx) -> Result<(), SourceError>
fn open(&mut self, ctx: SourceCtx) -> Result<(), SourceError>
Source§fn poll_events(
&mut self,
timeout: Duration,
) -> Result<SourceEvent<S3Lane>, SourceError>
fn poll_events( &mut self, timeout: Duration, ) -> Result<SourceEvent<S3Lane>, SourceError>
timeout. Must be called
regularly regardless of backpressure state.Source§fn commit(
&mut self,
watermarks: &[(PartitionId, i64)],
) -> Result<(), SourceError>
fn commit( &mut self, watermarks: &[(PartitionId, i64)], ) -> Result<(), SourceError>
Source§fn pause(&mut self, lanes: &[LaneId]) -> Result<(), SourceError>
fn pause(&mut self, lanes: &[LaneId]) -> Result<(), SourceError>
lanes (backpressure). Optional capability:
sources that cannot pause rely on bounded-queue pushback alone.Source§fn flush_commits(&mut self) -> Result<(), SourceError>
fn flush_commits(&mut self) -> Result<(), SourceError>
Auto Trait Implementations§
impl !RefUnwindSafe for S3Source
impl !Sync for S3Source
impl !UnwindSafe for S3Source
impl Freeze for S3Source
impl Send for S3Source
impl Unpin for S3Source
impl UnsafeUnpin for S3Source
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more