Interface InnerNode

All Superinterfaces:
Node
All Known Implementing Classes:
InnerNodeImpl

@LimitedPrivate({"HDFS","MapReduce"}) @Unstable public interface InnerNode extends Node
  • Method Details

    • add

      boolean add(Node n)
      Add node n to the subtree of this node
      Parameters:
      n - node to be added
      Returns:
      true if the node is added; false otherwise
    • getLoc

      Node getLoc(String loc)
      Given a node's string representation, return a reference to the node
      Parameters:
      loc - string location of the form /rack/node
      Returns:
      null if the node is not found or the childnode is there but not an instance of InnerNodeImpl
    • getChildren

      List<Node> getChildren()
      Returns:
      its children
    • getNumOfChildren

      int getNumOfChildren()
      Returns:
      the number of children this node has.
    • getNumOfLeaves

      int getNumOfLeaves()
      Returns:
      the number of leave nodes.
    • remove

      boolean remove(Node n)
      Remove node n from the subtree of this node
      Parameters:
      n - node to be deleted
      Returns:
      true if the node is deleted; false otherwise
    • getLeaf

      Node getLeaf(int leafIndex, Node excludedNode)
      get leafIndex leaf of this subtree if it is not in the excludedNode
      Parameters:
      leafIndex - an indexed leaf of the node
      excludedNode - an excluded node (can be null)
      Returns:
      the leaf node corresponding to the given index.