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
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThis constant is used to indicate that the block deletion does not need explicit ACK from the datanode. -
Constructor Summary
ConstructorsConstructorDescriptionBlockCommand(int action, String poolId, List<DatanodeDescriptor.BlockTargetPair> blocktargetlist) Create BlockCommand for transferring blocks to another datanodeBlockCommand(int action, String poolId, org.apache.hadoop.hdfs.protocol.Block[] blocks) Create BlockCommand for the given actionBlockCommand(int action, String poolId, org.apache.hadoop.hdfs.protocol.Block[] blocks, org.apache.hadoop.hdfs.protocol.DatanodeInfo[][] targets, org.apache.hadoop.fs.StorageType[][] targetStorageTypes, String[][] targetStorageIDs) Create BlockCommand for the given action -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.hdfs.protocol.Block[]org.apache.hadoop.hdfs.protocol.DatanodeInfo[][]String[][]org.apache.hadoop.fs.StorageType[][]Methods inherited from class org.apache.hadoop.hdfs.server.protocol.ServerCommand
getAction, toString
-
Field Details
-
NO_ACK
public static final long NO_ACKThis constant is used to indicate that the block deletion does not need explicit ACK from the datanode. When a block is put into the list of blocks to be deleted, it's size is set to this constant. We assume that no block would actually have this size. Otherwise, we would miss ACKs for blocks with such size. Positive number is used for compatibility reasons.- See Also:
-
-
Constructor Details
-
BlockCommand
public BlockCommand(int action, String poolId, List<DatanodeDescriptor.BlockTargetPair> blocktargetlist) Create BlockCommand for transferring blocks to another datanode- Parameters:
blocktargetlist- blocks to be transferred
-
BlockCommand
Create BlockCommand for the given action- Parameters:
blocks- blocks related to the action
-
BlockCommand
public BlockCommand(int action, String poolId, org.apache.hadoop.hdfs.protocol.Block[] blocks, org.apache.hadoop.hdfs.protocol.DatanodeInfo[][] targets, org.apache.hadoop.fs.StorageType[][] targetStorageTypes, String[][] targetStorageIDs) Create BlockCommand for the given action- Parameters:
blocks- blocks related to the action
-
-
Method Details
-
getBlockPoolId
-
getBlocks
public org.apache.hadoop.hdfs.protocol.Block[] getBlocks() -
getTargets
public org.apache.hadoop.hdfs.protocol.DatanodeInfo[][] getTargets() -
getTargetStorageTypes
public org.apache.hadoop.fs.StorageType[][] getTargetStorageTypes() -
getTargetStorageIDs
-