pub struct AssignmentSnapshotStore { /* private fields */ }Expand description
I/O wrapper for AssignmentSnapshot on an object store.
Implementations§
Source§impl AssignmentSnapshotStore
impl AssignmentSnapshotStore
Sourcepub async fn stage_recovery_proposal(
&self,
proposal: &AssignmentSnapshot,
) -> Result<AssignmentSnapshotRef, SnapshotError>
pub async fn stage_recovery_proposal( &self, proposal: &AssignmentSnapshot, ) -> Result<AssignmentSnapshotRef, SnapshotError>
Stage one committed successor under its canonical content address.
Identical retries converge on the same immutable object. This does not change the durable assignment head; callers publish the returned reference through their fencing authority before materialization.
§Errors
Rejects an invalid/non-committed successor or a write that cannot be reconciled exactly.
Sourcepub async fn load_recovery_proposal(
&self,
reference: &AssignmentSnapshotRef,
) -> Result<AssignmentSnapshot, SnapshotError>
pub async fn load_recovery_proposal( &self, reference: &AssignmentSnapshotRef, ) -> Result<AssignmentSnapshot, SnapshotError>
Load and verify one exact immutable recovery proposal.
§Errors
Rejects a missing, malformed, non-canonical, or reference-mismatched object.
Sourcepub async fn load(&self) -> Result<Option<AssignmentSnapshot>, SnapshotError>
pub async fn load(&self) -> Result<Option<AssignmentSnapshot>, SnapshotError>
Load the current (highest-versioned) snapshot; Ok(None) on
fresh cluster.
§Errors
Object-store I/O or JSON decode failure.
Sourcepub async fn load_version(
&self,
version: u64,
) -> Result<Option<AssignmentSnapshot>, SnapshotError>
pub async fn load_version( &self, version: u64, ) -> Result<Option<AssignmentSnapshot>, SnapshotError>
Load a specific version’s snapshot. Ok(None) if that version
was never written or has been pruned.
§Errors
Object-store I/O or JSON decode failure.
Sourcepub async fn load_drain_transition(
&self,
version: u64,
) -> Result<Option<AssignmentDrainTransition>, SnapshotError>
pub async fn load_drain_transition( &self, version: u64, ) -> Result<Option<AssignmentDrainTransition>, SnapshotError>
Load the immutable drain transition underlying a materialized assignment version.
A terminal load_version result intentionally contains only the installed assignment.
Cluster readers use this accessor to bind that materialized result back to the shared
authority decision before adoption. Ordinary assignment versions return None.
§Errors
Object-store I/O, JSON decode failure, or a malformed base snapshot.
Sourcepub async fn save_if_absent(
&self,
snapshot: &AssignmentSnapshot,
) -> Result<Option<AssignmentSnapshot>, SnapshotError>
pub async fn save_if_absent( &self, snapshot: &AssignmentSnapshot, ) -> Result<Option<AssignmentSnapshot>, SnapshotError>
CAS-create the version-one seed. Ok(None) means another initial writer won.
§Errors
Object-store I/O or JSON encode failure.
Sourcepub async fn save_if_version(
&self,
snapshot: &AssignmentSnapshot,
prior_version: u64,
) -> Result<RotateOutcome, SnapshotError>
pub async fn save_if_version( &self, snapshot: &AssignmentSnapshot, prior_version: u64, ) -> Result<RotateOutcome, SnapshotError>
Rotate to snapshot assuming the current durable version is
prior_version. Returns RotateOutcome::Conflict carrying
the winner’s snapshot if a racer produced prior_version + 1
first.
§Errors
Object-store I/O, JSON encode, or a non-monotonic version bump (caller bug).
Sourcepub async fn finalize_drain(
&self,
draining: &AssignmentSnapshot,
proposal: &AssignmentSnapshot,
) -> Result<RotateOutcome, SnapshotError>
pub async fn finalize_drain( &self, draining: &AssignmentSnapshot, proposal: &AssignmentSnapshot, ) -> Result<RotateOutcome, SnapshotError>
Append exactly one immutable winner for a draining object: its target or a rollback.
The object version is intentionally unchanged: source receipts certify the target
assignment version, so committing the map under another version would discard the very
identity they proved. PutMode::Create makes commit versus abort a store-level race with
one winner on local and cloud backends; the original transition remains auditable.
Cluster callers must first serialize the verdict through LeaderLeaseStore; this method
only materializes that already-authoritative verdict.
§Errors
Rejects a stale/non-draining expected value, an unrelated proposal, or a non-head object.
Sourcepub async fn prune_before(&self, before: u64) -> Result<(), SnapshotError>
pub async fn prune_before(&self, before: u64) -> Result<(), SnapshotError>
Delete every snapshot object with version < before.
Idempotent — missing objects are tolerated.
§Errors
Object-store I/O.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AssignmentSnapshotStore
impl !RefUnwindSafe for AssignmentSnapshotStore
impl !UnwindSafe for AssignmentSnapshotStore
impl Send for AssignmentSnapshotStore
impl Sync for AssignmentSnapshotStore
impl Unpin for AssignmentSnapshotStore
impl UnsafeUnpin for AssignmentSnapshotStore
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].