HDFS-16223. AvailableSpaceRackFaultTolerantBlockPlacementPolicy should use chooseRandomWithStorageTypeTwoTrial() for better performance. (#3424). Contributed by Ayush Saxena.

This commit is contained in:
Ayush Saxena 2021-09-13 15:24:38 +05:30 committed by GitHub
parent 356ebbbe80
commit 17c58ac959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,9 +80,9 @@ protected DatanodeDescriptor chooseDataNode(final String scope,
Preconditions.checkArgument(clusterMap instanceof DFSNetworkTopology); Preconditions.checkArgument(clusterMap instanceof DFSNetworkTopology);
DFSNetworkTopology dfsClusterMap = (DFSNetworkTopology) clusterMap; DFSNetworkTopology dfsClusterMap = (DFSNetworkTopology) clusterMap;
DatanodeDescriptor a = (DatanodeDescriptor) dfsClusterMap DatanodeDescriptor a = (DatanodeDescriptor) dfsClusterMap
.chooseRandomWithStorageType(scope, excludedNode, type); .chooseRandomWithStorageTypeTwoTrial(scope, excludedNode, type);
DatanodeDescriptor b = (DatanodeDescriptor) dfsClusterMap DatanodeDescriptor b = (DatanodeDescriptor) dfsClusterMap
.chooseRandomWithStorageType(scope, excludedNode, type); .chooseRandomWithStorageTypeTwoTrial(scope, excludedNode, type);
return select(a, b); return select(a, b);
} }