org.apache.hadoop.hdfs.server.protocol
Class BlockRecoveryCommand

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.protocol.ServerCommand
      extended by org.apache.hadoop.hdfs.server.protocol.DatanodeCommand
          extended by org.apache.hadoop.hdfs.server.protocol.BlockRecoveryCommand
All Implemented Interfaces:
org.apache.hadoop.io.Writable

@InterfaceAudience.Private
@InterfaceStability.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
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.
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hdfs.server.protocol.DatanodeCommand
FINALIZE, REGISTER
 
Constructor Summary
BlockRecoveryCommand()
          Create empty BlockRecoveryCommand.
BlockRecoveryCommand(int capacity)
          Create BlockRecoveryCommand with the specified capacity for recovering blocks.
 
Method Summary
 void add(BlockRecoveryCommand.RecoveringBlock block)
          Add recovering block to the command.
 Collection<BlockRecoveryCommand.RecoveringBlock> getRecoveringBlocks()
          Return the list of recovering blocks.
 void readFields(DataInput in)
           
 void write(DataOutput out)
           
 
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, toString, wait, wait, wait
 

Constructor Detail

BlockRecoveryCommand

public BlockRecoveryCommand()
Create empty BlockRecoveryCommand.


BlockRecoveryCommand

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

Method Detail

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.


write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Overrides:
write in class ServerCommand
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Overrides:
readFields in class ServerCommand
Throws:
IOException


Copyright © 2009 The Apache Software Foundation