YARN-8022. ResourceManager UI cluster/app/<app-id> page fails to render. Contributed by Tarun Parimi.
This commit is contained in:
parent
76be6cbf6c
commit
e6de10d0a6
@ -109,8 +109,7 @@ protected void render(Block html) {
|
|||||||
final GetApplicationReportRequest request =
|
final GetApplicationReportRequest request =
|
||||||
GetApplicationReportRequest.newInstance(appID);
|
GetApplicationReportRequest.newInstance(appID);
|
||||||
if (callerUGI == null) {
|
if (callerUGI == null) {
|
||||||
appReport =
|
appReport = getApplicationReport(request);
|
||||||
appBaseProt.getApplicationReport(request).getApplicationReport();
|
|
||||||
} else {
|
} else {
|
||||||
appReport = callerUGI.doAs(
|
appReport = callerUGI.doAs(
|
||||||
new PrivilegedExceptionAction<ApplicationReport> () {
|
new PrivilegedExceptionAction<ApplicationReport> () {
|
||||||
@ -143,14 +142,19 @@ public ApplicationReport run() throws Exception {
|
|||||||
try {
|
try {
|
||||||
final GetApplicationAttemptsRequest request =
|
final GetApplicationAttemptsRequest request =
|
||||||
GetApplicationAttemptsRequest.newInstance(appID);
|
GetApplicationAttemptsRequest.newInstance(appID);
|
||||||
attempts = callerUGI.doAs(
|
if (callerUGI == null) {
|
||||||
|
attempts = getApplicationAttemptsReport(request);
|
||||||
|
} else {
|
||||||
|
attempts = callerUGI.doAs(
|
||||||
new PrivilegedExceptionAction<Collection<
|
new PrivilegedExceptionAction<Collection<
|
||||||
ApplicationAttemptReport>>() {
|
ApplicationAttemptReport>>() {
|
||||||
@Override
|
@Override
|
||||||
public Collection<ApplicationAttemptReport> run() throws Exception {
|
public Collection<ApplicationAttemptReport> run()
|
||||||
|
throws Exception {
|
||||||
return getApplicationAttemptsReport(request);
|
return getApplicationAttemptsReport(request);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String message =
|
String message =
|
||||||
"Failed to read the attempts of the application " + appID + ".";
|
"Failed to read the attempts of the application " + appID + ".";
|
||||||
@ -204,36 +208,55 @@ public Collection<ApplicationAttemptReport> run() throws Exception {
|
|||||||
String schedulerPath = WebAppUtils.getResolvedRMWebAppURLWithScheme(conf) +
|
String schedulerPath = WebAppUtils.getResolvedRMWebAppURLWithScheme(conf) +
|
||||||
"/cluster/scheduler?openQueues=" + app.getQueue();
|
"/cluster/scheduler?openQueues=" + app.getQueue();
|
||||||
|
|
||||||
|
generateOverviewTable(app, schedulerPath, webUiType, appReport);
|
||||||
|
|
||||||
|
createApplicationMetricsTable(html);
|
||||||
|
|
||||||
|
html.__(InfoBlock.class);
|
||||||
|
|
||||||
|
generateApplicationTable(html, callerUGI, attempts);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate overview table for app web page.
|
||||||
|
* @param app app info.
|
||||||
|
* @param schedulerPath schedule path.
|
||||||
|
* @param webUiType web ui type.
|
||||||
|
* @param appReport app report.
|
||||||
|
*/
|
||||||
|
private void generateOverviewTable(AppInfo app, String schedulerPath,
|
||||||
|
String webUiType, ApplicationReport appReport) {
|
||||||
ResponseInfo overviewTable = info("Application Overview")
|
ResponseInfo overviewTable = info("Application Overview")
|
||||||
.__("User:", schedulerPath, app.getUser())
|
.__("User:", schedulerPath, app.getUser())
|
||||||
.__("Name:", app.getName())
|
.__("Name:", app.getName())
|
||||||
.__("Application Type:", app.getType())
|
.__("Application Type:", app.getType())
|
||||||
.__("Application Tags:",
|
.__("Application Tags:",
|
||||||
app.getApplicationTags() == null ? "" : app.getApplicationTags())
|
app.getApplicationTags() == null ? "" : app.getApplicationTags())
|
||||||
.__("Application Priority:", clarifyAppPriority(app.getPriority()))
|
.__("Application Priority:", clarifyAppPriority(app.getPriority()))
|
||||||
.__(
|
.__(
|
||||||
"YarnApplicationState:",
|
"YarnApplicationState:",
|
||||||
app.getAppState() == null ? UNAVAILABLE : clarifyAppState(app
|
app.getAppState() == null ? UNAVAILABLE : clarifyAppState(app
|
||||||
.getAppState()))
|
.getAppState()))
|
||||||
.__("Queue:", schedulerPath, app.getQueue())
|
.__("Queue:", schedulerPath, app.getQueue())
|
||||||
.__("FinalStatus Reported by AM:",
|
.__("FinalStatus Reported by AM:",
|
||||||
clairfyAppFinalStatus(app.getFinalAppStatus()))
|
clairfyAppFinalStatus(app.getFinalAppStatus()))
|
||||||
.__("Started:", Times.format(app.getStartedTime()))
|
.__("Started:", Times.format(app.getStartedTime()))
|
||||||
.__(
|
.__(
|
||||||
"Elapsed:",
|
"Elapsed:",
|
||||||
StringUtils.formatTime(Times.elapsed(app.getStartedTime(),
|
StringUtils.formatTime(Times.elapsed(app.getStartedTime(),
|
||||||
app.getFinishedTime())))
|
app.getFinishedTime())))
|
||||||
.__(
|
.__(
|
||||||
"Tracking URL:",
|
"Tracking URL:",
|
||||||
app.getTrackingUrl() == null
|
app.getTrackingUrl() == null
|
||||||
|| app.getTrackingUrl().equals(UNAVAILABLE) ? null : root_url(app
|
|| app.getTrackingUrl().equals(UNAVAILABLE) ? null : root_url(app
|
||||||
.getTrackingUrl()),
|
.getTrackingUrl()),
|
||||||
app.getTrackingUrl() == null
|
app.getTrackingUrl() == null
|
||||||
|| app.getTrackingUrl().equals(UNAVAILABLE) ? "Unassigned" : app
|
|| app.getTrackingUrl().equals(UNAVAILABLE) ? "Unassigned" : app
|
||||||
.getAppState() == YarnApplicationState.FINISHED
|
.getAppState() == YarnApplicationState.FINISHED
|
||||||
|| app.getAppState() == YarnApplicationState.FAILED
|
|| app.getAppState() == YarnApplicationState.FAILED
|
||||||
|| app.getAppState() == YarnApplicationState.KILLED ? "History"
|
|| app.getAppState() == YarnApplicationState.KILLED ? "History"
|
||||||
: "ApplicationMaster");
|
: "ApplicationMaster");
|
||||||
if (webUiType != null
|
if (webUiType != null
|
||||||
&& webUiType.equals(YarnWebParams.RM_WEB_UI)) {
|
&& webUiType.equals(YarnWebParams.RM_WEB_UI)) {
|
||||||
LogAggregationStatus status = getLogAggregationStatus();
|
LogAggregationStatus status = getLogAggregationStatus();
|
||||||
@ -265,37 +288,6 @@ public Collection<ApplicationAttemptReport> run() throws Exception {
|
|||||||
overviewTable.__("AM container Node Label expression:",
|
overviewTable.__("AM container Node Label expression:",
|
||||||
app.getAmNodeLabelExpression() == null ? "<Not set>"
|
app.getAmNodeLabelExpression() == null ? "<Not set>"
|
||||||
: app.getAmNodeLabelExpression());
|
: app.getAmNodeLabelExpression());
|
||||||
|
|
||||||
try {
|
|
||||||
final GetApplicationAttemptsRequest request =
|
|
||||||
GetApplicationAttemptsRequest.newInstance(appID);
|
|
||||||
if (callerUGI == null) {
|
|
||||||
attempts = appBaseProt.getApplicationAttempts(request)
|
|
||||||
.getApplicationAttemptList();
|
|
||||||
} else {
|
|
||||||
attempts = callerUGI.doAs(
|
|
||||||
new PrivilegedExceptionAction<Collection<ApplicationAttemptReport>> () {
|
|
||||||
@Override
|
|
||||||
public Collection<ApplicationAttemptReport> run() throws Exception {
|
|
||||||
return appBaseProt.getApplicationAttempts(request)
|
|
||||||
.getApplicationAttemptList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
String message =
|
|
||||||
"Failed to read the attempts of the application " + appID + ".";
|
|
||||||
LOG.error(message, e);
|
|
||||||
html.p().__(message).__();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
createApplicationMetricsTable(html);
|
|
||||||
|
|
||||||
html.__(InfoBlock.class);
|
|
||||||
|
|
||||||
generateApplicationTable(html, callerUGI, attempts);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void generateApplicationTable(Block html,
|
protected void generateApplicationTable(Block html,
|
||||||
|
Loading…
Reference in New Issue
Block a user