diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index e71da2d182..c028043b37 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -310,6 +310,8 @@ Release 2.7.0 - UNRELEASED
YARN-2799. Cleanup TestLogAggregationService based on the change in YARN-90.
(Zhihai Xu via junping_du)
+ YARN-3230. Clarify application states on the web UI. (Jian He via wangda)
+
OPTIMIZATIONS
YARN-2990. FairScheduler's delay-scheduling always waits for node-local and
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/AppBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppBlock.java
index 1856d7526e..c2b376e830 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppBlock.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppBlock.java
@@ -32,8 +32,10 @@
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.yarn.api.records.ApplicationAccessType;
import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
import org.apache.hadoop.yarn.api.records.QueueACL;
import org.apache.hadoop.yarn.api.records.Resource;
+import org.apache.hadoop.yarn.api.records.YarnApplicationState;
import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
@@ -131,8 +133,9 @@ protected void render(Block html) {
._("Name:", app.getName())
._("Application Type:", app.getApplicationType())
._("Application Tags:", app.getApplicationTags())
- ._("State:", app.getState())
- ._("FinalStatus:", app.getFinalStatus())
+ ._("YarnApplicationState:", clarifyAppState(app.getState()))
+ ._("FinalStatus reported by AM:",
+ clairfyAppFinalStatus(app.getFinalStatus()))
._("Started:", Times.format(app.getStartTime()))
._("Elapsed:",
StringUtils.formatTime(Times.elapsed(app.getStartTime(),
@@ -198,4 +201,30 @@ protected void render(Block html) {
table._();
div._();
}
+
+ private String clarifyAppState(YarnApplicationState state) {
+ String ret = state.toString();
+ switch (state) {
+ case NEW:
+ return ret + ": waiting for application to be initialized";
+ case NEW_SAVING:
+ return ret + ": waiting for application to be persisted in state-store.";
+ case SUBMITTED:
+ return ret + ": waiting for application to be accepted by scheduler.";
+ case ACCEPTED:
+ return ret + ": waiting for AM container to be allocated, launched and"
+ + " register with RM.";
+ case RUNNING:
+ return ret + ": AM has registered with RM and started running.";
+ default:
+ return ret;
+ }
+ }
+
+ private String clairfyAppFinalStatus(FinalApplicationStatus status) {
+ if (status == FinalApplicationStatus.UNDEFINED) {
+ return "Application has not completed yet.";
+ }
+ return status.toString();
+ }
}
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/AppsBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java
index 096a2b6a7d..054a1a7020 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java
@@ -30,6 +30,7 @@
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
@@ -65,7 +66,7 @@ class AppsBlock extends HtmlBlock {
th(".queue", "Queue").
th(".starttime", "StartTime").
th(".finishtime", "FinishTime").
- th(".state", "State").
+ th(".state", "YarnApplicationState").
th(".finalstatus", "FinalStatus").
th(".progress", "Progress").
th(".ui", "Tracking UI")._()._().
@@ -101,7 +102,8 @@ class AppsBlock extends HtmlBlock {
.append(appInfo.getStartTime()).append("\",\"")
.append(appInfo.getFinishTime()).append("\",\"")
.append(appInfo.getState()).append("\",\"")
- .append(appInfo.getFinalStatus()).append("\",\"")
+ .append(appInfo.getFinalStatus() == FinalApplicationStatus.UNDEFINED ?
+ "N/A" : appInfo.getFinalStatus()).append("\",\"")
// Progress bar
.append("