YARN-3230. Clarify application states on the web UI. (Jian He via wangda)
(cherry picked from commit ce5bf927c3
)
This commit is contained in:
parent
4a87a61fe9
commit
a1963968d2
|
@ -274,6 +274,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
|
||||
|
|
|
@ -32,8 +32,10 @@ import org.apache.hadoop.security.UserGroupInformation;
|
|||
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 @@ public class AppBlock extends HtmlBlock {
|
|||
._("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 @@ public class AppBlock extends HtmlBlock {
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import java.util.concurrent.ConcurrentMap;
|
|||
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("<br title='").append(percent)
|
||||
.append("'> <div class='").append(C_PROGRESSBAR).append("' title='")
|
||||
|
|
|
@ -200,8 +200,8 @@ public class AppInfo {
|
|||
return this.name;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return this.state.toString();
|
||||
public YarnApplicationState getState() {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public float getProgress() {
|
||||
|
@ -216,8 +216,8 @@ public class AppInfo {
|
|||
return this.diagnostics;
|
||||
}
|
||||
|
||||
public String getFinalStatus() {
|
||||
return this.finalStatus.toString();
|
||||
public FinalApplicationStatus getFinalStatus() {
|
||||
return this.finalStatus;
|
||||
}
|
||||
|
||||
public String getTrackingUrl() {
|
||||
|
|
Loading…
Reference in New Issue