YARN-347. Node CLI should show CPU info besides memory in node status. (Junping Du via llu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1507958 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luke Lu 2013-07-29 07:31:40 +00:00
parent 126337bba6
commit 79fa2c5e79
3 changed files with 15 additions and 5 deletions

View File

@ -241,6 +241,9 @@ Release 2.1.0-beta - 2013-07-02
IMPROVEMENTS IMPROVEMENTS
YARN-347. Node CLI should show CPU info besides memory in node status.
(Junping Du via llu)
YARN-365. Change NM heartbeat handling to not generate a scheduler event YARN-365. Change NM heartbeat handling to not generate a scheduler event
on each heartbeat. (Xuan Gong via sseth) on each heartbeat. (Xuan Gong via sseth)

View File

@ -143,10 +143,15 @@ public class NodeCLI extends YarnCLI {
nodeReportStr.print("\tContainers : "); nodeReportStr.print("\tContainers : ");
nodeReportStr.println(nodeReport.getNumContainers()); nodeReportStr.println(nodeReport.getNumContainers());
nodeReportStr.print("\tMemory-Used : "); nodeReportStr.print("\tMemory-Used : ");
nodeReportStr.println((nodeReport.getUsed() == null) ? "0M" nodeReportStr.println((nodeReport.getUsed() == null) ? "0MB"
: (nodeReport.getUsed().getMemory() + "M")); : (nodeReport.getUsed().getMemory() + "MB"));
nodeReportStr.print("\tMemory-Capacity : "); nodeReportStr.print("\tMemory-Capacity : ");
nodeReportStr.println(nodeReport.getCapability().getMemory()); nodeReportStr.println(nodeReport.getCapability().getMemory() + "MB");
nodeReportStr.print("\tCPU-Used : ");
nodeReportStr.println((nodeReport.getUsed() == null) ? "0 vcores"
: (nodeReport.getUsed().getVirtualCores() + " vcores"));
nodeReportStr.print("\tCPU-Capacity : ");
nodeReportStr.println(nodeReport.getCapability().getVirtualCores() + " vcores");
} }
if (nodeReport == null) { if (nodeReport == null) {

View File

@ -375,8 +375,10 @@ public class TestYarnCLI {
+ DateFormatUtils.format(new Date(0), "E dd/MMM/yy hh:mm:ss:SSzz")); + DateFormatUtils.format(new Date(0), "E dd/MMM/yy hh:mm:ss:SSzz"));
pw.println("\tHealth-Report : "); pw.println("\tHealth-Report : ");
pw.println("\tContainers : 0"); pw.println("\tContainers : 0");
pw.println("\tMemory-Used : 0M"); pw.println("\tMemory-Used : 0MB");
pw.println("\tMemory-Capacity : 0"); pw.println("\tMemory-Capacity : 0MB");
pw.println("\tCPU-Used : 0 vcores");
pw.println("\tCPU-Capacity : 0 vcores");
pw.close(); pw.close();
String nodeStatusStr = baos.toString("UTF-8"); String nodeStatusStr = baos.toString("UTF-8");
verify(sysOut, times(1)).println(isA(String.class)); verify(sysOut, times(1)).println(isA(String.class));