HDFS-15783. Speed up BlockPlacementPolicyRackFaultTolerant#verifyBlockPlacement (#2626)

(cherry picked from commit 45b3a84709)
This commit is contained in:
Akira Ajisaka 2021-01-21 10:07:46 +09:00
parent 371955fb50
commit f1dff467e1
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
1 changed files with 2 additions and 3 deletions

View File

@ -237,9 +237,8 @@ public class BlockPlacementPolicyRackFaultTolerant extends BlockPlacementPolicyD
// only one rack
return new BlockPlacementStatusDefault(1, 1, 1);
}
// 1. Check that all locations are different.
// 2. Count locations on different racks.
Set<String> racks = new TreeSet<>();
// Count locations on different racks.
Set<String> racks = new HashSet<>();
for (DatanodeInfo dn : locs) {
racks.add(dn.getNetworkLocation());
}