pub struct MemorySource { /* private fields */ }Expand description
In-memory Source driven entirely by its SourceHandle.
Trait Implementations§
Source§impl Debug for MemorySource
impl Debug for MemorySource
Source§impl Source for MemorySource
impl Source for MemorySource
Source§fn component_type(&self) -> &str
fn component_type(&self) -> &str
Scopes the source’s own metric families under spate_memory_source_*.
Source§type Lane = MemoryLane
type Lane = MemoryLane
The lane type this source produces.
Source§fn open(&mut self, ctx: SourceCtx) -> Result<(), SourceError>
fn open(&mut self, ctx: SourceCtx) -> Result<(), SourceError>
Connect and prepare. Called once before any other method.
Source§fn poll_events(
&mut self,
timeout: Duration,
) -> Result<SourceEvent<MemoryLane>, SourceError>
fn poll_events( &mut self, timeout: Duration, ) -> Result<SourceEvent<MemoryLane>, SourceError>
Service control-plane work (rebalance callbacks, statistics) and
return the next event, waiting at most
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>
Store per-partition committable positions (each is the offset one
past the last acknowledged record). Positions are durable per the
source’s own policy (e.g. interval auto-commit of stored offsets). Read more
Source§fn flush_commits(&mut self) -> Result<(), SourceError>
fn flush_commits(&mut self) -> Result<(), SourceError>
Synchronously flush stored positions (shutdown, revocation).
Source§fn pause(&mut self, lanes: &[LaneId]) -> Result<(), SourceError>
fn pause(&mut self, lanes: &[LaneId]) -> Result<(), SourceError>
Stop fetching for
lanes (backpressure). Optional capability:
sources that cannot pause rely on bounded-queue pushback alone.Source§fn framing_contract(&self) -> FramingContract
fn framing_contract(&self) -> FramingContract
How the payloads this source emits are framed, so the framework can
pair it with a deserializer without the two being coordinated by hand
(see
FramingContract). A source that splits its own bytes into one
record per payload returns FramingContract::PerRecord; the default
is FramingContract::WholePayload, where the source emits whole
payloads and the deserializer owns framing (Kafka, and any source that
does not frame).Source§fn configure_feed(
&mut self,
section: &FeedSection,
feed: Arc<dyn Feed>,
origin: FeedOrigin,
) -> Result<(), ConfigError>
fn configure_feed( &mut self, section: &FeedSection, feed: Arc<dyn Feed>, origin: FeedOrigin, ) -> Result<(), ConfigError>
Source§fn renew_held(&mut self)
fn renew_held(&mut self)
Renew the feed units the source holds, and nothing else. Read more
Source§fn reading_on_stop(&mut self) -> bool
fn reading_on_stop(&mut self) -> bool
Whether the source is still reading units it holds after a graceful
stop began. The controller asks on each pass between the stop and the
drain, and begins the drain on the first
false or at
STOP_RESERVE before the deadline. Never
waits. The default returns false, so the drain begins at once.Source§fn stop_reading(&mut self) -> Result<(), SourceError>
fn stop_reading(&mut self) -> Result<(), SourceError>
End the stop’s reading: hand back every unit not read to its end.
Called once, after the last
reading_on_stop
on a graceful stop, or at once when the run fails, and before the
pipeline threads drain. Never waits. The default does nothing. Read moreAuto Trait Implementations§
impl Freeze for MemorySource
impl RefUnwindSafe for MemorySource
impl Send for MemorySource
impl Sync for MemorySource
impl Unpin for MemorySource
impl UnsafeUnpin for MemorySource
impl UnwindSafe for MemorySource
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
Mutably borrows from an owned value. Read more