}
List<VcCluster> availableVcClusters =
node.getNodeGroup().getVcClusters(this.cluster);
VcCluster targetVcCluster = null;
for (VcCluster vcCluster : availableVcClusters) {
if (vcCluster.getName().equals(abstractCluster.getName())) {
targetVcCluster = vcCluster;
break;
}
}
AuAssert.check(targetVcCluster != null);
String targetRp =
getLeastUsed(targetVcCluster.getName(), targetVcCluster.getVcRps());
Pair<String, String> rpPair =
new Pair<String, String>(targetVcCluster.getName(), targetRp);
// update rp usage map
rpUsage.put(rpPair, rpUsage.get(rpPair) + 1);
// update cluster->rp by group map
if (!rpMapByGroup.containsKey(nodeGroupName)) {
rpMapByGroup.put(nodeGroupName, new HashMap<String, String>());
}
Map<String, String> clusterRpMap = rpMapByGroup.get(nodeGroupName);
clusterRpMap.put(targetVcCluster.getName(), targetRp);
return rpPair;
}