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


##########
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:
   We are doing this operation a lot, we should have some function to generate 
the String.



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