From 38f529abf712a867b8cb02fa1e2c75c4fef8a02b Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Mon, 13 Sep 2021 15:24:38 +0530 Subject: [PATCH] HDFS-16223. AvailableSpaceRackFaultTolerantBlockPlacementPolicy should use chooseRandomWithStorageTypeTwoTrial() for better performance. (#3424). Contributed by Ayush Saxena. --- .../AvailableSpaceRackFaultTolerantBlockPlacementPolicy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/AvailableSpaceRackFaultTolerantBlockPlacementPolicy.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/AvailableSpaceRackFaultTolerantBlockPlacementPolicy.java index 226487b62a..c1ecdf477a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/AvailableSpaceRackFaultTolerantBlockPlacementPolicy.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/AvailableSpaceRackFaultTolerantBlockPlacementPolicy.java @@ -80,9 +80,9 @@ public class AvailableSpaceRackFaultTolerantBlockPlacementPolicy 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); }