pub enum StateBackendConfig {
InProcess {
vnode_capacity: u32,
},
Local {
path: PathBuf,
instance_id: String,
vnode_capacity: u32,
},
ObjectStore {
url: String,
instance_id: String,
vnode_capacity: u32,
vnodes: Option<Vec<u32>>,
merger_instance: Option<String>,
discovery: DiscoveryMode,
seed_peers: Vec<String>,
},
}Expand description
Tagged-union config that selects the runtime StateBackend.
See module docs for the five deployment shapes.
Variants§
InProcess
Non-durable in-process backend. The default.
Local
Durable single-node backend on a local filesystem path. Shorthand
for an object_store backend with a file:// URL.
Fields
ObjectStore
Durable shared-state backend on S3 / GCS / Azure. Used by all distributed-embedded and constellation modes.
Fields
instance_id: StringThis node’s identity. Written into epoch manifests and used by the assignment-version fence to reject stale writes.
vnodes: Option<Vec<u32>>Static vnode subset for this instance. None means “all
vnodes” (useful for the merger instance or for dynamic mode).
merger_instance: Option<String>Optional merger instance — the node that fans in partials for sink emission. Only meaningful in static mode.
discovery: DiscoveryModeDiscovery strategy: static assignment or chitchat gossip.
Implementations§
Source§impl StateBackendConfig
impl StateBackendConfig
Sourcepub fn in_process() -> Self
pub fn in_process() -> Self
Builder: embedded library, single process.
Sourcepub fn local(path: impl Into<PathBuf>) -> Self
pub fn local(path: impl Into<PathBuf>) -> Self
Builder: single-node durable state on the local filesystem.
Sourcepub fn object_store(
url: impl Into<String>,
instance_id: impl Into<String>,
) -> Self
pub fn object_store( url: impl Into<String>, instance_id: impl Into<String>, ) -> Self
Builder: distributed-embedded over an object store, static mode.
Sourcepub async fn build(
&self,
) -> Result<Arc<dyn StateBackend>, StateBackendBuildError>
pub async fn build( &self, ) -> Result<Arc<dyn StateBackend>, StateBackendBuildError>
Instantiate the runtime backend.
Declared async because backends added in later iterations
(object store, distributed) need to perform async setup. The
in-process path completes synchronously today; callers must
still .await for forward-compatibility.
§Errors
StateBackendBuildError::NotImplementedfor remoteobject_storeschemes not yet wired (s3://,gs://,az://).StateBackendBuildError::Ioon filesystem/network setup.
Sourcepub fn local_storage_dir(&self) -> Option<&Path>
pub fn local_storage_dir(&self) -> Option<&Path>
Filesystem path for durable state, if any. Returns None for
non-filesystem backends.
Sourcepub fn build_object_store(
&self,
) -> Result<Option<Arc<dyn ObjectStore>>, StateBackendBuildError>
pub fn build_object_store( &self, ) -> Result<Option<Arc<dyn ObjectStore>>, StateBackendBuildError>
Build the underlying object_store handle (if any) so callers
that need to share the same store — e.g. an
AssignmentSnapshotStore alongside the state backend — can
avoid re-parsing the URL. None for InProcess.
§Errors
Same failure modes as Self::build.
Sourcepub fn is_durable(&self) -> bool
pub fn is_durable(&self) -> bool
Returns true if this backend persists state across process restarts.
Sourcepub fn vnode_capacity(&self) -> u32
pub fn vnode_capacity(&self) -> u32
Number of vnodes this backend is sized for.
Trait Implementations§
Source§impl Clone for StateBackendConfig
impl Clone for StateBackendConfig
Source§fn clone(&self) -> StateBackendConfig
fn clone(&self) -> StateBackendConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StateBackendConfig
impl Debug for StateBackendConfig
Source§impl Default for StateBackendConfig
impl Default for StateBackendConfig
Source§impl<'de> Deserialize<'de> for StateBackendConfig
impl<'de> Deserialize<'de> for StateBackendConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for StateBackendConfig
impl PartialEq for StateBackendConfig
impl Eq for StateBackendConfig
impl StructuralPartialEq for StateBackendConfig
Auto Trait Implementations§
impl Freeze for StateBackendConfig
impl RefUnwindSafe for StateBackendConfig
impl Send for StateBackendConfig
impl Sync for StateBackendConfig
impl Unpin for StateBackendConfig
impl UnsafeUnpin for StateBackendConfig
impl UnwindSafe for StateBackendConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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