HDFS-17136. Fix annotation description and typo in BlockPlacementPolicyDefault Class (#5907)
Co-authored-by: huangzhaobo <huangzhaobo99@126.com> Reviewed-by: Shilun Fan <slfan1989@apache.org> Signed-off-by: Tao Li <tomscut@apache.org>
This commit is contained in:
parent
6cc56d40f5
commit
52d66c2c11
@ -1085,12 +1085,13 @@ boolean isGoodDatanode(DatanodeDescriptor node,
|
|||||||
int maxTargetPerRack, boolean considerLoad,
|
int maxTargetPerRack, boolean considerLoad,
|
||||||
List<DatanodeStorageInfo> results,
|
List<DatanodeStorageInfo> results,
|
||||||
boolean avoidStaleNodes) {
|
boolean avoidStaleNodes) {
|
||||||
// check if the node is (being) decommissioned
|
// check if the node is in state 'In Service'
|
||||||
if (!node.isInService()) {
|
if (!node.isInService()) {
|
||||||
logNodeIsNotChosen(node, NodeNotChosenReason.NOT_IN_SERVICE);
|
logNodeIsNotChosen(node, NodeNotChosenReason.NOT_IN_SERVICE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if the target is a stale node
|
||||||
if (avoidStaleNodes) {
|
if (avoidStaleNodes) {
|
||||||
if (node.isStale(this.staleInterval)) {
|
if (node.isStale(this.staleInterval)) {
|
||||||
logNodeIsNotChosen(node, NodeNotChosenReason.NODE_STALE);
|
logNodeIsNotChosen(node, NodeNotChosenReason.NODE_STALE);
|
||||||
@ -1218,7 +1219,7 @@ public DatanodeStorageInfo chooseReplicaToDelete(
|
|||||||
DatanodeStorageInfo minSpaceStorage = null;
|
DatanodeStorageInfo minSpaceStorage = null;
|
||||||
|
|
||||||
// Pick the node with the oldest heartbeat or with the least free space,
|
// 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,
|
for(DatanodeStorageInfo storage : pickupReplicaSet(moreThanOne,
|
||||||
exactlyOne, rackMap)) {
|
exactlyOne, rackMap)) {
|
||||||
if (!excessTypes.contains(storage.getStorageType())) {
|
if (!excessTypes.contains(storage.getStorageType())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user