HDFS-15295. AvailableSpaceBlockPlacementPolicy should use chooseRandomWithStorageTypeTwoTrial() for better performance. Contributed by Jinglun.

This commit is contained in:
Wei-Chiu Chuang 2020-04-24 11:53:24 -07:00
parent d4874585f4
commit 453771f170
1 changed files with 2 additions and 2 deletions

View File

@ -87,9 +87,9 @@ public class AvailableSpaceBlockPlacementPolicy extends
Preconditions.checkArgument(clusterMap instanceof DFSNetworkTopology);
DFSNetworkTopology dfsClusterMap = (DFSNetworkTopology)clusterMap;
DatanodeDescriptor a = (DatanodeDescriptor) dfsClusterMap
.chooseRandomWithStorageType(scope, excludedNode, type);
.chooseRandomWithStorageTypeTwoTrial(scope, excludedNode, type);
DatanodeDescriptor b = (DatanodeDescriptor) dfsClusterMap
.chooseRandomWithStorageType(scope, excludedNode, type);
.chooseRandomWithStorageTypeTwoTrial(scope, excludedNode, type);
return select(a, b, false);
}