tomicooler commented on code in PR #5783:
URL: https://github.com/apache/hadoop/pull/5783#discussion_r1250921579


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractParentQueue.java:
##########
@@ -1136,11 +1137,43 @@ public void refreshAfterResourceCalculation(Resource 
clusterResource,
     CSQueueUtils.updateConfiguredCapacityMetrics(resourceCalculator,
         labelManager.getResourceByLabel(null, clusterResource),
         RMNodeLabelsManager.NO_LABEL, this);
+
+    LOG.info("Refresh after resource calculation (PARENT) {}\n"
+            + "effectiveMinResource = {}\n"
+            + "effectiveMaxResource = {}\n"
+            + "capacity = {}\n"
+            + "maxCapacity = {}\n"
+            + "absoluteCapacity = {}\n"
+            + "absoluteMaxCapacity = {}",

Review Comment:
   effectiveMin/Max resource by labels?



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbsoluteResourceCapacityCalculator.java:
##########
@@ -44,8 +44,14 @@ public double calculateMinimumResource(
     double remainingResourceRatio = 
resourceCalculationDriver.getRemainingRatioOfResource(
         label, resourceName);
 
-    return normalizedRatio * remainingResourceRatio * 
context.getCurrentMinimumCapacityEntry(
+    double minimumCapacity = context.getCurrentMinimumCapacityEntry(

Review Comment:
   check: is this still needed?



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AutoCreatedLeafQueue.java:
##########
@@ -85,7 +85,6 @@ public void 
reinitializeFromTemplate(AutoCreatedLeafQueueConfig leafQueueTemplat
 
       //reset capacities for the leaf queue
       mergeCapacities(capacities, leafQueueTemplate.getResourceQuotas());
-

Review Comment:
   remove



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java:
##########
@@ -194,9 +198,12 @@ public void testAMResourceLimit() throws Exception {
     Resource clusterResource = Resource.newInstance(80 * GB, 40);
     root.updateClusterResource(clusterResource, new ResourceLimits(
         clusterResource));
+    queue = (LeafQueue) root.getChildQueues().stream().filter(

Review Comment:
   no need for this



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractLeafQueue.java:
##########
@@ -1945,8 +1949,12 @@ private void updateCurrentResourceLimits(
   public void refreshAfterResourceCalculation(Resource clusterResource,
       ResourceLimits resourceLimits) {
     lastClusterResource = clusterResource;
+
     // Update maximum applications for the queue and for users
-    updateMaximumApplications();
+    
updateMaximumApplications(queueContext.getConfiguration().isLegacyQueueMode() ||

Review Comment:
   NIT: refreshAfterResourceCalculation is only called from non Legacy



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservationQueue.java:
##########
@@ -53,6 +56,7 @@ public class TestReservationQueue {
       new DefaultResourceCalculator();
   private ReservationQueue autoCreatedLeafQueue;
   private PlanQueue planQueue;
+  private Resource clusterResource = Resources.createResource(100 * 16 * GB, 
100 * 32);

Review Comment:
   final



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservationQueue.java:
##########
@@ -65,6 +69,12 @@ public void setup() throws IOException, 
SchedulerDynamicEditException {
         CapacitySchedulerQueueManager.class);
     ConfiguredNodeLabels labels = new ConfiguredNodeLabels(csConf);
     when(csQm.getConfiguredNodeLabelsForAllQueues()).thenReturn(labels);
+    NullRMNodeLabelsManager mgr = new NullRMNodeLabelsManager();
+    mgr.init(csConf);
+    clusterResource = Resources.createResource(100 * 16 * GB, 100 * 32);

Review Comment:
   it's already set



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbsoluteResourceCapacityCalculator.java:
##########
@@ -59,7 +65,20 @@ public double calculateMaximumResource(
   public void updateCapacitiesAfterCalculation(
       ResourceCalculationDriver resourceCalculationDriver, CSQueue queue, 
String label) {
     CapacitySchedulerQueueCapacityHandler.setQueueCapacities(
-        
resourceCalculationDriver.getUpdateContext().getUpdatedClusterResource(label), 
queue, label);
+        resourceCalculationDriver.getUpdateContext()
+            .getUpdatedClusterResource(label), queue, label);
+
+    if (queue.getParent() != null) {

Review Comment:
   check: is this still needed?



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