diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java index 0711b457a5..631c908419 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java @@ -92,6 +92,7 @@ public class AppInfo { protected String amContainerLogs; protected String amHostHttpAddress; private String amRPCAddress; + private String masterNodeId; private long allocatedMB; private long allocatedVCores; private long reservedMB; @@ -162,6 +163,7 @@ public AppInfo(ResourceManager rm, RMApp app, Boolean hasAccess, this.name = app.getName().toString(); this.queue = app.getQueue().toString(); this.priority = 0; + this.masterNodeId = ""; if (app.getApplicationPriority() != null) { this.priority = app.getApplicationPriority().getPriority(); @@ -192,6 +194,7 @@ public AppInfo(ResourceManager rm, RMApp app, Boolean hasAccess, schemePrefix + masterContainer.getNodeHttpAddress(), masterContainer.getId().toString(), app.getUser()); this.amHostHttpAddress = masterContainer.getNodeHttpAddress(); + this.masterNodeId = masterContainer.getNodeId().toString(); } this.amRPCAddress = getAmRPCAddressFromRMAppAttempt(attempt); @@ -615,4 +618,12 @@ public void setState(YarnApplicationState state) { public void setName(String name) { this.name = name; } + + public String getMasterNodeId() { + return masterNodeId; + } + + public void setMasterNodeId(String masterNodeId) { + this.masterNodeId = masterNodeId; + } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java index f0704ac99e..a381ed4020 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java @@ -1603,7 +1603,7 @@ public void verifyAppsXML(NodeList nodes, RMApp app, boolean hasResourceReq) public void verifyAppInfo(JSONObject info, RMApp app, boolean hasResourceReqs) throws JSONException, Exception { - int expectedNumberOfElements = 38 + (hasResourceReqs ? 2 : 0); + int expectedNumberOfElements = 39 + (hasResourceReqs ? 2 : 0); String appNodeLabelExpression = null; String amNodeLabelExpression = null; if (app.getApplicationSubmissionContext() diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js index b9897be6e9..7e3050f5f8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js @@ -20,42 +20,43 @@ import Converter from 'yarn-ui/utils/converter'; import DS from 'ember-data'; export default DS.Model.extend({ - appName: DS.attr('string'), - user: DS.attr('string'), - queue: DS.attr('string'), - state: DS.attr('string'), - startTime: DS.attr('string'), - elapsedTime: DS.attr('string'), - finalStatus: DS.attr('string'), - finishedTime: DS.attr('finishedTime'), - progress: DS.attr('number'), - diagnostics: DS.attr('string'), - amContainerLogs: DS.attr('string'), - amHostHttpAddress: DS.attr('string'), - logAggregationStatus: DS.attr('string'), - unmanagedApplication: DS.attr('boolean'), - amNodeLabelExpression: DS.attr('string'), - applicationTags: DS.attr('string'), - applicationType: DS.attr('string'), - priority: DS.attr('string'), - allocatedMB: DS.attr('number'), - allocatedVCores: DS.attr('number'), - runningContainers: DS.attr('number'), - memorySeconds: DS.attr('number'), - vcoreSeconds: DS.attr('number'), - preemptedResourceMB: DS.attr('number'), - preemptedResourceVCores: DS.attr('number'), - numNonAMContainerPreempted: DS.attr('number'), - numAMContainerPreempted: DS.attr('number'), - clusterUsagePercentage: DS.attr('number'), - queueUsagePercentage: DS.attr('number'), - currentAppAttemptId: DS.attr('string'), - remainingTimeoutInSeconds: DS.attr('number'), - applicationExpiryTime: DS.attr('string'), - resourceRequests: DS.attr('array'), + appName: DS.attr("string"), + user: DS.attr("string"), + queue: DS.attr("string"), + state: DS.attr("string"), + startTime: DS.attr("string"), + elapsedTime: DS.attr("string"), + finalStatus: DS.attr("string"), + finishedTime: DS.attr("finishedTime"), + progress: DS.attr("number"), + diagnostics: DS.attr("string"), + amContainerLogs: DS.attr("string"), + amHostHttpAddress: DS.attr("string"), + masterNodeId: DS.attr("string"), + logAggregationStatus: DS.attr("string"), + unmanagedApplication: DS.attr("boolean"), + amNodeLabelExpression: DS.attr("string"), + applicationTags: DS.attr("string"), + applicationType: DS.attr("string"), + priority: DS.attr("string"), + allocatedMB: DS.attr("number"), + allocatedVCores: DS.attr("number"), + runningContainers: DS.attr("number"), + memorySeconds: DS.attr("number"), + vcoreSeconds: DS.attr("number"), + preemptedResourceMB: DS.attr("number"), + preemptedResourceVCores: DS.attr("number"), + numNonAMContainerPreempted: DS.attr("number"), + numAMContainerPreempted: DS.attr("number"), + clusterUsagePercentage: DS.attr("number"), + queueUsagePercentage: DS.attr("number"), + currentAppAttemptId: DS.attr("string"), + remainingTimeoutInSeconds: DS.attr("number"), + applicationExpiryTime: DS.attr("string"), + resourceRequests: DS.attr("array"), isFailed: function() { - return this.get('finalStatus') === "FAILED"; + return this.get("finalStatus") === "FAILED"; }.property("finalStatus"), validatedFinishedTs: function() { @@ -70,27 +71,42 @@ export default DS.Model.extend({ }.property("hasFinishedTime"), formattedElapsedTime: function() { - return Converter.msToElapsedTimeUnit(this.get('elapsedTime')); - }.property('elapsedTime'), + return Converter.msToElapsedTimeUnit(this.get("elapsedTime")); + }.property("elapsedTime"), allocatedResource: function() { - return Converter.resourceToString(this.get("allocatedMB"), this.get("allocatedVCores")); + return Converter.resourceToString( + this.get("allocatedMB"), + this.get("allocatedVCores") + ); }.property("allocatedMB", "allocatedVCores"), preemptedResource: function() { - return Converter.resourceToString(this.get("preemptedResourceMB"), this.get("preemptedResourceVCores")); + return Converter.resourceToString( + this.get("preemptedResourceMB"), + this.get("preemptedResourceVCores") + ); }.property("preemptedResourceMB", "preemptedResourceVCores"), aggregatedResourceUsage: function() { - return Converter.resourceToString(this.get("memorySeconds"), this.get("vcoreSeconds")) + " (× Secs)"; + return ( + Converter.resourceToString( + this.get("memorySeconds"), + this.get("vcoreSeconds") + ) + " (× Secs)" + ); }.property("memorySeconds", "vcoreSeconds"), + masterNodeURL: function() { + return `#/yarn-node/${this.get("masterNodeId")}/${this.get("amHostHttpAddress")}/info/`; + }.property("masterNodeId", "amHostHttpAddress"), + progressStyle: function() { return "width: " + this.get("progress") + "%"; }.property("progress"), runningContainersNumber: function() { - if(this.get("runningContainers") < 0) { + if (this.get("runningContainers") < 0) { return 0; } return this.get("runningContainers"); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js index 42d31caf29..bd9e9842da 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js @@ -51,6 +51,7 @@ export default DS.JSONAPISerializer.extend({ diagnostics: (payload.diagnostics && payload.diagnostics !== 'null')? payload.diagnostics : '', amContainerLogs: payload.amContainerLogs, amHostHttpAddress: payload.amHostHttpAddress, + masterNodeId: payload.masterNodeId, logAggregationStatus: payload.logAggregationStatus, unmanagedApplication: payload.unmanagedApplication, amNodeLabelExpression: payload.amNodeLabelExpression, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs index ca93428a77..992b979b43 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs @@ -65,7 +65,7 @@