Interface NetworkTopology

    • Method Detail

      • 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​(java.lang.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

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

        int countNumOfAvailableNodes​(java.lang.String scope,
                                     java.util.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