|
@@ -21,15 +21,9 @@ package org.apache.hadoop.yarn.server.webapp;
|
|
|
import static org.apache.hadoop.yarn.util.StringHelper.join;
|
|
|
import static org.apache.hadoop.yarn.webapp.YarnWebParams.APPLICATION_ID;
|
|
|
import static org.apache.hadoop.yarn.webapp.YarnWebParams.WEB_UI_TYPE;
|
|
|
-import static org.apache.hadoop.yarn.webapp.view.JQueryUI._EVEN;
|
|
|
-import static org.apache.hadoop.yarn.webapp.view.JQueryUI._INFO_WRAP;
|
|
|
-import static org.apache.hadoop.yarn.webapp.view.JQueryUI._ODD;
|
|
|
-import static org.apache.hadoop.yarn.webapp.view.JQueryUI._TH;
|
|
|
|
|
|
import java.security.PrivilegedExceptionAction;
|
|
|
import java.util.Collection;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
import org.apache.commons.lang.StringEscapeUtils;
|
|
|
import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
@@ -43,12 +37,9 @@ import org.apache.hadoop.yarn.api.protocolrecords.GetContainerReportRequest;
|
|
|
import org.apache.hadoop.yarn.api.records.ApplicationAttemptReport;
|
|
|
import org.apache.hadoop.yarn.api.records.ApplicationId;
|
|
|
import org.apache.hadoop.yarn.api.records.ApplicationReport;
|
|
|
-import org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport;
|
|
|
import org.apache.hadoop.yarn.api.records.ContainerId;
|
|
|
import org.apache.hadoop.yarn.api.records.ContainerReport;
|
|
|
import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
|
|
|
-import org.apache.hadoop.yarn.api.records.Resource;
|
|
|
-import org.apache.hadoop.yarn.api.records.ResourceRequest;
|
|
|
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
|
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
|
import org.apache.hadoop.yarn.exceptions.ContainerNotFoundException;
|
|
@@ -57,10 +48,8 @@ import org.apache.hadoop.yarn.server.webapp.dao.AppInfo;
|
|
|
import org.apache.hadoop.yarn.server.webapp.dao.ContainerInfo;
|
|
|
import org.apache.hadoop.yarn.util.Apps;
|
|
|
import org.apache.hadoop.yarn.util.Times;
|
|
|
-import org.apache.hadoop.yarn.util.resource.Resources;
|
|
|
import org.apache.hadoop.yarn.webapp.YarnWebParams;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet;
|
|
|
-import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.DIV;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TBODY;
|
|
|
import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
|
|
@@ -73,9 +62,11 @@ public class AppBlock extends HtmlBlock {
|
|
|
private static final Log LOG = LogFactory.getLog(AppBlock.class);
|
|
|
protected ApplicationBaseProtocol appBaseProt;
|
|
|
protected Configuration conf;
|
|
|
+ protected ApplicationId appID = null;
|
|
|
|
|
|
@Inject
|
|
|
- AppBlock(ApplicationBaseProtocol appBaseProt, ViewContext ctx, Configuration conf) {
|
|
|
+ protected AppBlock(ApplicationBaseProtocol appBaseProt, ViewContext ctx,
|
|
|
+ Configuration conf) {
|
|
|
super(ctx);
|
|
|
this.appBaseProt = appBaseProt;
|
|
|
this.conf = conf;
|
|
@@ -90,7 +81,6 @@ public class AppBlock extends HtmlBlock {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- ApplicationId appID = null;
|
|
|
try {
|
|
|
appID = Apps.toAppID(aid);
|
|
|
} catch (Exception e) {
|
|
@@ -217,31 +207,7 @@ public class AppBlock extends HtmlBlock {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- //TODO:YARN-3284
|
|
|
- //The preemption metrics will be exposed from ApplicationReport
|
|
|
- // and ApplicationAttemptReport
|
|
|
- ApplicationResourceUsageReport usageReport =
|
|
|
- appReport.getApplicationResourceUsageReport();
|
|
|
- DIV<Hamlet> pdiv = html.
|
|
|
- _(InfoBlock.class).
|
|
|
- div(_INFO_WRAP);
|
|
|
- info("Application Overview").clear();
|
|
|
- info("Application Metrics")
|
|
|
- ._("Total Resource Preempted:",
|
|
|
- Resources.none()) // TODO: YARN-3284
|
|
|
- ._("Total Number of Non-AM Containers Preempted:",
|
|
|
- String.valueOf(0)) // TODO: YARN-3284
|
|
|
- ._("Total Number of AM Containers Preempted:",
|
|
|
- String.valueOf(0)) // TODO: YARN-3284
|
|
|
- ._("Resource Preempted from Current Attempt:",
|
|
|
- Resources.none()) // TODO: YARN-3284
|
|
|
- ._("Number of Non-AM Containers Preempted from Current Attempt:",
|
|
|
- 0) // TODO: YARN-3284
|
|
|
- ._("Aggregate Resource Allocation:",
|
|
|
- String.format("%d MB-seconds, %d vcore-seconds", usageReport == null
|
|
|
- ? 0 : usageReport.getMemorySeconds(), usageReport == null ? 0
|
|
|
- : usageReport.getVcoreSeconds()));
|
|
|
- pdiv._();
|
|
|
+ createApplicationMetricsTable(html);
|
|
|
|
|
|
html._(InfoBlock.class);
|
|
|
|
|
@@ -352,4 +318,9 @@ public class AppBlock extends HtmlBlock {
|
|
|
}
|
|
|
return status.toString();
|
|
|
}
|
|
|
+
|
|
|
+ // The preemption metrics only need to be shown in RM WebUI
|
|
|
+ protected void createApplicationMetricsTable(Block html) {
|
|
|
+
|
|
|
+ }
|
|
|
}
|