hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From may...@apache.org
Subject git commit: YARN-2598 GHS should show N/A instead of null for the inaccessible information (Zhijie Shen via mayank)
Date Thu, 09 Oct 2014 18:40:31 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.6 ad7baad21 -> cf0ad82c5


YARN-2598 GHS should show N/A instead of null for the inaccessible information (Zhijie Shen
via mayank)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/cf0ad82c
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/cf0ad82c
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/cf0ad82c

Branch: refs/heads/branch-2.6
Commit: cf0ad82c5a2968066c29dba821122abf3488b320
Parents: ad7baad
Author: Mayank Bansal <mayank@apache.org>
Authored: Thu Oct 9 11:35:32 2014 -0700
Committer: Mayank Bansal <mayank@apache.org>
Committed: Thu Oct 9 11:39:25 2014 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                 |  3 +++
 ...pplicationHistoryManagerOnTimelineStore.java | 20 +++++++++++++++++
 ...pplicationHistoryManagerOnTimelineStore.java | 23 +++++++++++---------
 3 files changed, 36 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/cf0ad82c/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 597046d..cddeba2 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -539,6 +539,9 @@ Release 2.6.0 - UNRELEASED
 
     YARN-2652 Add hadoop-yarn-registry package under hadoop-yarn. (stevel)
 
+    YARN-2598 GHS should show N/A instead of null for the inaccessible information
+    (Zhijie Shen via mayank)
+
 Release 2.5.1 - 2014-09-05
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/cf0ad82c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java
index 5381bd6..e1a4d1b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java
@@ -59,10 +59,15 @@ import org.apache.hadoop.yarn.server.timeline.TimelineReader.Field;
 import org.apache.hadoop.yarn.util.ConverterUtils;
 import org.apache.hadoop.yarn.webapp.util.WebAppUtils;
 
+import com.google.common.annotations.VisibleForTesting;
+
 public class ApplicationHistoryManagerOnTimelineStore extends AbstractService
     implements
     ApplicationHistoryManager {
 
+  @VisibleForTesting
+  static final String UNAVAILABLE = "N/A";
+
   private TimelineDataManager timelineDataManager;
   private ApplicationACLsManager aclsManager;
   private String serverHttpAddress;
@@ -508,6 +513,21 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService
       app.appReport.setCurrentApplicationAttemptId(
           ApplicationAttemptId.newInstance(app.appReport.getApplicationId(), -1));
     }
+    if (app.appReport.getHost() == null) {
+      app.appReport.setHost(UNAVAILABLE);
+    }
+    if (app.appReport.getRpcPort() < 0) {
+      app.appReport.setRpcPort(-1);
+    }
+    if (app.appReport.getTrackingUrl() == null) {
+      app.appReport.setTrackingUrl(UNAVAILABLE);
+    }
+    if (app.appReport.getOriginalTrackingUrl() == null) {
+      app.appReport.setOriginalTrackingUrl(UNAVAILABLE);
+    }
+    if (app.appReport.getDiagnostics() == null) {
+      app.appReport.setDiagnostics("");
+    }
     return app;
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/cf0ad82c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
index f6c1481..311626e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
@@ -178,16 +178,19 @@ public class TestApplicationHistoryManagerOnTimelineStore {
               callerUGI.getShortUserName().equals("user3")))) {
         Assert.assertEquals(ApplicationAttemptId.newInstance(appId, -1),
             app.getCurrentApplicationAttemptId());
-        Assert.assertEquals(null, app.getHost());
+        Assert.assertEquals(ApplicationHistoryManagerOnTimelineStore.UNAVAILABLE,
+            app.getHost());
         Assert.assertEquals(-1, app.getRpcPort());
-        Assert.assertEquals(null, app.getTrackingUrl());
-        Assert.assertEquals(null, app.getOriginalTrackingUrl());
-        Assert.assertEquals(null, app.getDiagnostics());
+        Assert.assertEquals(ApplicationHistoryManagerOnTimelineStore.UNAVAILABLE,
+            app.getTrackingUrl());
+        Assert.assertEquals(ApplicationHistoryManagerOnTimelineStore.UNAVAILABLE,
+            app.getOriginalTrackingUrl());
+        Assert.assertEquals("", app.getDiagnostics());
       } else {
         Assert.assertEquals(ApplicationAttemptId.newInstance(appId, 1),
             app.getCurrentApplicationAttemptId());
         Assert.assertEquals("test host", app.getHost());
-        Assert.assertEquals(-100, app.getRpcPort());
+        Assert.assertEquals(100, app.getRpcPort());
         Assert.assertEquals("test tracking url", app.getTrackingUrl());
         Assert.assertEquals("test original tracking url",
             app.getOriginalTrackingUrl());
@@ -236,7 +239,7 @@ public class TestApplicationHistoryManagerOnTimelineStore {
     Assert.assertEquals(ContainerId.newInstance(appAttemptId, 1),
         appAttempt.getAMContainerId());
     Assert.assertEquals("test host", appAttempt.getHost());
-    Assert.assertEquals(-100, appAttempt.getRpcPort());
+    Assert.assertEquals(100, appAttempt.getRpcPort());
     Assert.assertEquals("test tracking url", appAttempt.getTrackingUrl());
     Assert.assertEquals("test original tracking url",
         appAttempt.getOriginalTrackingUrl());
@@ -282,7 +285,7 @@ public class TestApplicationHistoryManagerOnTimelineStore {
     Assert.assertEquals(Integer.MAX_VALUE + 2L, container.getFinishTime());
     Assert.assertEquals(Resource.newInstance(-1, -1),
         container.getAllocatedResource());
-    Assert.assertEquals(NodeId.newInstance("test host", -100),
+    Assert.assertEquals(NodeId.newInstance("test host", 100),
         container.getAssignedNode());
     Assert.assertEquals(Priority.UNDEFINED, container.getPriority());
     Assert
@@ -290,7 +293,7 @@ public class TestApplicationHistoryManagerOnTimelineStore {
     Assert.assertEquals(ContainerState.COMPLETE, container.getContainerState());
     Assert.assertEquals(-1, container.getContainerExitStatus());
     Assert.assertEquals("http://0.0.0.0:8188/applicationhistory/logs/" +
-        "test host:-100/container_0_0001_01_000001/"
+        "test host:100/container_0_0001_01_000001/"
         + "container_0_0001_01_000001/user1", container.getLogUrl());
   }
 
@@ -471,7 +474,7 @@ public class TestApplicationHistoryManagerOnTimelineStore {
     eventInfo.put(AppAttemptMetricsConstants.ORIGINAL_TRACKING_URL_EVENT_INFO,
         "test original tracking url");
     eventInfo.put(AppAttemptMetricsConstants.HOST_EVENT_INFO, "test host");
-    eventInfo.put(AppAttemptMetricsConstants.RPC_PORT_EVENT_INFO, -100);
+    eventInfo.put(AppAttemptMetricsConstants.RPC_PORT_EVENT_INFO, 100);
     eventInfo.put(AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO,
         ContainerId.newInstance(appAttemptId, 1));
     tEvent.setEventInfo(eventInfo);
@@ -509,7 +512,7 @@ public class TestApplicationHistoryManagerOnTimelineStore {
     entityInfo.put(ContainerMetricsConstants.ALLOCATED_VCORE_ENTITY_INFO, -1);
     entityInfo.put(ContainerMetricsConstants.ALLOCATED_HOST_ENTITY_INFO,
         "test host");
-    entityInfo.put(ContainerMetricsConstants.ALLOCATED_PORT_ENTITY_INFO, -100);
+    entityInfo.put(ContainerMetricsConstants.ALLOCATED_PORT_ENTITY_INFO, 100);
     entityInfo
         .put(ContainerMetricsConstants.ALLOCATED_PRIORITY_ENTITY_INFO, -1);
     entity.setOtherInfo(entityInfo);


Mime
View raw message