BlockDispatcher (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.common.sps, class: BlockDispatcher

Package org.apache.hadoop.hdfs.server.common.sps

# Class BlockDispatcher

java.lang.Object
org.apache.hadoop.hdfs.server.common.sps.BlockDispatcher

@Private @Evolving public class BlockDispatcher extends Object
Dispatching block replica moves between datanodes to satisfy the storage policy.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlockDispatcher(int sockTimeout, int ioFileBuffSize, boolean connectToDatanodeViaHostname)`
  Construct block dispatcher details.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BlockMovementStatus`
  `moveBlock(BlockStorageMovementCommand.BlockMovingInfo blkMovingInfo, org.apache.hadoop.hdfs.protocol.datatransfer.sasl.SaslDataTransferClient saslClient, org.apache.hadoop.hdfs.protocol.ExtendedBlock eb, Socket sock, org.apache.hadoop.hdfs.protocol.datatransfer.sasl.DataEncryptionKeyFactory km, org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier> accessToken)`
  Moves the given block replica to the given target node and wait for the response.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BlockDispatcher

    public BlockDispatcher(int sockTimeout, int ioFileBuffSize, boolean connectToDatanodeViaHostname)
    Construct block dispatcher details.
    Parameters:
      `sockTimeout` - soTimeout
      `ioFileBuffSize` - file io buffer size
      `connectToDatanodeViaHostname` - true represents connect via hostname, false otw

- ## Method Details

  - ### moveBlock

    public BlockMovementStatus moveBlock(BlockStorageMovementCommand.BlockMovingInfo blkMovingInfo, org.apache.hadoop.hdfs.protocol.datatransfer.sasl.SaslDataTransferClient saslClient, org.apache.hadoop.hdfs.protocol.ExtendedBlock eb, Socket sock, org.apache.hadoop.hdfs.protocol.datatransfer.sasl.DataEncryptionKeyFactory km, org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier> accessToken) throws IOException
    Moves the given block replica to the given target node and wait for the response.
    Parameters:
      `blkMovingInfo` - block to storage info
      `saslClient` - SASL for DataTransferProtocol on behalf of a client
      `eb` - extended block info
      `sock` - target node's socket
      `km` - for creation of an encryption key
      `accessToken` - connection block access token
    Returns:
      status of the block movement
    Throws:
      `IOException`