Skip to main content

diff_nodes

Function diff_nodes 

Source
pub fn diff_nodes(
    target_nodes: &[String],
    running_nodes: &HashSet<String>,
) -> (Vec<String>, Vec<String>)
Expand description

Calculate which nodes need to start/stop to transition to a target set of nodes

Shared by LifecycleManager::calculate_mode_diff and the CLI’s CliLifecycleManager::calculate_mode_diff, which perform the same set-diffing against their own independently-tracked mode configuration and running-node state.

§Arguments

  • target_nodes - Nodes that should be running after the transition
  • running_nodes - Nodes that are currently running

§Returns

A (start, stop) tuple: nodes to start (in target but not running) and nodes to stop (running but not in target).