HDFS-13573. Javadoc for BlockPlacementPolicyDefault is inaccurate. Contributed by Zsolt Venczel.

This commit is contained in:
Yiqun Lin 2018-05-18 10:43:53 +08:00
parent 8783613696
commit f749517cc7
1 changed files with 9 additions and 4 deletions

View File

@ -41,10 +41,15 @@ import com.google.common.annotations.VisibleForTesting;
* The class is responsible for choosing the desired number of targets * The class is responsible for choosing the desired number of targets
* for placing block replicas. * for placing block replicas.
* The replica placement strategy is that if the writer is on a datanode, * The replica placement strategy is that if the writer is on a datanode,
* the 1st replica is placed on the local machine, * the 1st replica is placed on the local machine by default
* otherwise a random datanode. The 2nd replica is placed on a datanode * (By passing the {@link org.apache.hadoop.fs.CreateFlag#NO_LOCAL_WRITE} flag
* that is on a different rack. The 3rd replica is placed on a datanode * the client can request not to put a block replica on the local datanode.
* which is on a different node of the rack as the second replica. * Subsequent replicas will still follow default block placement policy.).
* If the writer is not on a datanode, the 1st replica is placed on a random
* node.
* The 2nd replica is placed on a datanode that is on a different rack.
* The 3rd replica is placed on a datanode which is on a different node of the
* rack as the second replica.
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
public class BlockPlacementPolicyDefault extends BlockPlacementPolicy { public class BlockPlacementPolicyDefault extends BlockPlacementPolicy {