Interface NetworkTopology

All Known Implementing Classes:
NetworkTopologyImpl, StabilizeNetworkTopology

public interface NetworkTopology
Network Topology Interface.
  • Field Details

  • Method Details

    • add

      void add(Node node)
      Add a node to the network topology.
      Parameters:
      node - add the node to network topology
    • remove

      void remove(Node node)
      Remove a node from network topology.
      Parameters:
      node - remove the node from network topology
    • contains

      boolean contains(Node node)
      Check if the tree contains node node.
      Parameters:
      node - node to check
      Returns:
      true if node is already in the network topology, otherwise false.
    • getNode

      Node getNode(String loc)
      Retrieve a node from the network topology.
      Parameters:
      loc -
      Returns:
    • getNumOfRacks

      int getNumOfRacks()
      Returns number of racks in the network topology.
      Returns:
      number of racks in the network topology.
    • getLeaves

      Set<Node> getLeaves(String loc)
      Returns the nodes under a location.
      Parameters:
      loc - network location
      Returns:
      nodes under a location
    • countNumOfAvailableNodes

      int countNumOfAvailableNodes(String scope, Collection<Node> excludedNodes)
      Return the number of leaves in scope but not in excludedNodes.

      If scope starts with ~, return the number of nodes that are not in scope and excludedNodes;

      Parameters:
      scope - a path string that may start with ~
      excludedNodes - a list of nodes
      Returns:
      number of available nodes