diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java index 3d5ecf9b57..60a2a8676a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java @@ -1085,12 +1085,13 @@ boolean isGoodDatanode(DatanodeDescriptor node, int maxTargetPerRack, boolean considerLoad, List results, boolean avoidStaleNodes) { - // check if the node is (being) decommissioned + // check if the node is in state 'In Service' if (!node.isInService()) { logNodeIsNotChosen(node, NodeNotChosenReason.NOT_IN_SERVICE); return false; } + // check if the target is a stale node if (avoidStaleNodes) { if (node.isStale(this.staleInterval)) { logNodeIsNotChosen(node, NodeNotChosenReason.NODE_STALE); @@ -1218,7 +1219,7 @@ public DatanodeStorageInfo chooseReplicaToDelete( DatanodeStorageInfo minSpaceStorage = null; // Pick the node with the oldest heartbeat or with the least free space, - // if all hearbeats are within the tolerable heartbeat interval + // if all heartbeats are within the tolerable heartbeat interval for(DatanodeStorageInfo storage : pickupReplicaSet(moreThanOne, exactlyOne, rackMap)) { if (!excessTypes.contains(storage.getStorageType())) {