hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject hadoop git commit: YARN-6182. Fix alignment issues and missing information in new YARN UI's Queue page. Contributed by Akhil PB.
Date Thu, 05 Oct 2017 06:05:04 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 592bf2d55 -> f702c9575


YARN-6182. Fix alignment issues and missing information in new YARN UI's Queue page. Contributed
by Akhil PB.


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

Branch: refs/heads/trunk
Commit: f702c9575495e3af99d4b5cae9f73969e1a6dfc2
Parents: 592bf2d
Author: Sunil G <sunilg@apache.org>
Authored: Thu Oct 5 11:34:44 2017 +0530
Committer: Sunil G <sunilg@apache.org>
Committed: Thu Oct 5 11:34:44 2017 +0530

----------------------------------------------------------------------
 .../src/main/webapp/app/components/nodes-heatmap.js         | 1 -
 .../src/main/webapp/app/components/tree-selector.js         | 4 ++--
 .../src/main/webapp/app/controllers/application.js          | 9 ++++++++-
 .../src/main/webapp/app/models/yarn-queue/capacity-queue.js | 8 +++++---
 .../src/main/webapp/app/models/yarn-queue/fair-queue.js     | 8 +++++---
 .../src/main/webapp/app/models/yarn-queue/fifo-queue.js     | 8 +++++---
 .../main/webapp/app/serializers/yarn-queue/fair-queue.js    | 5 +++--
 .../src/main/webapp/app/templates/application.hbs           | 2 +-
 .../components/yarn-queue/capacity-queue-conf-table.hbs     | 4 +++-
 .../components/yarn-queue/fair-queue-conf-table.hbs         | 2 +-
 .../app/templates/components/yarn-queue/fair-queue.hbs      | 2 +-
 .../components/yarn-queue/fifo-queue-conf-table.hbs         | 4 +++-
 .../app/templates/components/yarn-queue/fifo-queue.hbs      | 2 +-
 .../hadoop-yarn-ui/src/main/webapp/app/utils/converter.js   | 6 ++++++
 14 files changed, 44 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/nodes-heatmap.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/nodes-heatmap.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/nodes-heatmap.js
index 84ff59e..1ea655b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/nodes-heatmap.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/nodes-heatmap.js
@@ -258,7 +258,6 @@ export default BaseChartComponent.extend({
   },
 
   didInsertElement: function () {
-    var parentId = this.get("parentId");
     var self = this;
     var optionsData = [this.memoryLabel, this.cpuLabel, this.containersLabel];
     d3.select("#heatmap-select")

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/tree-selector.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/tree-selector.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/tree-selector.js
index 6788582..4a0e6aa 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/tree-selector.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/tree-selector.js
@@ -153,7 +153,7 @@ export default Ember.Component.extend({
       .attr("r", 1e-6)
       .style("fill", function(d) {
         var maxCap = d.queueData.get(this.max);
-        maxCap = maxCap == undefined ? 100 : maxCap;
+        maxCap = maxCap === undefined ? 100 : maxCap;
         var usedCap = d.queueData.get(this.used) / maxCap * 100.0;
         if (usedCap <= 60.0) {
           return "LimeGreen";
@@ -172,7 +172,7 @@ export default Ember.Component.extend({
       .attr("text-anchor", function() { return "middle"; })
       .text(function(d) {
         var maxCap = d.queueData.get(this.max);
-        maxCap = maxCap == undefined ? 100 : maxCap;
+        maxCap = maxCap === undefined ? 100 : maxCap;
         var usedCap = d.queueData.get(this.used) / maxCap * 100.0;
         if (usedCap >= 100.0) {
           return usedCap.toFixed(0) + "%";

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js
index 08ca5a6..986b1fd 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js
@@ -50,6 +50,13 @@ export default Ember.Controller.extend({
     html = html + '><a href="yarn-nodes">Nodes<span class="sr-only">' +
         '(current)</span></a></li>';
     return Ember.String.htmlSafe(html);
+  }.property('currentPath'),
+
+  isQueuesTabActive: function() {
+    var path = this.get('currentPath');
+    if (path === 'yarn-queues') {
+      return true;
+    }
+    return false;
   }.property('currentPath')
 });
-

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/capacity-queue.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/capacity-queue.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/capacity-queue.js
index 1cb07bb..b84a473 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/capacity-queue.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/capacity-queue.js
@@ -17,6 +17,7 @@
  */
 
 import DS from 'ember-data';
+import Converter from 'yarn-ui/utils/converter';
 
 export default DS.Model.extend({
   name: DS.attr('string'),
@@ -46,18 +47,19 @@ export default DS.Model.extend({
   }.property("children"),
 
   capacitiesBarChartData: function() {
+    var floatToFixed = Converter.floatToFixed;
     return [
       {
         label: "Absolute Capacity",
-        value: this.get("name") === "root" ? 100 : this.get("absCapacity")
+        value: this.get("name") === "root" ? 100 : floatToFixed(this.get("absCapacity"))
       },
       {
         label: "Absolute Used",
-        value: this.get("name") === "root" ? this.get("usedCapacity") : this.get("absUsedCapacity")
+        value: this.get("name") === "root" ? floatToFixed(this.get("usedCapacity")) : floatToFixed(this.get("absUsedCapacity"))
       },
       {
         label: "Absolute Max Capacity",
-        value: this.get("name") === "root" ? 100 : this.get("absMaxCapacity")
+        value: this.get("name") === "root" ? 100 : floatToFixed(this.get("absMaxCapacity"))
       }
     ];
   }.property("absCapacity", "usedCapacity", "absMaxCapacity"),

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fair-queue.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fair-queue.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fair-queue.js
index be71362..3f358cf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fair-queue.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fair-queue.js
@@ -17,6 +17,7 @@
  */
 
 import DS from 'ember-data';
+import Converter from 'yarn-ui/utils/converter';
 
 export default DS.Model.extend({
   name: DS.attr('string'),
@@ -48,18 +49,19 @@ export default DS.Model.extend({
   }.property("children"),
 
   capacitiesBarChartData: function() {
+    var floatToFixed = Converter.floatToFixed;
     return [
       {
         label: "Steady Fair Memory",
-        value: this.get("steadyFairResources.memory")
+        value: floatToFixed(this.get("steadyFairResources.memory"))
       },
       {
         label: "Used Memory",
-        value: this.get("usedResources.memory")
+        value: floatToFixed(this.get("usedResources.memory"))
       },
       {
         label: "Maximum Memory",
-        value: this.get("maxResources.memory")
+        value: floatToFixed(this.get("maxResources.memory"))
       }
     ];
   }.property("maxResources.memory", "usedResources.memory", "maxResources.memory"),

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fifo-queue.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fifo-queue.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fifo-queue.js
index 2386dc4..40a8e6c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fifo-queue.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/fifo-queue.js
@@ -17,6 +17,7 @@
  */
 
 import DS from 'ember-data';
+import Converter from 'yarn-ui/utils/converter';
 
 export default DS.Model.extend({
   name: DS.attr('string'),
@@ -33,18 +34,19 @@ export default DS.Model.extend({
   type: DS.attr('string'),
 
   capacitiesBarChartData: function() {
+    var floatToFixed = Converter.floatToFixed;
     return [
       {
         label: "Available Capacity",
-        value: this.get("availNodeCapacity")
+        value: floatToFixed(this.get("availNodeCapacity"))
       },
       {
         label: "Used Capacity",
-        value: this.get("usedNodeCapacity")
+        value: floatToFixed(this.get("usedNodeCapacity"))
       },
       {
         label: "Total Capacity",
-        value: this.get("totalNodeCapacity")
+        value: floatToFixed(this.get("totalNodeCapacity"))
       }
     ];
   }.property("availNodeCapacity", "usedNodeCapacity", "totalNodeCapacity")

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/fair-queue.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/fair-queue.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/fair-queue.js
index 2215d2d..c730e44 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/fair-queue.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/fair-queue.js
@@ -59,8 +59,9 @@ export default DS.JSONAPISerializer.extend({
 
     handleQueue(store, primaryModelClass, payload, id, requestType) {
       var data = [];
-      var includedData = [];
-      if(!payload) return data;
+      if (!payload) {
+        return data;
+      }
       var result = this.normalizeSingleResponse(store, primaryModelClass,
         payload, id, requestType);
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs
index e988e0c..1ac53bf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs
@@ -41,7 +41,7 @@
               <span class="sr-only">(current)</span>
             {{/link-to}}
           {{/link-to}}
-          {{#link-to 'yarn-queues' 'root' tagName="li"}}
+          {{#link-to 'yarn-queues' 'root' tagName="li" classNameBindings="isQueuesTabActive:active"}}
             {{#link-to 'yarn-queues' 'root' class="navigation-link"}}Queues
               <span class="sr-only">(current)</span>
             {{/link-to}}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/capacity-queue-conf-table.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/capacity-queue-conf-table.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/capacity-queue-conf-table.hbs
index 3f6017f..a04a26d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/capacity-queue-conf-table.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/capacity-queue-conf-table.hbs
@@ -20,7 +20,7 @@
   <thead>
     <tr>
       <td><b>Configurations</b></td>
-      <td>Value</td>
+      <td><b>Value</b></td>
     </tr>
   </thead>
   <tbody>
@@ -32,10 +32,12 @@
       <td>Configured Max Capacity</td>
       <td>{{queue.maxCapacity}}</td>
     </tr>
+  {{#if queue.state}}
     <tr>
       <td>State</td>
       <td>{{queue.state}}</td>
     </tr>
+  {{/if}}
   {{#if queue.isLeafQueue}}
     <tr>
       <td>User Limit Percent</td>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue-conf-table.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue-conf-table.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue-conf-table.hbs
index 00fabcc..b2448cf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue-conf-table.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue-conf-table.hbs
@@ -20,7 +20,7 @@
   <thead>
     <tr>
       <td><b>Configurations</b></td>
-      <td>Value</td>
+      <td><b>Value</b></td>
     </tr>
   </thead>
   <tbody>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue.hbs
index 0341108..6d0e994 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fair-queue.hbs
@@ -39,7 +39,7 @@
         {{bar-chart data=model.selectedQueue.capacitiesBarChartData
         title=""
         parentId="capacity-bar-chart"
-        textWidth=150
+        textWidth=175
         ratio=0.55
         maxHeight=350}}
       </div>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue-conf-table.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue-conf-table.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue-conf-table.hbs
index 4ced3e7..f6f467f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue-conf-table.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue-conf-table.hbs
@@ -20,7 +20,7 @@
   <thead>
     <tr>
       <td><b>Configurations</b></td>
-      <td>Value</td>
+      <td><b>Value</b></td>
     </tr>
   </thead>
   <tbody>
@@ -32,10 +32,12 @@
       <td>Used Capacity</td>
       <td>{{queue.usedCapacity}}</td>
     </tr>
+  {{#if queue.state}}
     <tr>
       <td>State</td>
       <td>{{queue.state}}</td>
     </tr>
+  {{/if}}
     <tr>
       <td>Minimum Queue Memory Capacity</td>
       <td>{{queue.minQueueMemoryCapacity}}</td>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue.hbs
index 46d79f0..90cbd27 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue/fifo-queue.hbs
@@ -39,7 +39,7 @@
         {{bar-chart data=model.selectedQueue.capacitiesBarChartData
         title=""
         parentId="capacity-bar-chart"
-        textWidth=150
+        textWidth=175
         ratio=0.55
         maxHeight=350}}
       </div>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f702c957/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js
index 7c9a1f8..b9da222 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/converter.js
@@ -165,5 +165,11 @@ export default {
       unit = "GB";
     }
     return value.toFixed(1) + " " + unit;
+  },
+  floatToFixed: function(value, fixed=2) {
+    if (value && value.toFixed) {
+      return parseFloat(value.toFixed(fixed));
+    }
+    return value;
   }
 };


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