9uapaw commented on a change in pull request #3500:
URL: https://github.com/apache/hadoop/pull/3500#discussion_r722177241



##########
File path: 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java
##########
@@ -2330,25 +2330,27 @@ void 
updateMaximumApplications(CapacitySchedulerConfiguration conf) {
     int maxAppsForQueue = conf.getMaximumApplicationsPerQueue(getQueuePath());
 
     int maxGlobalApplications = conf.getGlobalMaximumApplicationsPerQueue();
-    if (maxGlobalApplications < 0) {
-      maxGlobalApplications = conf.getMaximumSystemApplications();
-    }
+    int maxSystemApplications = conf.getMaximumSystemApplications();
+    int baseMaxApplications = maxGlobalApplications > 0 ?

Review comment:
       The problem with this approach is that if using ABSOLUTE_RESOURCE, the 
maxGlobalApplications is used, regardless of the fact that it could be -1. You 
would need yet an other check there, which would make this logic even more 
convoluted. In addition to this, using pairs in Java is verbose because it 
lacks destructuring, so it would look more like:
   ```java
   ImmutablePair<String, Integer> maxLabelAndApp = getUpdatedMaxApps(int base);
   maxLabel = maxLabelAndApp.get(0);
   maxAppsForQueue = maxLabelAndApp.get(1);
   ```
   In my honest opinion, this whole logic should be plain simple, but there are 
already tests that build on this behaviour, not to mention users, therefore we 
need to be backward compatible.




-- 
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]

Reply via email to