MAPREDUCE-3140. Fixed the invalid JobHistory URL for failed applications. Contributed by Subroto Sanyal.

svn merge -c r1182216 --ignore-ancestry ../../trunk/


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1182218 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2011-10-12 06:25:03 +00:00
parent 76fb42f94d
commit b8a90a2853
4 changed files with 15 additions and 12 deletions

View File

@ -1548,6 +1548,9 @@ Release 0.23.0 - Unreleased
MAPREDUCE-3126. Fixed a corner case in CapacityScheduler where headroom MAPREDUCE-3126. Fixed a corner case in CapacityScheduler where headroom
wasn't updated on changes to cluster size. (acmurthy) wasn't updated on changes to cluster size. (acmurthy)
MAPREDUCE-3140. Fixed the invalid JobHistory URL for failed
applications. (Subroto Sanyal via vinodkv)
Release 0.22.0 - Unreleased Release 0.22.0 - Unreleased
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -23,7 +23,6 @@ import static org.apache.hadoop.yarn.webapp.view.JQueryUI._PROGRESSBAR;
import static org.apache.hadoop.yarn.webapp.view.JQueryUI._PROGRESSBAR_VALUE; import static org.apache.hadoop.yarn.webapp.view.JQueryUI._PROGRESSBAR_VALUE;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState;
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet; import org.apache.hadoop.yarn.webapp.hamlet.Hamlet;
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE;
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TBODY; import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TBODY;
@ -59,7 +58,8 @@ class AppsBlock extends HtmlBlock {
for (RMApp app : list.apps.values()) { for (RMApp app : list.apps.values()) {
String appId = app.getApplicationId().toString(); String appId = app.getApplicationId().toString();
String trackingUrl = app.getTrackingUrl(); String trackingUrl = app.getTrackingUrl();
String ui = trackingUrl == null || trackingUrl.isEmpty() ? "UNASSIGNED" : boolean trackingUrlIsNotReady = trackingUrl == null || trackingUrl.isEmpty() || "N/A".equalsIgnoreCase(trackingUrl);
String ui = trackingUrlIsNotReady ? "UNASSIGNED" :
(app.getFinishTime() == 0 ? (app.getFinishTime() == 0 ?
"ApplicationMaster" : "History"); "ApplicationMaster" : "History");
String percent = String.format("%.1f", app.getProgress() * 100); String percent = String.format("%.1f", app.getProgress() * 100);
@ -80,7 +80,7 @@ class AppsBlock extends HtmlBlock {
div(_PROGRESSBAR_VALUE). div(_PROGRESSBAR_VALUE).
$style(join("width:", percent, '%'))._()._()._(). $style(join("width:", percent, '%'))._()._()._().
td(). td().
a(trackingUrl == null || trackingUrl.isEmpty() || "N/A".equalsIgnoreCase(trackingUrl) ? a(trackingUrlIsNotReady ?
"#" : join("http://", trackingUrl), ui)._(). "#" : join("http://", trackingUrl), ui)._().
td(app.getDiagnostics().toString())._(); td(app.getDiagnostics().toString())._();
if (list.rendering != Render.HTML && ++i >= 20) break; if (list.rendering != Render.HTML && ++i >= 20) break;

View File

@ -31,7 +31,6 @@ import java.util.concurrent.ConcurrentMap;
import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.server.resourcemanager.RMContext; import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
import org.apache.hadoop.yarn.util.Apps;
import org.apache.hadoop.yarn.webapp.Controller.RequestContext; import org.apache.hadoop.yarn.webapp.Controller.RequestContext;
import org.apache.hadoop.yarn.webapp.ToJSON; import org.apache.hadoop.yarn.webapp.ToJSON;
import org.apache.hadoop.yarn.webapp.view.JQueryUI.Render; import org.apache.hadoop.yarn.webapp.view.JQueryUI.Render;
@ -62,8 +61,9 @@ class AppsList implements ToJSON {
} }
String appID = app.getApplicationId().toString(); String appID = app.getApplicationId().toString();
String trackingUrl = app.getTrackingUrl(); String trackingUrl = app.getTrackingUrl();
String ui = trackingUrl == null || trackingUrl.isEmpty() || "N/A".equalsIgnoreCase(trackingUrl) ? boolean trackingUrlIsNotReady = trackingUrl == null || trackingUrl.isEmpty() || "N/A".equalsIgnoreCase(trackingUrl);
"UNASSIGNED" : (app.getFinishTime() == 0 ? "ApplicationMaster" : "JobHistory"); String ui = trackingUrlIsNotReady ?
"UNASSIGNED" : (app.getFinishTime() == 0 ? "ApplicationMaster" : "History");
out.append("[\""); out.append("[\"");
appendSortable(out, app.getApplicationId().getId()); appendSortable(out, app.getApplicationId().getId());
appendLink(out, appID, rc.prefix(), "app", appID).append(_SEP). appendLink(out, appID, rc.prefix(), "app", appID).append(_SEP).
@ -73,7 +73,7 @@ class AppsList implements ToJSON {
append(app.getState().toString()).append(_SEP); append(app.getState().toString()).append(_SEP);
appendProgressBar(out, app.getProgress()).append(_SEP); appendProgressBar(out, app.getProgress()).append(_SEP);
appendLink(out, ui, rc.prefix(), appendLink(out, ui, rc.prefix(),
trackingUrl == null || trackingUrl.isEmpty() || "N/A".equalsIgnoreCase(trackingUrl) ? trackingUrlIsNotReady ?
"#" : "http://", trackingUrl). "#" : "http://", trackingUrl).
append(_SEP).append(escapeJavaScript(escapeHtml( append(_SEP).append(escapeJavaScript(escapeHtml(
app.getDiagnostics().toString()))). app.getDiagnostics().toString()))).

View File

@ -30,7 +30,6 @@ import org.apache.hadoop.yarn.api.records.Container;
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;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
import org.apache.hadoop.yarn.util.Apps; import org.apache.hadoop.yarn.util.Apps;
@ -73,8 +72,9 @@ public class RmController extends Controller {
} }
setTitle(join("Application ", aid)); setTitle(join("Application ", aid));
String trackingUrl = app.getTrackingUrl(); String trackingUrl = app.getTrackingUrl();
String ui = trackingUrl == null ? "UNASSIGNED" : boolean trackingUrlIsNotReady = trackingUrl == null || trackingUrl.isEmpty() || "N/A".equalsIgnoreCase(trackingUrl);
(app.getFinishTime() == 0 ? "ApplicationMaster" : "JobHistory"); String ui = trackingUrlIsNotReady ? "UNASSIGNED" :
(app.getFinishTime() == 0 ? "ApplicationMaster" : "History");
ResponseInfo info = info("Application Overview"). ResponseInfo info = info("Application Overview").
_("User:", app.getUser()). _("User:", app.getUser()).
@ -84,8 +84,8 @@ public class RmController extends Controller {
_("Started:", Times.format(app.getStartTime())). _("Started:", Times.format(app.getStartTime())).
_("Elapsed:", StringUtils.formatTime( _("Elapsed:", StringUtils.formatTime(
Times.elapsed(app.getStartTime(), app.getFinishTime()))). Times.elapsed(app.getStartTime(), app.getFinishTime()))).
_("Tracking URL:", trackingUrl == null ? "#" : _("Tracking URL:", trackingUrlIsNotReady ?
join("http://", trackingUrl), ui). "#" : join("http://", trackingUrl), ui).
_("Diagnostics:", app.getDiagnostics()); _("Diagnostics:", app.getDiagnostics());
Container masterContainer = app.getCurrentAppAttempt() Container masterContainer = app.getCurrentAppAttempt()
.getMasterContainer(); .getMasterContainer();