Package org.apache.hadoop.net
Interface InnerNode
- All Superinterfaces:
Node
- All Known Implementing Classes:
InnerNodeImpl
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd node n to the subtree of this nodeget leafIndex leaf of this subtree if it is not in the excludedNodeGiven a node's string representation, return a reference to the nodeintintbooleanRemove node n from the subtree of this nodeMethods inherited from interface org.apache.hadoop.net.Node
getLevel, getName, getNetworkLocation, getParent, setLevel, setNetworkLocation, setParent
-
Method Details
-
add
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
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
- Returns:
- its children
-
getNumOfChildren
int getNumOfChildren()- Returns:
- the number of children this node has.
-
getNumOfLeaves
int getNumOfLeaves()- Returns:
- the number of leave nodes.
-
remove
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
get leafIndex leaf of this subtree if it is not in the excludedNode- Parameters:
leafIndex- an indexed leaf of the nodeexcludedNode- an excluded node (can be null)- Returns:
- the leaf node corresponding to the given index.
-