hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wan...@apache.org
Subject [2/3] hadoop git commit: YARN-7760. [UI2] Clicking 'Master Node' or link next to 'AM Node Web UI' under application's appAttempt page goes to OLD RM UI. (Vasudevan Skm / Sunil G via wangda)
Date Fri, 26 Jan 2018 08:11:06 GMT
YARN-7760. [UI2] Clicking 'Master Node' or link next to 'AM Node Web UI' under application's
appAttempt page goes to OLD RM UI. (Vasudevan Skm / Sunil G via wangda)

Change-Id: Ia7e2b955d3551ca43c6852fe253fd01983b56565


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

Branch: refs/heads/trunk
Commit: 75618c0dec9199387fb55c8b4d63ac0003ddc1fe
Parents: e0cfb0a
Author: Wangda Tan <wangda@apache.org>
Authored: Fri Jan 26 15:44:55 2018 +0800
Committer: Wangda Tan <wangda@apache.org>
Committed: Fri Jan 26 15:44:55 2018 +0800

----------------------------------------------------------------------
 .../resourcemanager/webapp/dao/AppInfo.java     | 11 +++
 .../webapp/TestRMWebServicesApps.java           |  2 +-
 .../src/main/webapp/app/models/yarn-app.js      | 96 ++++++++++++--------
 .../src/main/webapp/app/serializers/yarn-app.js |  1 +
 .../src/main/webapp/app/templates/yarn-app.hbs  |  2 +-
 5 files changed, 70 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/75618c0d/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
----------------------------------------------------------------------
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 0711b45..631c908 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 class AppInfo {
       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 class AppInfo {
                 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 class AppInfo {
   public void setName(String name) {
     this.name = name;
   }
+
+  public String getMasterNodeId() {
+    return masterNodeId;
+  }
+
+  public void setMasterNodeId(String masterNodeId) {
+    this.masterNodeId = masterNodeId;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/75618c0d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.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/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 f0704ac..a381ed4 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 class TestRMWebServicesApps extends JerseyTestBase {
   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()

http://git-wip-us.apache.org/repos/asf/hadoop/blob/75618c0d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js
----------------------------------------------------------------------
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 b9897be..7e3050f 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");

http://git-wip-us.apache.org/repos/asf/hadoop/blob/75618c0d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js
----------------------------------------------------------------------
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 42d31ca..bd9e984 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,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/75618c0d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
----------------------------------------------------------------------
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 ca93428..992b979 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 @@
         <div class="flex-right">
           <div class="links">
             <a href="{{model.app.amContainerLogs}}" target="_blank">Master Container
Log</a> &nbsp;|&nbsp;
-            <a href="{{amHostHttpAddressFormatted}}" target="_blank">Master Node</a>
 &nbsp;|&nbsp;
+            <a href="{{model.app.masterNodeURL}}">Master Node</a> &nbsp;|&nbsp;
             {{#if isRunningService}}
               <div class="btn-group">
                 <button type="button" class="btn btn-unstyled dropdown-toggle" title="Settings"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">


---------------------------------------------------------------------
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