HDFS-15783. Speed up BlockPlacementPolicyRackFaultTolerant#verifyBlockPlacement (#2626)
(cherry picked from commit 45b3a84709
)
This commit is contained in:
parent
371955fb50
commit
f1dff467e1
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue