BlockRecoveryCommand (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.protocol, class: BlockRecoveryCommand

Package org.apache.hadoop.hdfs.server.protocol

# Class BlockRecoveryCommand

java.lang.Object
org.apache.hadoop.hdfs.server.protocol.ServerCommand
org.apache.hadoop.hdfs.server.protocol.DatanodeCommand
org.apache.hadoop.hdfs.server.protocol.BlockRecoveryCommand

@Private @Evolving public class BlockRecoveryCommand extends DatanodeCommand
BlockRecoveryCommand is an instruction to a data-node to recover the specified blocks. The data-node that receives this command treats itself as a primary data-node in the recover process. Block recovery is identified by a recoveryId, which is also the new generation stamp, which the block will have after the recovery succeeds.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `BlockRecoveryCommand.RecoveringBlock`
  This is a block with locations from which it should be recovered and the new generation stamp, which the block will have after successful recovery.
  `static class`
  `BlockRecoveryCommand.RecoveringStripedBlock`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlockRecoveryCommand()`
  Create empty BlockRecoveryCommand.
  `BlockRecoveryCommand(int capacity)`
  Create BlockRecoveryCommand with the specified capacity for recovering blocks.
  `BlockRecoveryCommand(Collection<BlockRecoveryCommand.RecoveringBlock> blocks)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(BlockRecoveryCommand.RecoveringBlock block)`
  Add recovering block to the command.
  `Collection<BlockRecoveryCommand.RecoveringBlock>`
  `getRecoveringBlocks()`
  Return the list of recovering blocks.
  `String`
  `toString()`

  ### Methods inherited from class org.apache.hadoop.hdfs.server.protocol.ServerCommand

  `getAction`

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

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

- ## Constructor Details

  - ### BlockRecoveryCommand

    public BlockRecoveryCommand()
    Create empty BlockRecoveryCommand.

  - ### BlockRecoveryCommand

    public BlockRecoveryCommand(int capacity)
    Create BlockRecoveryCommand with the specified capacity for recovering blocks.

  - ### BlockRecoveryCommand

    public BlockRecoveryCommand(Collection<BlockRecoveryCommand.RecoveringBlock> blocks)

- ## Method Details

  - ### getRecoveringBlocks

    public Collection<BlockRecoveryCommand.RecoveringBlock> getRecoveringBlocks()
    Return the list of recovering blocks.

  - ### add

    public void add(BlockRecoveryCommand.RecoveringBlock block)
    Add recovering block to the command.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `ServerCommand`