Skip to main content

StoreCoordinator

Struct StoreCoordinator 

Source
pub struct StoreCoordinator<S: CoordinationStore + Clone> { /* private fields */ }
Expand description

A SplitCoordinator over any CoordinationStore.

Built with a multi-thread runtime handle (the background task and the store’s I/O live there; a current-thread runtime would deadlock the blocking replies and is rejected at construction).

Implementations§

Source§

impl<S: CoordinationStore + Clone> StoreCoordinator<S>

Source

pub fn new( store: S, config: CoordinationConfig, io: Handle, metrics: Option<CoordinationMetrics>, ) -> Result<StoreCoordinator<S>, CoordinationError>

Wrap a store. io must be a multi-thread runtime handle.

§Errors

Fatal on invalid configuration, a current-thread runtime, or a store whose lease TTL diverges from config.lease_duration.

Source

pub fn instance_id(&self) -> &str

This worker’s (stable or generated) instance id.

Trait Implementations§

Source§

impl<S: CoordinationStore + Clone> Debug for StoreCoordinator<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: CoordinationStore + Clone> Drop for StoreCoordinator<S>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<S: CoordinationStore + Clone> SplitCoordinator for StoreCoordinator<S>

Source§

fn start( &mut self, planner: Box<dyn SplitPlanner>, ) -> Result<(), CoordinationError>

Join the job: verify the fingerprint, hand over this worker’s planner (used only if and while this instance is elected leader), and start the backend’s claim and renewal machinery. Called exactly once, before any other method.
Source§

fn set_waker(&mut self, waker: ControlWaker)

Hand the backend the handle it signals when it has events to deliver. Called once, before start. Read more
Source§

fn poll(&mut self) -> Result<Vec<CoordinationEvent>, CoordinationError>

Ownership and job-state changes since the last call. Must not block — return whatever is pending, including nothing. The driver parks on the ControlWaker instead.
Source§

fn commit( &mut self, split: &SplitId, progress: &SplitProgress, ) -> Result<(), CoordinationError>

Fenced durable commit of one owned split’s progress. Ok means durable. Fenced means the split is no longer owned and nothing was written — stop the split, never retry the write. Retryable leaves the previous committed state authoritative; re-committing the merged progress on the next tick is idempotent. Read more
Source§

fn fail( &mut self, split: &SplitId, reason: &str, ) -> Result<(), CoordinationError>

Report an owned split as unprocessable by this tenancy: consumes one delivery attempt and releases it for another worker to retry. At the backend’s attempt cap the split is quarantined instead (CoordinationEvent::Quarantined). Use for poison input; a transient local problem is better handled by release, which consumes nothing.
Source§

fn release(&mut self, splits: &[SplitId]) -> Result<(), CoordinationError>

Voluntarily hand back owned splits (shutdown, scale-down) so peers claim them without waiting out a lease. Consumes no delivery attempts. Best-effort and idempotent; splits not released simply expire.
Source§

fn release_drained( &mut self, splits: &[SplitId], ) -> Result<(), CoordinationError>

Release splits given up through a cooperative revocation — the owner has drained each split, committed its tail, and is now handing it back. Semantically a release (attempt-free, best-effort, idempotent), but distinguished so a revocation-aware backend can record the drain as having completed and never mistake a single-split revocation for a departure from the fleet. Read more
Source§

fn decline_revoke(&mut self, split: &SplitId) -> Result<(), CoordinationError>

Decline a RevokeRequested the embedder cannot serve — the source refused to stop the split’s intake, or the split is not in a drainable state. Read more

Auto Trait Implementations§

§

impl<S> !RefUnwindSafe for StoreCoordinator<S>

§

impl<S> !Sync for StoreCoordinator<S>

§

impl<S> !UnwindSafe for StoreCoordinator<S>

§

impl<S> Freeze for StoreCoordinator<S>
where S: Freeze,

§

impl<S> Send for StoreCoordinator<S>

§

impl<S> Unpin for StoreCoordinator<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for StoreCoordinator<S>
where S: UnsafeUnpin,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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