pub struct ObjectStoreBackend { /* private fields */ }Expand description
Object-store-backed StateBackend.
Implementations§
Source§impl ObjectStoreBackend
impl ObjectStoreBackend
Sourcepub fn new(
store: Arc<dyn ObjectStore>,
instance_id: impl Into<String>,
vnode_capacity: u32,
) -> Self
pub fn new( store: Arc<dyn ObjectStore>, instance_id: impl Into<String>, vnode_capacity: u32, ) -> Self
Wrap an existing [ObjectStore] without certifying persistence.
The opaque trait object does not reveal whether it is an in-memory,
node-local, or shared implementation, so this conservative constructor
reports StateBackendDurability::Volatile. Production hosts should use
Self::node_durable or Self::cluster_shared after establishing the
storage topology.
Sourcepub fn node_durable(
store: Arc<dyn ObjectStore>,
instance_id: impl Into<String>,
vnode_capacity: u32,
) -> Self
pub fn node_durable( store: Arc<dyn ObjectStore>, instance_id: impl Into<String>, vnode_capacity: u32, ) -> Self
Wrap storage that survives restart on this node but is not guaranteed to be reachable by cluster peers.
Wrap durable storage whose namespace is reachable by every cluster node.
Shared handle to the authoritative version counter, cloneable by a single owner that drives it without relaying through the trait method.
Trait Implementations§
Source§impl Debug for ObjectStoreBackend
impl Debug for ObjectStoreBackend
Source§impl StateBackend for ObjectStoreBackend
impl StateBackend for ObjectStoreBackend
Source§fn key_group_capacity(&self) -> u32
fn key_group_capacity(&self) -> u32
Number of stable key groups this backend can address. Read more
Source§fn bind_state_namespace<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
deployment_id: &'life1 str,
pipeline_identity: &'life2 PipelineIdentity,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn bind_state_namespace<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
deployment_id: &'life1 str,
pipeline_identity: &'life2 PipelineIdentity,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Bind this storage root to one deployment and logical pipeline before recovery or writes. Read more
Source§fn durability_scope(&self) -> StateBackendDurability
fn durability_scope(&self) -> StateBackendDurability
Failure scope survived by this backend. Read more
Source§fn uses_exact_object_store(&self, expected: &Arc<dyn ObjectStore>) -> bool
fn uses_exact_object_store(&self, expected: &Arc<dyn ObjectStore>) -> bool
Whether this backend uses the exact object-store handle admitted by cluster startup. Read more
Source§fn write_partial<'life0, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
vnode: u32,
assignment_version: u64,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write_partial<'life0, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
vnode: u32,
assignment_version: u64,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist a partial aggregate for
(vnode, epoch). Read moreSource§fn write_certified_partial<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
vnode: u32,
assignment_fence: &'life1 CheckpointAssignmentFence,
writer_node_id: u64,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_certified_partial<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
vnode: u32,
assignment_fence: &'life1 CheckpointAssignmentFence,
writer_node_id: u64,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist a cluster partial certified by the exact active assignment and writer process. Read more
Source§fn read_partial<'life0, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
vnode: u32,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_partial<'life0, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
vnode: u32,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read the partial aggregate for
(attempt, vnode), if any.Source§fn write_commit_descriptor<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
key: &'life1 str,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_commit_descriptor<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
key: &'life1 str,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn write_certified_commit_descriptor<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
key: &'life1 str,
assignment_fence: &'life2 CheckpointAssignmentFence,
writer_node_id: u64,
leader_proof: &'life3 LeaderProof,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn write_certified_commit_descriptor<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
key: &'life1 str,
assignment_fence: &'life2 CheckpointAssignmentFence,
writer_node_id: u64,
leader_proof: &'life3 LeaderProof,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Persist a cluster descriptor certified by the exact assignment, writer process, and
checkpoint-initiating leader term. Read more
Source§fn read_commit_descriptor<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_commit_descriptor<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read one exact coordinated-commit descriptor, if it exists. Read more
Source§fn read_commit_descriptor_bounded<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
key: &'life1 str,
max_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_commit_descriptor_bounded<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
key: &'life1 str,
max_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read one descriptor while enforcing a private control-plane allocation bound. Read more
Source§fn read_sealed_commit_descriptor_bounded<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
sealed: &'life1 SealedCommitDescriptor,
max_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_sealed_commit_descriptor_bounded<'life0, 'life1, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
sealed: &'life1 SealedCommitDescriptor,
max_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a descriptor admitted by an exact checkpoint seal. Read more
Source§fn seal_checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
assignment_fence: Option<&'life1 CheckpointAssignmentFence>,
vnodes: &'life2 [u32],
required_descriptors: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<bool, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn seal_checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
assignment_fence: Option<&'life1 CheckpointAssignmentFence>,
vnodes: &'life2 [u32],
required_descriptors: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<bool, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Durability barrier: true once every
vnode partial and every
required_descriptors key for attempt is persisted, sealing that exact attempt.
Sinks do not commit until it returns Ok(true). In cluster mode,
required_descriptors also binds every participant’s final readiness attestation,
including participants with no vnodes or coordinated sinks.Source§fn checkpoint_seal_inventory<'life0, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointSealInventory>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn checkpoint_seal_inventory<'life0, 'async_trait>(
&'life0 self,
attempt: CheckpointAttempt,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointSealInventory>, StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read the canonical artifact inventory for an exact sealed attempt.
Returns
None when that attempt has no live seal or is below the durable prune floor.Source§fn verify_checkpoint_artifact_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
inventory: &'life1 CheckpointSealInventory,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn verify_checkpoint_artifact_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
inventory: &'life1 CheckpointSealInventory,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Prove from storage metadata that every artifact named by an exact seal still exists with
its sealed length, without reading artifact payloads. Read more
Source§fn prune_before<'life0, 'async_trait>(
&'life0 self,
before: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prune_before<'life0, 'async_trait>(
&'life0 self,
before: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StateBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Garbage-collect every partial and state seal whose epoch is
strictly less than
before. Called by the checkpoint
coordinator after a successful checkpoint commit so the backend
does not retain state for epochs that can never be recovered. Read moreRaise the backend’s authoritative assignment version — the
exact
VnodeRegistry::assignment_version it will accept on
partial and descriptor writes. Hosts call this on boot
after adopting an AssignmentSnapshot and on each subsequent
rotation so stale writers from a deposed leader are fenced out. Read moreCurrent authoritative assignment version.
0 means the fence is
disabled — every caller version is accepted. Backends that do
not fence return 0 unconditionally.Auto Trait Implementations§
impl !Freeze for ObjectStoreBackend
impl !RefUnwindSafe for ObjectStoreBackend
impl !UnwindSafe for ObjectStoreBackend
impl Send for ObjectStoreBackend
impl Sync for ObjectStoreBackend
impl Unpin for ObjectStoreBackend
impl UnsafeUnpin for ObjectStoreBackend
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.