HBASE-20509 putting List in HashSet directly without using addAll function to improve performance
Signed-off-by: Jan Hentschel <jan.hentschel@ultratendency.com>
This commit is contained in:
parent
43f53c1a23
commit
f4ff480387
|
@ -395,8 +395,7 @@ public class FavoredNodeAssignmentHelper {
|
|||
rackSkipSet.add(primaryRack);
|
||||
String secondaryRack = getOneRandomRack(rackSkipSet);
|
||||
List<ServerName> serverList = getServersFromRack(secondaryRack);
|
||||
Set<ServerName> serverSet = new HashSet<>();
|
||||
serverSet.addAll(serverList);
|
||||
Set<ServerName> serverSet = new HashSet<>(serverList);
|
||||
ServerName[] favoredNodes;
|
||||
if (serverList.size() >= 2) {
|
||||
// Randomly pick up two servers from this secondary rack
|
||||
|
@ -433,8 +432,7 @@ public class FavoredNodeAssignmentHelper {
|
|||
}
|
||||
secondaryRack = getOneRandomRack(rackSkipSet);
|
||||
serverList = getServersFromRack(secondaryRack);
|
||||
serverSet = new HashSet<>();
|
||||
serverSet.addAll(serverList);
|
||||
serverSet = new HashSet<>(serverList);
|
||||
}
|
||||
|
||||
// Place the secondary RS
|
||||
|
|
Loading…
Reference in New Issue