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 2f61f43a25..797aad50b9 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"; } 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 90ecc757da..ea286a057e 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 void appAttemptRegistered(RMAppAttempt appAttempt, 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( 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 f492b839aa..3b503e54a4 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 @@ private static RMAppAttempt createRMAppAttempt( 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"); 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 dec677a6d3..f09f42eb12 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 `${address}`; + return `${address}`; } 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 `${address}`; + return `${address}`; } else { return 'N/A'; } 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 7f3934524e..7482a2fe99 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({ "

ElapsedTime:" + String(this.get("elapsedTime")) + "

"; }.property(), + + masterNodeURL: function() { + var addr = encodeURIComponent(this.get("nodeHttpAddress")); + return `#/yarn-node/${this.get("nodeId")}/${addr}/info/`; + }.property("nodeId", "nodeHttpAddress"), }); 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 dd95765719..9ccf78f912 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"), }); 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 7f3934524e..7482a2fe99 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({ "

ElapsedTime:" + String(this.get("elapsedTime")) + "

"; }.property(), + + masterNodeURL: function() { + var addr = encodeURIComponent(this.get("nodeHttpAddress")); + return `#/yarn-node/${this.get("nodeId")}/${addr}/info/`; + }.property("nodeId", "nodeHttpAddress"), }); 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 8ccff07de1..fc640c52e4 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 } }; 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 0245b207ad..24be33e098 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 } 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 471f9105e9..132297261d 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; 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 3860f1550c..139b7eb9be 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}} NodeManager UI - {{container.nodeHttpAddress}} + {{container.nodeHttpAddress}} {{/if}} {{#if container.logUrl}}