Package org.apache.hadoop.hdfs.net
Class DFSTopologyNodeImpl
java.lang.Object
org.apache.hadoop.net.NodeBase
org.apache.hadoop.net.InnerNodeImpl
org.apache.hadoop.hdfs.net.DFSTopologyNodeImpl
- All Implemented Interfaces:
org.apache.hadoop.net.InnerNode,org.apache.hadoop.net.Node
public class DFSTopologyNodeImpl
extends org.apache.hadoop.net.InnerNodeImpl
The HDFS-specific representation of a network topology inner node. The
difference is this class includes the information about the storage type
info of this subtree. This info will be used when selecting subtrees
in block placement.
-
Field Summary
FieldsFields inherited from class org.apache.hadoop.net.InnerNodeImpl
children, childrenMap, numOfLeavesFields inherited from class org.apache.hadoop.net.NodeBase
level, location, name, parent, PATH_SEPARATOR, PATH_SEPARATOR_STR, ROOT -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(org.apache.hadoop.net.Node n) voidchildAddStorage(String childName, org.apache.hadoop.fs.StorageType type) Called by a child node of the current node to increment a storage count.voidchildRemoveStorage(String childName, org.apache.hadoop.fs.StorageType type) Called by a child node of the current node to decrement a storage count.booleanintgetSubtreeStorageCount(org.apache.hadoop.fs.StorageType type) inthashCode()booleanremove(org.apache.hadoop.net.Node n) Methods inherited from class org.apache.hadoop.net.InnerNodeImpl
getChildren, getLeaf, getLoc, getNextAncestorName, getNumOfChildren, getNumOfLeaves, isAncestor, isParent, isRackMethods inherited from class org.apache.hadoop.net.NodeBase
getLevel, getName, getNetworkLocation, getParent, getPath, getPathComponents, locationToDepth, normalize, setLevel, setNetworkLocation, setParent, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.net.Node
getLevel, getName, getNetworkLocation, getParent, setLevel, setNetworkLocation, setParent
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Method Details
-
getSubtreeStorageCount
public int getSubtreeStorageCount(org.apache.hadoop.fs.StorageType type) -
add
public boolean add(org.apache.hadoop.net.Node n) - Specified by:
addin interfaceorg.apache.hadoop.net.InnerNode- Overrides:
addin classorg.apache.hadoop.net.InnerNodeImpl
-
equals
- Overrides:
equalsin classorg.apache.hadoop.net.InnerNodeImpl
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.apache.hadoop.net.InnerNodeImpl
-
remove
public boolean remove(org.apache.hadoop.net.Node n) - Specified by:
removein interfaceorg.apache.hadoop.net.InnerNode- Overrides:
removein classorg.apache.hadoop.net.InnerNodeImpl
-
childAddStorage
Called by a child node of the current node to increment a storage count. lock is needed as different datanodes may call recursively to modify the same parent. TODO : this may not happen at all, depending on how heartheat is processed- Parameters:
childName- the name of the child that tries to add the storage typetype- the type being incremented.
-
childRemoveStorage
Called by a child node of the current node to decrement a storage count.- Parameters:
childName- the name of the child removing a storage type.type- the type being removed.
-