pub struct MetadataCache {
pub applied_index: u64,
pub last_applied_hlc: Hlc,
pub leases: HashMap<(DescriptorId, u64), DescriptorLease>,
pub topology_log: Vec<TopologyChange>,
pub routing_log: Vec<RoutingChange>,
pub cluster_version: u16,
pub catalog_entries_applied: u64,
}Expand description
In-memory view of the committed metadata state.
Fields§
§applied_index: u64§last_applied_hlc: Hlc§leases: HashMap<(DescriptorId, u64), DescriptorLease>(descriptor_id, node_id) -> lease.
topology_log: Vec<TopologyChange>Topology mutations applied so far.
routing_log: Vec<RoutingChange>§cluster_version: u16§catalog_entries_applied: u64Monotonically-increasing count of committed CatalogDdl
entries. Exposed for tests and metrics — planners read
catalog state through the host-side SystemCatalog, not
this counter.
Implementations§
Source§impl MetadataCache
impl MetadataCache
pub fn new() -> Self
Sourcepub fn advance_applied_index(&mut self, index: u64)
pub fn advance_applied_index(&mut self, index: u64)
Advance the applied-index watermark past a committed Raft no-op (a
leader-transition entry with no MetadataEntry payload).
A no-op mutates no cache state, but it IS applied, so the cache watermark
must move in lockstep with the Raft applied index the tick loop reports.
Otherwise the startup applied-index sanity check reads cache_applied <
watcher_current and fails the boot with a spurious gap — which is
exactly what happens on a fresh single-node start, where every group’s
first committed entry is an election no-op at index 1. Monotonic: never
regresses the watermark.
Sourcepub fn apply(&mut self, index: u64, entry: &MetadataEntry)
pub fn apply(&mut self, index: u64, entry: &MetadataEntry)
Apply a committed entry. Idempotent by applied_index:
entries at or below the current watermark are ignored.
Trait Implementations§
Source§impl Debug for MetadataCache
impl Debug for MetadataCache
Source§impl Default for MetadataCache
impl Default for MetadataCache
Source§fn default() -> MetadataCache
fn default() -> MetadataCache
Auto Trait Implementations§
impl Freeze for MetadataCache
impl RefUnwindSafe for MetadataCache
impl Send for MetadataCache
impl Sync for MetadataCache
impl Unpin for MetadataCache
impl UnsafeUnpin for MetadataCache
impl UnwindSafe for MetadataCache
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.