slfan1989 commented on code in PR #6356:
URL: https://github.com/apache/hadoop/pull/6356#discussion_r1427433693
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/policies/router/LoadBasedRouterPolicy.java:
##########
@@ -66,12 +66,19 @@ protected SubClusterId chooseSubCluster(
Map<SubClusterIdInfo, Float> weights =
getPolicyInfo().getRouterPolicyWeights();
SubClusterIdInfo chosen = null;
long currBestMem = -1;
+ long currBestVcore = -1;
for (Map.Entry<SubClusterId, SubClusterInfo> entry :
preSelectSubclusters.entrySet()) {
SubClusterIdInfo id = new SubClusterIdInfo(entry.getKey());
if (weights.containsKey(id) && weights.get(id) > 0) {
long availableMemory = getAvailableMemory(entry.getValue());
- if (availableMemory > currBestMem) {
+ long availableVcore = getAvailableVcore(entry.getValue());
+ if (availableMemory > currBestMem && availableVcore > currBestVcore) {
Review Comment:
```
if (availableMemory > currBestMem) {
....
}
```
This code is needed to select the largest subcluster of availableMemory.
Memory is a more strictly limited resource, because without memory, the
application cannot execute. Sufficient memory can also be considered as the
cluster is idle.
If we add cpu constraints (availableVcore), subclusters with smaller memory
may be selected, which is not an expected situation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]