[ 
https://issues.apache.org/jira/browse/YARN-11484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17780121#comment-17780121
 ] 

ASF GitHub Bot commented on YARN-11484:
---------------------------------------

slfan1989 commented on code in PR #6132:
URL: https://github.com/apache/hadoop/pull/6132#discussion_r1373915334


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/QueueCLI.java:
##########
@@ -174,6 +225,63 @@ private int listChildQueues(String parentQueueName) throws 
IOException, YarnExce
   }
 
   private void printQueueInfo(PrintWriter writer, QueueInfo queueInfo) {
+    String schedulerType = queueInfo.getSchedulerType();
+
+    if (StringUtils.equals("FairScheduler", schedulerType)) {
+      printFairSchedulerQueue(writer, queueInfo);
+    } else {
+      printQueue(writer, queueInfo);
+    }
+  }
+
+  /**
+   * Print Queue information of FairScheduler.
+   *
+   * @param writer PrintWriter.
+   * @param queueInfo Queue Information.
+   */
+  private void printFairSchedulerQueue(PrintWriter writer, QueueInfo 
queueInfo) {
+    if (queueInfo.getSchedulerType() != null) {
+      writer.print("Scheduler Name : ");
+      writer.println(queueInfo.getSchedulerType());
+    }
+    writer.print("Queue Name : ");
+    writer.println(queueInfo.getQueueName());
+    writer.print("\tWeight : ");
+    DecimalFormat df = new DecimalFormat("0.00");
+    writer.println(df.format(queueInfo.getWeight()));
+    writer.print("\tState : ");
+    writer.println(queueInfo.getQueueState());
+    writer.print("\tMinResource : ");
+    writer.println("<memory : " + queueInfo.getMinResourceMemory() +

Review Comment:
   Thanks for your suggestion! I will refactor this part of the code.





> [Federation] Router Supports Yarn Client CLI Cmds.
> --------------------------------------------------
>
>                 Key: YARN-11484
>                 URL: https://issues.apache.org/jira/browse/YARN-11484
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: federation
>            Reporter: Shilun Fan
>            Assignee: Shilun Fan
>            Priority: Major
>              Labels: pull-request-available
>
> This Jira ticket aims to enhance the Router command by adding support for all 
> Yarn Client CLI options.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to