public class InnerNodeImpl
extends org.apache.hadoop.net.NodeBase
implements org.apache.hadoop.net.InnerNode
| Modifier and Type | Class and Description |
|---|---|
protected static class |
InnerNodeImpl.Factory |
| Modifier and Type | Field and Description |
|---|---|
protected List<org.apache.hadoop.net.Node> |
children |
protected Map<String,org.apache.hadoop.net.Node> |
childrenMap |
protected int |
numOfLeaves |
| Modifier | Constructor and Description |
|---|---|
protected |
InnerNodeImpl(String path)
Construct an InnerNode from a path-like string
|
protected |
InnerNodeImpl(String name,
String location,
org.apache.hadoop.net.InnerNode parent,
int level)
Construct an InnerNode
from its name, its network location, its parent, and its level
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(org.apache.hadoop.net.Node n)
Add node n to the subtree of this node
|
boolean |
equals(Object to) |
List<org.apache.hadoop.net.Node> |
getChildren() |
org.apache.hadoop.net.Node |
getLeaf(int leafIndex,
org.apache.hadoop.net.Node excludedNode)
get leafIndex leaf of this subtree
if it is not in the excludedNode
|
org.apache.hadoop.net.Node |
getLoc(String loc)
Given a node's string representation, return a reference to the node
|
String |
getNextAncestorName(org.apache.hadoop.net.Node n) |
int |
getNumOfLeaves() |
int |
hashCode() |
boolean |
isAncestor(org.apache.hadoop.net.Node n)
Judge if this node is an ancestor of node n
|
boolean |
isParent(org.apache.hadoop.net.Node n)
Judge if this node is the parent of node n
|
boolean |
isRack()
Judge if this node represents a rack
|
boolean |
remove(org.apache.hadoop.net.Node n)
Remove node n from the subtree of this node
|
getLevel, getName, getNetworkLocation, getParent, getPath, getPathComponents, locationToDepth, normalize, setLevel, setNetworkLocation, setParent, toStringprotected final List<org.apache.hadoop.net.Node> children
protected int numOfLeaves
protected InnerNodeImpl(String path)
public List<org.apache.hadoop.net.Node> getChildren()
getChildren in interface org.apache.hadoop.net.InnerNodepublic boolean isRack()
public boolean isAncestor(org.apache.hadoop.net.Node n)
n - a nodepublic boolean isParent(org.apache.hadoop.net.Node n)
n - a nodepublic String getNextAncestorName(org.apache.hadoop.net.Node n)
public boolean add(org.apache.hadoop.net.Node n)
org.apache.hadoop.net.InnerNodeadd in interface org.apache.hadoop.net.InnerNoden - node to be addedpublic boolean remove(org.apache.hadoop.net.Node n)
org.apache.hadoop.net.InnerNoderemove in interface org.apache.hadoop.net.InnerNoden - node to be deletedpublic org.apache.hadoop.net.Node getLoc(String loc)
org.apache.hadoop.net.InnerNodegetLoc in interface org.apache.hadoop.net.InnerNodeloc - string location of the form /rack/nodeInnerNodeImplpublic org.apache.hadoop.net.Node getLeaf(int leafIndex,
org.apache.hadoop.net.Node excludedNode)
org.apache.hadoop.net.InnerNodegetLeaf in interface org.apache.hadoop.net.InnerNodeleafIndex - an indexed leaf of the nodeexcludedNode - an excluded node (can be null)public int getNumOfLeaves()
getNumOfLeaves in interface org.apache.hadoop.net.InnerNodepublic int hashCode()
hashCode in class org.apache.hadoop.net.NodeBasepublic boolean equals(Object to)
equals in class org.apache.hadoop.net.NodeBaseCopyright © 2022 Apache Software Foundation. All rights reserved.