Skip to main content

StreamConfig

Struct StreamConfig 

Source
pub struct StreamConfig<'a> {
    pub base_snapshot_key: &'a str,
    pub page_size: usize,
    pub backpressure: BackpressureConfig,
    pub rpo_target: Option<Duration>,
    pub epoch: u64,
    pub owner: Option<&'a str>,
    pub pointer_generation: u64,
}
Expand description

Configuration for a streaming session.

Fields§

§base_snapshot_key: &'a str

Object-store key of the base tier-1a snapshot the frames replay onto. Recorded in every generation manifest; restore re-fetches it.

§page_size: usize

Page size of the base snapshot — read it from the snapshot header (offset 16, u16 big-endian; the on-disk value 1 means 65 536). Required because the seam does not return it and sync_server.rs’s 4 KB hardcode is the wrong default to inherit.

§backpressure: BackpressureConfig

R574-F2: bounded spill buffer + overflow policy + 429/503 backoff for the R2 upload side of the drain loop. Default is behavior-preserving (BackpressurePolicy::Fail — errors bubble immediately, same as before this field existed).

§rpo_target: Option<Duration>

R574-T4: the stated RPO bound — the caller’s own scheduler is expected to invoke tail_frames often enough that the watermark never goes stale past this. None (the default) means no target is asserted; RpoStatus::breached is always false in that case, but RpoStatus::watermark_age is still reported so a caller can observe the real gap before picking a number.

R761-T1: DEFAULT_RPO_TARGET (120 s, tailed at DEFAULT_TAIL_INTERVAL = 60 s) is the number to put here absent a reason to pick another — its doc carries the measured write-op table that justifies it. None stays the default so that a caller who has not thought about RPO never gets a breach flag it did not ask for.

§epoch: u64

R732-F2 (W245): this writer’s fencing token — the per-tenant epoch handed out by yubaba’s raft state machine (YubabaState::tenant_fencing_token). It is stamped into every frame key, every generation manifest, and the watermark sidecar, and it is checked before a single frame is uploaded: a writer whose epoch is lower than the one already recorded at the sink is a stale owner and bounces with StreamOutcome::Fenced rather than interleaving its frames with the real owner’s.

0 means unfenced, and is the behaviour-preserving default for a single-writer deployment that has no ownership authority to ask. Note that unfenced is not exempt: a 0 writer is still fenced by any sink already stamped with a real epoch, which is exactly what should happen when a tenant has been claimed and a legacy streamer is still running.

§owner: Option<&'a str>

R732-F2: opaque label for who holds epoch — a yubaba node id, a hostname, whatever the caller finds useful. Recorded in the manifest and never interpreted here. Purely diagnostic: when you are staring at a fenced stream at 3am, “which owner wrote generation 7” is the first question, and the epoch alone does not answer it.

§pointer_generation: u64

R736-T2 (W250): the cross-cell fence — this writer’s belief about the global tenant→cell pointer’s generation (yah_tenant_pointer::PointerRecord::generation). epoch alone fences within one raft group; it says nothing when ownership moves to a different cell, because the two cells run independent raft groups that share no epoch counter. Checked alongside epoch before any frame is uploaded: a writer whose generation is lower than the one already recorded at the sink is a stale cell and bounces with StreamOutcome::Fenced, exactly like a stale epoch.

0 means unfenced — the same behaviour-preserving default as epoch, for a single-cell deployment that has no global pointer to ask. This mirrors yah_tenant_pointer’s FIRST_GENERATION = 1: 0 is what an unfenced writer defaults to and must never be mistakable for a live cross-cell owner. The caller (yubaba’s control plane) resolves the pointer and hands the generation in as a plain u64 — this crate does not link yah_tenant_pointer to read it itself.

Auto Trait Implementations§

§

impl<'a> Freeze for StreamConfig<'a>

§

impl<'a> RefUnwindSafe for StreamConfig<'a>

§

impl<'a> Send for StreamConfig<'a>

§

impl<'a> Sync for StreamConfig<'a>

§

impl<'a> Unpin for StreamConfig<'a>

§

impl<'a> UnsafeUnpin for StreamConfig<'a>

§

impl<'a> UnwindSafe for StreamConfig<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Fruit for T
where T: Send + Downcast,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more