Merge -r 1169972:1169973 from trunk to branch-0.23 to fix MAPREDUCE-2874.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1169974 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Murthy 2011-09-12 23:18:30 +00:00
parent 6bec78654c
commit 6ad35c6378
7 changed files with 8 additions and 9 deletions

View File

@ -1270,6 +1270,9 @@ Release 0.23.0 - Unreleased
MAPREDUCE-2985. Fixed findbugs warnings in ResourceLocalizationService. MAPREDUCE-2985. Fixed findbugs warnings in ResourceLocalizationService.
(Thomas Graves via acmurthy) (Thomas Graves via acmurthy)
MAPREDUCE-2874. Fix formatting of ApplicationId in web-ui. (Eric Payne via
acmurthy)
Release 0.22.0 - Unreleased Release 0.22.0 - Unreleased
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -47,7 +47,7 @@ public class AppController extends Controller implements AMParams {
String title) { String title) {
super(ctx); super(ctx);
this.app = app; this.app = app;
set(APP_ID, Apps.toString(app.context.getApplicationID())); set(APP_ID, app.context.getApplicationID().toString());
set(RM_WEB, YarnConfiguration.getRMWebAppURL(conf)); set(RM_WEB, YarnConfiguration.getRMWebAppURL(conf));
} }

View File

@ -108,7 +108,7 @@ public class TestAMWebApp {
Injector injector = WebAppTests.createMockInjector(AppContext.class, ctx); Injector injector = WebAppTests.createMockInjector(AppContext.class, ctx);
AppController controller = injector.getInstance(AppController.class); AppController controller = injector.getInstance(AppController.class);
controller.index(); controller.index();
assertEquals(Apps.toString(ctx.appID), controller.get(APP_ID,"")); assertEquals(ctx.appID.toString(), controller.get(APP_ID,""));
} }
@Test public void testAppView() { @Test public void testAppView() {

View File

@ -107,7 +107,7 @@ public class TestHSWebApp {
Injector injector = WebAppTests.createMockInjector(AppContext.class, ctx); Injector injector = WebAppTests.createMockInjector(AppContext.class, ctx);
HsController controller = injector.getInstance(HsController.class); HsController controller = injector.getInstance(HsController.class);
controller.index(); controller.index();
assertEquals(Apps.toString(ctx.appID), controller.get(APP_ID,"")); assertEquals(ctx.appID.toString(), controller.get(APP_ID,""));
} }
@Test public void testJobView() { @Test public void testJobView() {

View File

@ -33,10 +33,6 @@ public class Apps {
public static final String APP = "app"; public static final String APP = "app";
public static final String ID = "ID"; public static final String ID = "ID";
public static String toString(ApplicationId id) {
return _join("app", id.getClusterTimestamp(), id.getId());
}
public static ApplicationId toAppID(String aid) { public static ApplicationId toAppID(String aid) {
Iterator<String> it = _split(aid).iterator(); Iterator<String> it = _split(aid).iterator();
return toAppID(APP, aid, it); return toAppID(APP, aid, it);

View File

@ -56,7 +56,7 @@ class AppsBlock extends HtmlBlock {
tbody(); tbody();
int i = 0; int i = 0;
for (RMApp app : list.apps.values()) { for (RMApp app : list.apps.values()) {
String appId = Apps.toString(app.getApplicationId()); String appId = app.getApplicationId().toString();
String trackingUrl = app.getTrackingUrl(); String trackingUrl = app.getTrackingUrl();
String ui = trackingUrl == null || trackingUrl.isEmpty() ? "UNASSIGNED" : String ui = trackingUrl == null || trackingUrl.isEmpty() ? "UNASSIGNED" :
(app.getFinishTime() == 0 ? "ApplicationMaster" : "JobHistory"); (app.getFinishTime() == 0 ? "ApplicationMaster" : "JobHistory");

View File

@ -60,7 +60,7 @@ class AppsList implements ToJSON {
} else { } else {
out.append(",\n"); out.append(",\n");
} }
String appID = Apps.toString(app.getApplicationId()); String appID = app.getApplicationId().toString();
String trackingUrl = app.getTrackingUrl(); String trackingUrl = app.getTrackingUrl();
String ui = trackingUrl == null ? "UNASSIGNED" : String ui = trackingUrl == null ? "UNASSIGNED" :
(app.getFinishTime() == 0 ? "ApplicationMaster" : "JobHistory"); (app.getFinishTime() == 0 ? "ApplicationMaster" : "JobHistory");