org.apache.hadoop.hdfs.server.protocol
Class BlockCommand
java.lang.Object
org.apache.hadoop.hdfs.server.protocol.ServerCommand
org.apache.hadoop.hdfs.server.protocol.DatanodeCommand
org.apache.hadoop.hdfs.server.protocol.BlockCommand
- All Implemented Interfaces:
- org.apache.hadoop.io.Writable
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class BlockCommand
- extends DatanodeCommand
A BlockCommand is an instruction to a datanode
regarding some blocks under its control. It tells
the DataNode to either invalidate a set of indicated
blocks, or to copy a set of indicated blocks to
another DataNode.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlockCommand
public BlockCommand()
BlockCommand
public BlockCommand(int action,
List<DatanodeDescriptor.BlockTargetPair> blocktargetlist)
- Create BlockCommand for transferring blocks to another datanode
- Parameters:
blocktargetlist
- blocks to be transferred
BlockCommand
public BlockCommand(int action,
Block[] blocks)
- Create BlockCommand for the given action
- Parameters:
blocks
- blocks related to the action
getBlocks
public Block[] getBlocks()
getTargets
public DatanodeInfo[][] getTargets()
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