hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rohithsharm...@apache.org
Subject [1/3] hadoop git commit: YARN-8239. [UI2] Clicking on Node Manager UI under AM container info / App Attempt page goes to old RM UI. Contributed by Sunil G.
Date Wed, 09 May 2018 07:03:01 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 809135082 -> cd68c7cc6


YARN-8239. [UI2] Clicking on Node Manager UI under AM container info / App Attempt page goes
to old RM UI. Contributed by Sunil G.


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

Branch: refs/heads/trunk
Commit: eb7b256cc2c74e1b461e45444179584668d34ac6
Parents: 8091350
Author: Rohith Sharma K S <rohithsharmaks@apache.org>
Authored: Wed May 9 12:00:43 2018 +0530
Committer: Rohith Sharma K S <rohithsharmaks@apache.org>
Committed: Wed May 9 12:00:43 2018 +0530

----------------------------------------------------------------------
 .../hadoop/yarn/server/metrics/AppAttemptMetricsConstants.java | 5 +++++
 .../resourcemanager/metrics/TimelineServiceV2Publisher.java    | 4 ++++
 .../metrics/TestSystemMetricsPublisherForV2.java               | 3 +++
 .../src/main/webapp/app/components/timeline-view.js            | 6 ++++--
 .../src/main/webapp/app/models/yarn-container.js               | 6 ++++++
 .../src/main/webapp/app/models/yarn-timeline-appattempt.js     | 4 ++++
 .../src/main/webapp/app/models/yarn-timeline-container.js      | 6 ++++++
 .../src/main/webapp/app/serializers/yarn-container.js          | 1 +
 .../main/webapp/app/serializers/yarn-timeline-appattempt.js    | 6 +++---
 .../src/main/webapp/app/serializers/yarn-timeline-container.js | 3 ++-
 .../main/webapp/app/templates/components/container-table.hbs   | 2 +-
 11 files changed, 39 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/metrics/AppAttemptMetricsConstants.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/metrics/AppAttemptMetricsConstants.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/metrics/AppAttemptMetricsConstants.java
index 2f61f43..797aad5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/metrics/AppAttemptMetricsConstants.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/metrics/AppAttemptMetricsConstants.java
@@ -61,4 +61,9 @@ public class AppAttemptMetricsConstants {
   public static final String STATE_INFO =
       "YARN_APPLICATION_ATTEMPT_STATE";
 
+  public static final String MASTER_NODE_ADDRESS =
+      "YARN_APPLICATION_ATTEMPT_MASTER_NODE_ADDRESS";
+
+  public static final String MASTER_NODE_ID =
+      "YARN_APPLICATION_ATTEMPT_MASTER_NODE_ID";
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
index 90ecc75..ea286a0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
@@ -318,6 +318,10 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher
{
     if (appAttempt.getMasterContainer() != null) {
       entityInfo.put(AppAttemptMetricsConstants.MASTER_CONTAINER_INFO,
           appAttempt.getMasterContainer().getId().toString());
+      entityInfo.put(AppAttemptMetricsConstants.MASTER_NODE_ADDRESS,
+          appAttempt.getMasterContainer().getNodeHttpAddress());
+      entityInfo.put(AppAttemptMetricsConstants.MASTER_NODE_ID,
+          appAttempt.getMasterContainer().getNodeId().toString());
     }
     entity.setInfo(entityInfo);
     entity.setIdPrefix(

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestSystemMetricsPublisherForV2.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestSystemMetricsPublisherForV2.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestSystemMetricsPublisherForV2.java
index f492b83..3b503e5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestSystemMetricsPublisherForV2.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestSystemMetricsPublisherForV2.java
@@ -402,6 +402,9 @@ public class TestSystemMetricsPublisherForV2 {
     Container container = mock(Container.class);
     when(container.getId()).thenReturn(
         ContainerId.newContainerId(appAttemptId, 1));
+    when(container.getNodeId())
+        .thenReturn(NodeId.newInstance("testhost", 8042));
+    when(container.getNodeHttpAddress()).thenReturn("testhost:25050");
     when(appAttempt.getMasterContainer()).thenReturn(container);
     when(appAttempt.getDiagnostics()).thenReturn("test diagnostics info");
     when(appAttempt.getTrackingUrl()).thenReturn("test tracking url");

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
index dec677a..f09f42e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
@@ -382,8 +382,9 @@ export default Ember.Component.extend({
       cellComponentName: 'em-table-html-cell',
       getCellContent: function(row) {
         var address = self.checkHttpProtocol(row.get('nodeHttpAddress'));
+        var link = row.get('masterNodeURL');
         if (address) {
-          return `<a href="${address}" target="_blank">${address}</a>`;
+          return `<a href="${link}">${address}</a>`;
         } else {
           return 'N/A';
         }
@@ -483,8 +484,9 @@ export default Ember.Component.extend({
       cellComponentName: 'em-table-html-cell',
       getCellContent: function(row) {
         var address = self.checkHttpProtocol(row.get('nodeHttpAddress'));
+        var link = row.get('masterNodeURL');
         if (address) {
-          return `<a href="${address}" target="_blank">${address}</a>`;
+          return `<a href="${link}">${address}</a>`;
         } else {
           return 'N/A';
         }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js
index 7f39345..7482a2f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js
@@ -30,6 +30,7 @@ export default DS.Model.extend({
   containerExitStatus: DS.attr('number'),
   containerState: DS.attr('string'),
   nodeHttpAddress: DS.attr('string'),
+  nodeId: DS.attr('string'),
 
   startTs: function() {
     return Converter.dateToTimeStamp(this.get("startedTime"));
@@ -60,4 +61,9 @@ export default DS.Model.extend({
            "</p><p>ElapsedTime:" +
            String(this.get("elapsedTime")) + "</p>";
   }.property(),
+
+  masterNodeURL: function() {
+    var addr = encodeURIComponent(this.get("nodeHttpAddress"));
+    return `#/yarn-node/${this.get("nodeId")}/${addr}/info/`;
+  }.property("nodeId", "nodeHttpAddress"),
 });

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-appattempt.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-appattempt.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-appattempt.js
index dd95765..9ccf78f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-appattempt.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-appattempt.js
@@ -140,4 +140,8 @@ export default DS.Model.extend({
     return this.get("state");
   }.property(),
 
+  masterNodeURL: function() {
+    var addr = encodeURIComponent(this.get("nodeHttpAddress"));
+    return `#/yarn-node/${this.get("nodeId")}/${addr}/info/`;
+  }.property("nodeId", "nodeHttpAddress"),
 });

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js
index 7f39345..7482a2f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js
@@ -30,6 +30,7 @@ export default DS.Model.extend({
   containerExitStatus: DS.attr('number'),
   containerState: DS.attr('string'),
   nodeHttpAddress: DS.attr('string'),
+  nodeId: DS.attr('string'),
 
   startTs: function() {
     return Converter.dateToTimeStamp(this.get("startedTime"));
@@ -60,4 +61,9 @@ export default DS.Model.extend({
            "</p><p>ElapsedTime:" +
            String(this.get("elapsedTime")) + "</p>";
   }.property(),
+
+  masterNodeURL: function() {
+    var addr = encodeURIComponent(this.get("nodeHttpAddress"));
+    return `#/yarn-node/${this.get("nodeId")}/${addr}/info/`;
+  }.property("nodeId", "nodeHttpAddress"),
 });

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js
index 8ccff07..fc640c5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js
@@ -36,6 +36,7 @@ export default DS.JSONAPISerializer.extend({
           logUrl: payload.logUrl,
           containerExitStatus: payload.containerExitStatus,
           containerState: payload.containerState,
+          nodeId : payload.nodeId,
           nodeHttpAddress: payload.nodeHttpAddress
         }
       };

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-appattempt.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-appattempt.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-appattempt.js
index 0245b20..24be33e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-appattempt.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-appattempt.js
@@ -37,10 +37,10 @@ export default DS.JSONAPISerializer.extend({
           finishedTime: Converter.timeStampToDate(finishedTime),
           containerId: payload.info.YARN_APPLICATION_ATTEMPT_MASTER_CONTAINER,
           amContainerId: payload.info.YARN_APPLICATION_ATTEMPT_MASTER_CONTAINER,
-          nodeHttpAddress: '',
-          nodeId: '',
+          nodeHttpAddress: payload.info.YARN_APPLICATION_ATTEMPT_MASTER_NODE_ADDRESS,
+          nodeId: payload.info.YARN_APPLICATION_ATTEMPT_MASTER_NODE_ID,
           hosts: payload.info.YARN_APPLICATION_ATTEMPT_HOST,
-          state: payload.info.YARN_APPLICATION_ATTEMPT_HOST,
+          state: payload.info.YARN_APPLICATION_ATTEMPT_STATE,
           logsLink: '',
           appAttemptId: payload.id
         }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
index 471f910..1322972 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
@@ -40,7 +40,8 @@ export default DS.JSONAPISerializer.extend({
         finishedTime: Converter.timeStampToDate(payload.info.YARN_CONTAINER_FINISHED_TIME),
         nodeHttpAddress: payload.info.YARN_CONTAINER_ALLOCATED_HOST_HTTP_ADDRESS,
         containerExitStatus: payload.info.YARN_CONTAINER_EXIT_STATUS,
-        containerState: payload.info.YARN_CONTAINER_STATE
+        containerState: payload.info.YARN_CONTAINER_STATE,
+        nodeId: payload.info.YARN_CONTAINER_ALLOCATED_HOST + ':' + payload.info.YARN_CONTAINER_ALLOCATED_PORT,
       }
     };
     return fixedPayload;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/eb7b256c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs
index 3860f15..139b7eb 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs
@@ -51,7 +51,7 @@
     {{#if container.nodeHttpAddress}}
     <tr>
       <td>NodeManager UI</td>
-      <td title="{{container.nodeHttpAddress}}"><a href="{{prepend-protocol container.nodeHttpAddress}}"
target="_blank">{{container.nodeHttpAddress}}</a></td>
+      <td title="{{container.nodeHttpAddress}}"><a href="{{container.masterNodeURL}}">{{container.nodeHttpAddress}}</a></td>
     </tr>
     {{/if}}
     {{#if container.logUrl}}


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message