#[non_exhaustive]pub struct SourceCtx {
pub task: usize,
pub tasks: usize,
pub start: Option<BTreeMap<i32, i64>>,
pub restoring: bool,
pub watermark_column: Option<String>,
pub pipeline: String,
pub stage: String,
pub build_id: String,
pub dropped: Arc<Atomic<u64>>,
}Expand description
What a source task is built with: its index task of tasks; the positions the checkpoint
recorded for it under the source’s name (start: partition → next
position, None when the run is fresh or the checkpoint has none for this task — restoring
tells the two apart); the event-time column it stamps watermarks from; the run’s identity for a
source that names itself to a broker (a consumer group is pipeline + stage); and the
counter of rows it drops as bad data. Built by the engine only (#[non_exhaustive]: new fields
arrive as new setters, never as a break).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.task: usize§tasks: usize§start: Option<BTreeMap<i32, i64>>§restoring: bool§watermark_column: Option<String>§pipeline: String§stage: String§build_id: String§dropped: Arc<Atomic<u64>>Implementations§
Source§impl SourceCtx
impl SourceCtx
pub fn new(task: usize, tasks: usize) -> SourceCtx
pub fn start(self, start: Option<BTreeMap<i32, i64>>) -> SourceCtx
pub fn restoring(self, restoring: bool) -> SourceCtx
pub fn watermark_column(self, column: Option<String>) -> SourceCtx
pub fn run(self, pipeline: &str, stage: &str, build_id: &str) -> SourceCtx
pub fn dropped(self, dropped: Arc<Atomic<u64>>) -> SourceCtx
Sourcepub fn start_of_task(&self) -> Option<i64>
pub fn start_of_task(&self) -> Option<i64>
This task’s own recorded position, for a source whose partition is its task index (every in-process source; a broker source reads the whole map).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SourceCtx
impl RefUnwindSafe for SourceCtx
impl Send for SourceCtx
impl Sync for SourceCtx
impl Unpin for SourceCtx
impl UnsafeUnpin for SourceCtx
impl UnwindSafe for SourceCtx
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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