pub struct NodeRegistry { /* private fields */ }Expand description
Central registry of all cluster nodes.
Supports fast lookup by ID and filtered queries by role/status/tag.
Implementations§
Source§impl NodeRegistry
impl NodeRegistry
Sourcepub fn register(&mut self, node: NodeInfo)
pub fn register(&mut self, node: NodeInfo)
Register a new node. If a node with the same ID already exists, it is replaced.
Sourcepub fn deregister(&mut self, id: &str) -> Option<NodeInfo>
pub fn deregister(&mut self, id: &str) -> Option<NodeInfo>
Remove a node by ID, returning it if found.
Sourcepub fn by_status(&self, status: NodeStatus) -> Vec<&NodeInfo>
pub fn by_status(&self, status: NodeStatus) -> Vec<&NodeInfo>
All nodes with a given status.
Sourcepub fn available_workers(&self) -> Vec<&NodeInfo>
pub fn available_workers(&self) -> Vec<&NodeInfo>
All available (Healthy or Degraded) worker nodes.
Sourcepub fn remove_node(&mut self, id: &str, now_ms: u64)
pub fn remove_node(&mut self, id: &str, now_ms: u64)
Mark a node as removed (soft delete).
Trait Implementations§
Source§impl Debug for NodeRegistry
impl Debug for NodeRegistry
Source§impl Default for NodeRegistry
impl Default for NodeRegistry
Source§fn default() -> NodeRegistry
fn default() -> NodeRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NodeRegistry
impl RefUnwindSafe for NodeRegistry
impl Send for NodeRegistry
impl Sync for NodeRegistry
impl Unpin for NodeRegistry
impl UnsafeUnpin for NodeRegistry
impl UnwindSafe for NodeRegistry
Blanket Implementations§
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request