pub struct ClusterCatalog { /* private fields */ }Expand description
Persistent cluster catalog backed by redb.
Implementations§
Source§impl ClusterCatalog
impl ClusterCatalog
Sourcepub fn save_cluster_settings(&self, settings: &ClusterSettings) -> Result<()>
pub fn save_cluster_settings(&self, settings: &ClusterSettings) -> Result<()>
Persist the cluster settings blob. Called once at bootstrap.
Sourcepub fn load_cluster_settings(&self) -> Result<Option<ClusterSettings>>
pub fn load_cluster_settings(&self) -> Result<Option<ClusterSettings>>
Load the cluster settings. Returns None if not yet bootstrapped.
Source§impl ClusterCatalog
impl ClusterCatalog
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Open or create the cluster catalog at the given path.
Delegates to [super::migration::migrate_if_needed] after
the redb tables are in place. Fresh catalogs get stamped
with the current format version; catalogs stamped with a
higher version than this binary supports are refused with
a clear error (preventing silent corruption on an
accidental downgrade). Future schema changes land as
explicit migration arms in migration.rs.
Sourcepub fn save_cluster_id(&self, cluster_id: u64) -> Result<()>
pub fn save_cluster_id(&self, cluster_id: u64) -> Result<()>
Store the cluster ID (generated at bootstrap, immutable).
Sourcepub fn load_cluster_id(&self) -> Result<Option<u64>>
pub fn load_cluster_id(&self) -> Result<Option<u64>>
Load the cluster ID. Returns None if not yet bootstrapped.
Sourcepub fn is_bootstrapped(&self) -> Result<bool>
pub fn is_bootstrapped(&self) -> Result<bool>
Check if this catalog has been bootstrapped (has a cluster_id).
Sourcepub fn save_cluster_epoch(&self, epoch: u64) -> Result<()>
pub fn save_cluster_epoch(&self, epoch: u64) -> Result<()>
Persist the cluster epoch (the leader-bumped monotonic fence token stamped on every Raft RPC). Overwrites any prior value.
Sourcepub fn load_cluster_epoch(&self) -> Result<Option<u64>>
pub fn load_cluster_epoch(&self) -> Result<Option<u64>>
Load the persisted cluster epoch. Returns None on a catalog
that has never written one (callers treat that as 0).
Sourcepub fn save_ca_cert(&self, ca_cert_der: &[u8]) -> Result<()>
pub fn save_ca_cert(&self, ca_cert_der: &[u8]) -> Result<()>
Store the cluster CA certificate (DER-encoded).
Source§impl ClusterCatalog
impl ClusterCatalog
Sourcepub fn save_ghosts(
&self,
vshard_id: u32,
ghost_table: &GhostTable,
) -> Result<()>
pub fn save_ghosts( &self, vshard_id: u32, ghost_table: &GhostTable, ) -> Result<()>
Persist ghost stubs for a vShard.
Called after each sweep or after ghost table mutations to ensure refcounts survive crash/restart.
Sourcepub fn load_ghosts(&self, vshard_id: u32) -> Result<Option<GhostTable>>
pub fn load_ghosts(&self, vshard_id: u32) -> Result<Option<GhostTable>>
Load ghost stubs for a vShard. Returns None if no ghosts persisted.
Sourcepub fn load_all_ghosts(&self) -> Result<Vec<(u32, GhostTable)>>
pub fn load_all_ghosts(&self) -> Result<Vec<(u32, GhostTable)>>
Load all persisted ghost tables across all vShards.
Returns (vshard_id, GhostTable) pairs for all vShards that have ghosts.
Sourcepub fn delete_ghosts(&self, vshard_id: u32) -> Result<()>
pub fn delete_ghosts(&self, vshard_id: u32) -> Result<()>
Delete persisted ghosts for a vShard (after all ghosts purged).
Source§impl ClusterCatalog
impl ClusterCatalog
Sourcepub fn save_topology(&self, topology: &ClusterTopology) -> Result<()>
pub fn save_topology(&self, topology: &ClusterTopology) -> Result<()>
Persist the cluster topology.
Sourcepub fn load_topology(&self) -> Result<Option<ClusterTopology>>
pub fn load_topology(&self) -> Result<Option<ClusterTopology>>
Load the cluster topology. Returns None if no topology has been saved.
Sourcepub fn save_routing(&self, routing: &RoutingTable) -> Result<()>
pub fn save_routing(&self, routing: &RoutingTable) -> Result<()>
Persist the routing table.
Sourcepub fn load_routing(&self) -> Result<Option<RoutingTable>>
pub fn load_routing(&self) -> Result<Option<RoutingTable>>
Load the routing table. Returns None if no routing table has been saved.
Auto Trait Implementations§
impl Freeze for ClusterCatalog
impl !RefUnwindSafe for ClusterCatalog
impl Send for ClusterCatalog
impl Sync for ClusterCatalog
impl Unpin for ClusterCatalog
impl UnsafeUnpin for ClusterCatalog
impl !UnwindSafe for ClusterCatalog
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.