pub struct GhostTable { /* private fields */ }Expand description
Ghost table for a single vShard.
Tracks ghost stubs left behind after node migration. The anti-entropy sweeper runs periodically to purge stale ghosts.
Implementations§
Source§impl GhostTable
impl GhostTable
pub fn new() -> Self
Sourcepub fn decrement_ref(&mut self, node_id: &str) -> bool
pub fn decrement_ref(&mut self, node_id: &str) -> bool
Decrement refcount for a ghost (when a local edge is deleted). Returns true if the ghost was purged (refcount reached zero).
Sourcepub fn increment_ref(&mut self, node_id: &str)
pub fn increment_ref(&mut self, node_id: &str)
Increment refcount for a ghost (when a local edge to a ghost node is added).
Sourcepub fn sweep<F>(&mut self, verify_fn: F) -> SweepReport
pub fn sweep<F>(&mut self, verify_fn: F) -> SweepReport
Run anti-entropy sweep.
For each ghost stub, the caller must verify against the target shard:
- Does the target shard acknowledge the node exists?
- Do any local edges still reference this ghost?
verify_fn takes (node_id, target_shard) and returns SweepVerdict.
The sweeper runs at lowest I/O priority and is rate-limited.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn total_purged(&self) -> u64
pub fn last_sweep_ms(&self) -> u64
Source§impl GhostTable
impl GhostTable
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialize all ghost stubs for persistence.
Returns MessagePack bytes that can be stored in the cluster catalog.
Sourcepub fn from_bytes(data: &[u8]) -> Option<Self>
pub fn from_bytes(data: &[u8]) -> Option<Self>
Restore ghost stubs from persisted bytes.
Called on startup to recover ghost state from the cluster catalog.
Trait Implementations§
Source§impl Clone for GhostTable
impl Clone for GhostTable
Source§fn clone(&self) -> GhostTable
fn clone(&self) -> GhostTable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GhostTable
impl Debug for GhostTable
Auto Trait Implementations§
impl Freeze for GhostTable
impl RefUnwindSafe for GhostTable
impl Send for GhostTable
impl Sync for GhostTable
impl Unpin for GhostTable
impl UnsafeUnpin for GhostTable
impl UnwindSafe for GhostTable
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<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,
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.