You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/04/12 09:30:36 UTC

[GitHub] [hadoop] zhangxiping1 commented on a diff in pull request #4150: YARN-11107:When NodeLabel is enabled for a YARN cluster, AM blacklist…

zhangxiping1 commented on code in PR #4150:
URL: https://github.com/apache/hadoop/pull/4150#discussion_r848208717


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/DefaultAMSProcessor.java:
##########
@@ -351,7 +351,19 @@ public void allocate(ApplicationAttemptId appAttemptId,
         ((AbstractYarnScheduler)getScheduler())
             .getApplicationAttempt(appAttemptId).pullUpdateContainerErrors());
 
-    response.setNumClusterNodes(getScheduler().getNumClusterNodes());
+    String label="";
+    try {
+      label = rmContext.getScheduler()
+          .getQueueInfo(app.getQueue(), false, false)
+          .getDefaultNodeLabelExpression();
+    } catch (Exception e){
+    }

Review Comment:
   Reference the SchedulerUtils. NormalizeAndValidateRequest fuction
   `
   try {
           queueInfo = rmContext.getScheduler().getQueueInfo(queueName, false,
               false);
         } catch (IOException e) {
           //Queue may not exist since it could be auto-created in case of
           // dynamic queues
         }
   `
   Should I add comments like this too?



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org