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
|
// only one rack
|
||||||
return new BlockPlacementStatusDefault(1, 1, 1);
|
return new BlockPlacementStatusDefault(1, 1, 1);
|
||||||
}
|
}
|
||||||
// 1. Check that all locations are different.
|
// Count locations on different racks.
|
||||||
// 2. Count locations on different racks.
|
Set<String> racks = new HashSet<>();
|
||||||
Set<String> racks = new TreeSet<>();
|
|
||||||
for (DatanodeInfo dn : locs) {
|
for (DatanodeInfo dn : locs) {
|
||||||
racks.add(dn.getNetworkLocation());
|
racks.add(dn.getNetworkLocation());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user