Class Dispatcher

java.lang.Object
org.apache.hadoop.hdfs.server.balancer.Dispatcher

@Private public class Dispatcher extends Object
Dispatching block replica moves between datanodes.
  • 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

      public List<org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport> init() throws IOException
      Get live datanode storage reports and then build the network topology.
      Throws:
      IOException
    • newDatanode

      public Dispatcher.DDatanode newDatanode(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanode)
    • executePendingMove

      public void executePendingMove(Dispatcher.PendingMove p)
    • dispatchAndCheckContinue

      public boolean dispatchAndCheckContinue() throws InterruptedException
      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