From 6ad35c6378c1171d260273fd32fe5549d2ed07ae Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Mon, 12 Sep 2011 23:18:30 +0000 Subject: [PATCH] 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 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../apache/hadoop/mapreduce/v2/app/webapp/AppController.java | 2 +- .../apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java | 2 +- .../apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java | 2 +- .../src/main/java/org/apache/hadoop/yarn/util/Apps.java | 4 ---- .../hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java | 2 +- .../hadoop/yarn/server/resourcemanager/webapp/AppsList.java | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index d3a15c813c6..48d438e8f61 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1270,6 +1270,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-2985. Fixed findbugs warnings in ResourceLocalizationService. (Thomas Graves via acmurthy) + MAPREDUCE-2874. Fix formatting of ApplicationId in web-ui. (Eric Payne via + acmurthy) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java index 1002d4a0e3d..3c3ba746511 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java @@ -47,7 +47,7 @@ public class AppController extends Controller implements AMParams { String title) { super(ctx); this.app = app; - set(APP_ID, Apps.toString(app.context.getApplicationID())); + set(APP_ID, app.context.getApplicationID().toString()); set(RM_WEB, YarnConfiguration.getRMWebAppURL(conf)); } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java index 474e39d40d5..c5938e8ca12 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java @@ -108,7 +108,7 @@ public class TestAMWebApp { Injector injector = WebAppTests.createMockInjector(AppContext.class, ctx); AppController controller = injector.getInstance(AppController.class); controller.index(); - assertEquals(Apps.toString(ctx.appID), controller.get(APP_ID,"")); + assertEquals(ctx.appID.toString(), controller.get(APP_ID,"")); } @Test public void testAppView() { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java index 736987a4686..8d255495176 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHSWebApp.java @@ -107,7 +107,7 @@ public class TestHSWebApp { Injector injector = WebAppTests.createMockInjector(AppContext.class, ctx); HsController controller = injector.getInstance(HsController.class); controller.index(); - assertEquals(Apps.toString(ctx.appID), controller.get(APP_ID,"")); + assertEquals(ctx.appID.toString(), controller.get(APP_ID,"")); } @Test public void testJobView() { diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/Apps.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/Apps.java index fcb3f956e04..90e181576c9 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/Apps.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/Apps.java @@ -33,10 +33,6 @@ public class Apps { public static final String APP = "app"; 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) { Iterator it = _split(aid).iterator(); return toAppID(APP, aid, it); diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java index cf4d94b1ee8..94649923cb3 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java @@ -56,7 +56,7 @@ class AppsBlock extends HtmlBlock { tbody(); int i = 0; for (RMApp app : list.apps.values()) { - String appId = Apps.toString(app.getApplicationId()); + String appId = app.getApplicationId().toString(); String trackingUrl = app.getTrackingUrl(); String ui = trackingUrl == null || trackingUrl.isEmpty() ? "UNASSIGNED" : (app.getFinishTime() == 0 ? "ApplicationMaster" : "JobHistory"); diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsList.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsList.java index a0dfa783a67..ba6b0ea2314 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsList.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsList.java @@ -60,7 +60,7 @@ class AppsList implements ToJSON { } else { out.append(",\n"); } - String appID = Apps.toString(app.getApplicationId()); + String appID = app.getApplicationId().toString(); String trackingUrl = app.getTrackingUrl(); String ui = trackingUrl == null ? "UNASSIGNED" : (app.getFinishTime() == 0 ? "ApplicationMaster" : "JobHistory");