pub struct NodeManager { /* private fields */ }Expand description
Manager for compute nodes in the distributed system
Implementations§
Source§impl NodeManager
impl NodeManager
Sourcepub fn start_health_monitoring(&self) -> IntegrateResult<()>
pub fn start_health_monitoring(&self) -> IntegrateResult<()>
Start the health monitoring background thread
Sourcepub fn stop_health_monitoring(&self)
pub fn stop_health_monitoring(&self)
Stop health monitoring
Sourcepub fn register_node(
&self,
address: SocketAddr,
capabilities: NodeCapabilities,
) -> DistributedResult<NodeId>
pub fn register_node( &self, address: SocketAddr, capabilities: NodeCapabilities, ) -> DistributedResult<NodeId>
Register a new node
Sourcepub fn deregister_node(&self, node_id: NodeId) -> DistributedResult<()>
pub fn deregister_node(&self, node_id: NodeId) -> DistributedResult<()>
Deregister a node
Sourcepub fn update_heartbeat(&self, node_id: NodeId) -> DistributedResult<()>
pub fn update_heartbeat(&self, node_id: NodeId) -> DistributedResult<()>
Update node heartbeat
Sourcepub fn update_status(
&self,
node_id: NodeId,
status: NodeStatus,
) -> DistributedResult<()>
pub fn update_status( &self, node_id: NodeId, status: NodeStatus, ) -> DistributedResult<()>
Update node status
Sourcepub fn get_available_nodes(&self) -> Vec<NodeInfo>
pub fn get_available_nodes(&self) -> Vec<NodeInfo>
Get list of available nodes
Sourcepub fn get_all_nodes(&self) -> Vec<NodeInfo>
pub fn get_all_nodes(&self) -> Vec<NodeInfo>
Get all registered nodes
Sourcepub fn available_node_count(&self) -> usize
pub fn available_node_count(&self) -> usize
Get number of available nodes
Sourcepub fn on_node_failure<F>(&self, callback: F)
pub fn on_node_failure<F>(&self, callback: F)
Register a failure callback
Sourcepub fn record_job_completion(
&self,
node_id: NodeId,
duration: Duration,
) -> DistributedResult<()>
pub fn record_job_completion( &self, node_id: NodeId, duration: Duration, ) -> DistributedResult<()>
Record job completion for a node
Sourcepub fn select_best_node(&self, estimated_cost: f64) -> Option<NodeId>
pub fn select_best_node(&self, estimated_cost: f64) -> Option<NodeId>
Select best node for a given workload
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NodeManager
impl RefUnwindSafe for NodeManager
impl Send for NodeManager
impl Sync for NodeManager
impl Unpin for NodeManager
impl UnsafeUnpin for NodeManager
impl UnwindSafe for NodeManager
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> 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>
Converts
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>
Converts
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