HDFS-15783. Speed up BlockPlacementPolicyRackFaultTolerant#verifyBlockPlacement (#2626)
This commit is contained in:
parent
cfe6e1f7da
commit
45b3a84709
@ -237,9 +237,8 @@ public BlockPlacementStatus verifyBlockPlacement(DatanodeInfo[] locs,
|
||||
// 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
Block a user