diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/dao/AppInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/dao/AppInfo.java index ff4519da388..ac2f8da6aa2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/dao/AppInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/dao/AppInfo.java @@ -61,6 +61,8 @@ public class AppInfo { protected int priority; private long allocatedCpuVcores; private long allocatedMemoryMB; + private long reservedCpuVcores; + private long reservedMemoryMB; protected boolean unmanagedApplication; private String appNodeLabelExpression; private String amNodeLabelExpression; @@ -101,6 +103,10 @@ public class AppInfo { .getUsedResources().getVirtualCores(); allocatedMemoryMB = app.getApplicationResourceUsageReport() .getUsedResources().getMemorySize(); + reservedCpuVcores = app.getApplicationResourceUsageReport() + .getReservedResources().getVirtualCores(); + reservedMemoryMB = app.getApplicationResourceUsageReport() + .getReservedResources().getMemorySize(); } } progress = app.getProgress() * 100; // in percent @@ -160,6 +166,14 @@ public class AppInfo { return allocatedMemoryMB; } + public long getReservedCpuVcores() { + return reservedCpuVcores; + } + + public long getReservedMemoryMB() { + return reservedMemoryMB; + } + public float getProgress() { return progress; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/FairSchedulerAppsBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/FairSchedulerAppsBlock.java index 41b5fe7e4c3..b7a7a9372c8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/FairSchedulerAppsBlock.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/FairSchedulerAppsBlock.java @@ -95,6 +95,8 @@ public class FairSchedulerAppsBlock extends HtmlBlock { th(".runningcontainer", "Running Containers"). th(".allocatedCpu", "Allocated CPU VCores"). th(".allocatedMemory", "Allocated Memory MB"). + th(".reservedCpu", "Reserved CPU VCores"). + th(".reservedMemory", "Reserved Memory MB"). th(".progress", "Progress"). th(".ui", "Tracking UI")._()._(). tbody(); @@ -142,6 +144,10 @@ public class FairSchedulerAppsBlock extends HtmlBlock { .valueOf(appInfo.getAllocatedVCores())).append("\",\"") .append(appInfo.getAllocatedMB() == -1 ? "N/A" : String .valueOf(appInfo.getAllocatedMB())).append("\",\"") + .append(appInfo.getReservedVCores() == -1 ? "N/A" : String + .valueOf(appInfo.getReservedVCores())).append("\",\"") + .append(appInfo.getReservedMB() == -1 ? "N/A" : String + .valueOf(appInfo.getReservedMB())).append("\",\"") // Progress bar .append("