YARN-3230. Clarify application states on the web UI. (Jian He via wangda)

This commit is contained in:
Wangda Tan 2015-02-20 10:39:28 -08:00
parent c33ae271c2
commit ce5bf927c3
4 changed files with 41 additions and 8 deletions

View File

@ -310,6 +310,8 @@ Release 2.7.0 - UNRELEASED
YARN-2799. Cleanup TestLogAggregationService based on the change in YARN-90. YARN-2799. Cleanup TestLogAggregationService based on the change in YARN-90.
(Zhihai Xu via junping_du) (Zhihai Xu via junping_du)
YARN-3230. Clarify application states on the web UI. (Jian He via wangda)
OPTIMIZATIONS OPTIMIZATIONS
YARN-2990. FairScheduler's delay-scheduling always waits for node-local and YARN-2990. FairScheduler's delay-scheduling always waits for node-local and

View File

@ -32,8 +32,10 @@
import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.yarn.api.records.ApplicationAccessType; import org.apache.hadoop.yarn.api.records.ApplicationAccessType;
import org.apache.hadoop.yarn.api.records.ApplicationId; 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.QueueACL;
import org.apache.hadoop.yarn.api.records.Resource; 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.RMContext;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager; import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
@ -131,8 +133,9 @@ protected void render(Block html) {
._("Name:", app.getName()) ._("Name:", app.getName())
._("Application Type:", app.getApplicationType()) ._("Application Type:", app.getApplicationType())
._("Application Tags:", app.getApplicationTags()) ._("Application Tags:", app.getApplicationTags())
._("State:", app.getState()) ._("YarnApplicationState:", clarifyAppState(app.getState()))
._("FinalStatus:", app.getFinalStatus()) ._("FinalStatus reported by AM:",
clairfyAppFinalStatus(app.getFinalStatus()))
._("Started:", Times.format(app.getStartTime())) ._("Started:", Times.format(app.getStartTime()))
._("Elapsed:", ._("Elapsed:",
StringUtils.formatTime(Times.elapsed(app.getStartTime(), StringUtils.formatTime(Times.elapsed(app.getStartTime(),
@ -198,4 +201,30 @@ protected void render(Block html) {
table._(); table._();
div._(); 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();
}
} }

View File

@ -30,6 +30,7 @@
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringEscapeUtils;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.api.records.ApplicationId; 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.api.records.YarnApplicationState;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager; import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
@ -65,7 +66,7 @@ class AppsBlock extends HtmlBlock {
th(".queue", "Queue"). th(".queue", "Queue").
th(".starttime", "StartTime"). th(".starttime", "StartTime").
th(".finishtime", "FinishTime"). th(".finishtime", "FinishTime").
th(".state", "State"). th(".state", "YarnApplicationState").
th(".finalstatus", "FinalStatus"). th(".finalstatus", "FinalStatus").
th(".progress", "Progress"). th(".progress", "Progress").
th(".ui", "Tracking UI")._()._(). th(".ui", "Tracking UI")._()._().
@ -101,7 +102,8 @@ class AppsBlock extends HtmlBlock {
.append(appInfo.getStartTime()).append("\",\"") .append(appInfo.getStartTime()).append("\",\"")
.append(appInfo.getFinishTime()).append("\",\"") .append(appInfo.getFinishTime()).append("\",\"")
.append(appInfo.getState()).append("\",\"") .append(appInfo.getState()).append("\",\"")
.append(appInfo.getFinalStatus()).append("\",\"") .append(appInfo.getFinalStatus() == FinalApplicationStatus.UNDEFINED ?
"N/A" : appInfo.getFinalStatus()).append("\",\"")
// Progress bar // Progress bar
.append("<br title='").append(percent) .append("<br title='").append(percent)
.append("'> <div class='").append(C_PROGRESSBAR).append("' title='") .append("'> <div class='").append(C_PROGRESSBAR).append("' title='")

View File

@ -200,8 +200,8 @@ public String getName() {
return this.name; return this.name;
} }
public String getState() { public YarnApplicationState getState() {
return this.state.toString(); return this.state;
} }
public float getProgress() { public float getProgress() {
@ -216,8 +216,8 @@ public String getNote() {
return this.diagnostics; return this.diagnostics;
} }
public String getFinalStatus() { public FinalApplicationStatus getFinalStatus() {
return this.finalStatus.toString(); return this.finalStatus;
} }
public String getTrackingUrl() { public String getTrackingUrl() {