Class Dispatcher
java.lang.Object
org.apache.hadoop.hdfs.server.balancer.Dispatcher
Dispatching block replica moves between datanodes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class for keeping track of block locations in the dispatcher.static classstatic classA class that keeps track of a datanode.classThis class keeps track of a scheduled reportedBlock moveclassA node that can be the sources of a block movestatic class -
Constructor Summary
ConstructorsConstructorDescriptionDispatcher(NameNodeConnector nnc, Set<String> includedNodes, Set<String> excludedNodes, long movedWinWidth, int moverThreads, int dispatcherThreads, int maxConcurrentMovesPerNode, int maxNoMoveInterval, org.apache.hadoop.conf.Configuration conf) Constructor called by Mover. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckForBlockPinningFailures(Map<Long, Set<org.apache.hadoop.hdfs.protocol.DatanodeInfo>> excludedPinnedBlocks, Iterable<? extends Dispatcher.DDatanode.StorageGroup> targets) Check any of the block movements are failed due to block pinning errors.static booleancheckForSuccess(Iterable<? extends Dispatcher.DDatanode.StorageGroup> targets) booleanvoidorg.apache.hadoop.net.NetworkTopologyorg.apache.hadoop.hdfs.DistributedFileSystemList<org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport>init()Get live datanode storage reports and then build the network topology.intnewDatanode(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanode) static voidsetDelayAfterErrors(long time) voidshutdown thread poolsstatic booleanwaitForMoveCompletion(Iterable<? extends Dispatcher.DDatanode.StorageGroup> targets) Wait for all reportedBlock move confirmations.
-
Constructor Details
-
Dispatcher
public Dispatcher(NameNodeConnector nnc, Set<String> includedNodes, Set<String> excludedNodes, long movedWinWidth, int moverThreads, int dispatcherThreads, int maxConcurrentMovesPerNode, int maxNoMoveInterval, org.apache.hadoop.conf.Configuration conf) Constructor called by Mover.
-
-
Method Details
-
getDistributedFileSystem
public org.apache.hadoop.hdfs.DistributedFileSystem getDistributedFileSystem() -
getStorageGroupMap
-
getCluster
public org.apache.hadoop.net.NetworkTopology getCluster() -
moveTasksTotal
public int moveTasksTotal() -
init
Get live datanode storage reports and then build the network topology.- Throws:
IOException
-
newDatanode
-
executePendingMove
-
dispatchAndCheckContinue
- Throws:
InterruptedException
-
waitForMoveCompletion
public static boolean waitForMoveCompletion(Iterable<? extends Dispatcher.DDatanode.StorageGroup> targets) Wait for all reportedBlock move confirmations.- Returns:
- true if there is failed move execution
-
checkForBlockPinningFailures
public static void checkForBlockPinningFailures(Map<Long, Set<org.apache.hadoop.hdfs.protocol.DatanodeInfo>> excludedPinnedBlocks, Iterable<? extends Dispatcher.DDatanode.StorageGroup> targets) Check any of the block movements are failed due to block pinning errors. If yes, add the failed blockId and its respective source node location to the excluded list. -
checkForSuccess
public static boolean checkForSuccess(Iterable<? extends Dispatcher.DDatanode.StorageGroup> targets) - Returns:
- true if some moves are success.
-
setDelayAfterErrors
@VisibleForTesting public static void setDelayAfterErrors(long time) -
shutdownNow
public void shutdownNow()shutdown thread pools
-