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
- 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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlockRecoveryCommand
public BlockRecoveryCommand()
- Create empty BlockRecoveryCommand.
BlockRecoveryCommand
public BlockRecoveryCommand(int capacity)
- Create BlockRecoveryCommand with
the specified capacity for recovering blocks.
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