pub struct DeploymentRouteTable { /* private fields */ }Expand description
Bounded station-to-node deployment route table.
Implementations§
Source§impl DeploymentRouteTable
impl DeploymentRouteTable
Sourcepub fn new(config: DeploymentConfig) -> Self
pub fn new(config: DeploymentConfig) -> Self
Creates an empty deployment route table.
Sourcepub const fn config(&self) -> DeploymentConfig
pub const fn config(&self) -> DeploymentConfig
Returns configuration.
Sourcepub const fn stats(&self) -> DeploymentStats
pub const fn stats(&self) -> DeploymentStats
Returns statistics.
Sourcepub fn station_len(&self) -> usize
pub fn station_len(&self) -> usize
Returns station route count.
Sourcepub fn register_node(
&mut self,
node_id: NodeId,
station_capacity: usize,
now: Tick,
) -> Result<DeploymentNodeRoute, DeploymentError>
pub fn register_node( &mut self, node_id: NodeId, station_capacity: usize, now: Tick, ) -> Result<DeploymentNodeRoute, DeploymentError>
Registers or refreshes a node.
Sourcepub fn heartbeat(
&mut self,
node_id: NodeId,
now: Tick,
) -> Result<DeploymentNodeRoute, DeploymentError>
pub fn heartbeat( &mut self, node_id: NodeId, now: Tick, ) -> Result<DeploymentNodeRoute, DeploymentError>
Updates a node heartbeat.
Sourcepub fn mark_draining(
&mut self,
node_id: NodeId,
) -> Result<DeploymentNodeRoute, DeploymentError>
pub fn mark_draining( &mut self, node_id: NodeId, ) -> Result<DeploymentNodeRoute, DeploymentError>
Marks a node draining. Existing station routes remain valid.
Sourcepub fn mark_offline(
&mut self,
node_id: NodeId,
) -> Result<DeploymentNodeRoute, DeploymentError>
pub fn mark_offline( &mut self, node_id: NodeId, ) -> Result<DeploymentNodeRoute, DeploymentError>
Marks a node offline. Station routes are retained for explicit remediation by the embedder.
Sourcepub fn assign_station(
&mut self,
station_id: StationId,
node_id: NodeId,
now: Tick,
) -> Result<DeploymentStationRoute, DeploymentError>
pub fn assign_station( &mut self, station_id: StationId, node_id: NodeId, now: Tick, ) -> Result<DeploymentStationRoute, DeploymentError>
Assigns a station to an online node.
Sourcepub fn move_station(
&mut self,
station_id: StationId,
target_node: NodeId,
now: Tick,
) -> Result<DeploymentStationMove, DeploymentError>
pub fn move_station( &mut self, station_id: StationId, target_node: NodeId, now: Tick, ) -> Result<DeploymentStationMove, DeploymentError>
Moves an existing station route to another online node.
Sourcepub fn unassign_station(
&mut self,
station_id: StationId,
) -> Result<DeploymentStationRoute, DeploymentError>
pub fn unassign_station( &mut self, station_id: StationId, ) -> Result<DeploymentStationRoute, DeploymentError>
Removes one station route.
Sourcepub fn node_route(
&self,
node_id: NodeId,
) -> Result<DeploymentNodeRoute, DeploymentError>
pub fn node_route( &self, node_id: NodeId, ) -> Result<DeploymentNodeRoute, DeploymentError>
Returns a node route.
Sourcepub fn station_route(
&self,
station_id: StationId,
) -> Result<DeploymentStationRoute, DeploymentError>
pub fn station_route( &self, station_id: StationId, ) -> Result<DeploymentStationRoute, DeploymentError>
Returns a station route.
Sourcepub fn stations_on_node(
&self,
node_id: NodeId,
) -> Result<Vec<StationId>, DeploymentError>
pub fn stations_on_node( &self, node_id: NodeId, ) -> Result<Vec<StationId>, DeploymentError>
Returns station ids assigned to a node.
Sourcepub fn resolve_gateway_route(
&self,
route: GatewayRoute,
) -> Result<GatewayDeliveryRoute, DeploymentError>
pub fn resolve_gateway_route( &self, route: GatewayRoute, ) -> Result<GatewayDeliveryRoute, DeploymentError>
Resolves a gateway route to deployment node/station metadata.
Draining nodes remain valid for existing station routes; offline nodes are rejected so embedders can reroute or fail over explicitly.
Sourcepub fn resolve_gateway_client(
&self,
gateway: &GatewaySessionTable,
client_id: ClientId,
) -> Result<GatewayDeliveryRoute, GatewayDeliveryError>
pub fn resolve_gateway_client( &self, gateway: &GatewaySessionTable, client_id: ClientId, ) -> Result<GatewayDeliveryRoute, GatewayDeliveryError>
Resolves a connected gateway client to deployment node/station metadata.
Sourcepub fn stale_nodes(&self, now: Tick) -> Vec<NodeId>
pub fn stale_nodes(&self, now: Tick) -> Vec<NodeId>
Returns stale node ids without mutating node state.
Sourcepub fn mark_stale_offline(&mut self, now: Tick) -> usize
pub fn mark_stale_offline(&mut self, now: Tick) -> usize
Marks stale nodes offline.
Trait Implementations§
Source§impl Clone for DeploymentRouteTable
impl Clone for DeploymentRouteTable
Source§fn clone(&self) -> DeploymentRouteTable
fn clone(&self) -> DeploymentRouteTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more