From aa620615d0dc61467a79957b968c95d2d0a880f1 Mon Sep 17 00:00:00 2001 From: Vasu Date: Wed, 8 Nov 2017 16:18:10 +0530 Subject: [PATCH 1/3] Enables facetting on node table --- .../src/main/webapp/app/controllers/yarn-nodes/table.js | 17 ++++++++++++++++- .../src/main/webapp/app/models/yarn-rm-node.js | 2 +- .../src/main/webapp/app/templates/yarn-nodes/table.hbs | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js index 3fae5961f87..30180ddd415 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js @@ -29,6 +29,10 @@ export default Ember.Controller.extend({ sortOrder: Ember.computed.alias('tableDefinition.sortOrder'), pageNum: Ember.computed.alias('tableDefinition.pageNum'), rowCount: Ember.computed.alias('tableDefinition.rowCount'), + tableDefinition: TableDefinition.create({ + enableFaceting: true, + rowCount: 25 + }), columns: function() { var colums = []; colums.push({ @@ -40,6 +44,7 @@ export default Ember.Controller.extend({ id: 'rack', headerTitle: 'Rack', contentPath: 'rack', + facetType: null, minWidth: "100px" }, { id: 'state', @@ -51,12 +56,14 @@ export default Ember.Controller.extend({ id: 'address', headerTitle: 'Node Address', contentPath: 'id', - minWidth: "300px" + minWidth: "300px", + facetType: null, }, { id: 'nodeId', headerTitle: 'Node HTTP Address', contentPath: 'nodeHTTPAddress', cellComponentName: 'em-table-linked-cell', + facetType: null, getCellContent: function(row) { var node_id = row.get("id"), node_addr = row.get("nodeHTTPAddress"), @@ -76,10 +83,12 @@ export default Ember.Controller.extend({ id: 'containers', headerTitle: 'Containers', contentPath: 'numContainers', + facetType: null, }, { id: 'memUsed', headerTitle: 'Mem Used', contentPath: 'usedMemoryBytes', + facetType: null, cellDefinition: { type: "memory" } @@ -87,6 +96,7 @@ export default Ember.Controller.extend({ id: 'memAvail', headerTitle: 'Mem Available', contentPath: 'availMemoryBytes', + facetType: null, cellDefinition: { type: "memory" } @@ -94,22 +104,27 @@ export default Ember.Controller.extend({ id: 'coresUsed', headerTitle: 'VCores Used', contentPath: 'usedVirtualCores', + facetType: null, }, { id: 'coresAvail', headerTitle: 'VCores Available', contentPath: 'availableVirtualCores', + facetType: null, }, { id: 'healthUpdate', headerTitle: 'Last Health Update', contentPath: 'lastHealthUpdate', + facetType: null, }, { id: 'healthReport', headerTitle: 'Health-Report', contentPath: 'healthReport', + facetType: null, }, { id: 'version', headerTitle: 'Version', contentPath: 'version', + facetType: null, observePath: true }); return ColumnDef.make(colums); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js index 20b6f5bd2ef..13210748da0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js @@ -35,7 +35,7 @@ export default DS.Model.extend({ nodeLabelsAsString: function() { var labels = this.get("nodeLabels"); - var labelToReturn = ""; + var labelToReturn = "default"; // Only one label per node supported. if (labels && labels.length > 0) { labelToReturn = labels[0]; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs index 6ebcae21c13..68dabc948c6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs @@ -16,7 +16,7 @@ limitations under the License. --}}
-
+
{{#if model.nodes}} {{em-table columns=columns rows=model.nodes definition=tableDefinition}} {{else}} -- 2.13.5 (Apple Git-94) From 964dc188c6744ad33da0ef8a830c1fb0977994b3 Mon Sep 17 00:00:00 2001 From: Vasu Date: Wed, 8 Nov 2017 16:52:08 +0530 Subject: [PATCH 2/3] Reorg Nodes page --- .../webapp/app/controllers/yarn-nodes-managers.js | 36 +++++++++++++ .../hadoop-yarn-ui/src/main/webapp/app/router.js | 1 + .../app/templates/components/nodes-heatmap.hbs | 16 +++--- .../src/main/webapp/app/templates/yarn-nodes.hbs | 59 +++++++--------------- .../webapp/app/templates/yarn-nodes/heatmap.hbs | 10 ++-- .../webapp/app/templates/yarn-nodes/managers.hbs | 35 +++++++++++++ .../main/webapp/app/templates/yarn-nodes/table.hbs | 2 +- 7 files changed, 102 insertions(+), 57 deletions(-) create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-managers.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/managers.hbs diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-managers.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-managers.js new file mode 100644 index 00000000000..8618408223b --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-managers.js @@ -0,0 +1,36 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export default Ember.Controller.extend({ + needReload: true, + selectedQueue: undefined, + + breadcrumbs: [{ + text: "Home", + routeName: 'application' + }, { + text: "Nodes", + routeName: 'yarn-nodes.table', + }, { + text: "Node managers", + routeName: 'yarn-nodes-managers', + }] + +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js index c7b3d6a6f91..a51351fc2b6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js @@ -31,6 +31,7 @@ Router.map(function() { this.route('yarn-nodes', function(){ this.route('table'); this.route('heatmap'); + this.route('managers'); }); this.route('yarn-queue', {path: '/yarn-queue/:queue_name'}, function() { this.route('info'); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs index e7c89d6b0aa..f68bba6b8bc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs @@ -16,15 +16,13 @@ * limitations under the License. }} -
-
-
- -
-
- -
+
+
+ +
+
+

\ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs index 79d9efa20e7..f9bddc89d16 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs @@ -15,56 +15,35 @@ See the License for the specific language governing permissions and limitations under the License. --}} - {{breadcrumb-bar breadcrumbs=breadcrumbs}} -

-
+
-

Nodes

-
-
-
-
-
- -
- {{#if model.clusterMetrics}} -
-
-
-
- Node Managers -
-
- {{donut-chart data=model.clusterMetrics.firstObject.getNodesDataForDonutChart - showLabels=true - parentId="nodes-donut-chart" - ratio=0.6 - maxHeight=350 - colorTargets="good error warn"}} -
-
- {{/if}} - - {{outlet}} +
+ {{outlet}} +
+
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/heatmap.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/heatmap.hbs index 0ebe7ba55cd..1421c824b5a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/heatmap.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/heatmap.hbs @@ -15,14 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --}} - {{#if model.nodes}} - -
-
- {{nodes-heatmap model=model.nodes parentId="nodes-heatmap-chart" - title="Node Heatmap Chart (Usage of "}} -
+
+ {{nodes-heatmap model=model.nodes parentId="nodes-heatmap-chart" + title="Node Heatmap Chart (Usage of "}}
{{/if}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/managers.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/managers.hbs new file mode 100644 index 00000000000..a941f774248 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/managers.hbs @@ -0,0 +1,35 @@ +{{!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--}} + +{{#if model.clusterMetrics}} +
+
+
+
+ Node Managers +
+
+ {{donut-chart data=model.clusterMetrics.firstObject.getNodesDataForDonutChart showLabels=true parentId="nodes-donut-chart" + ratio=0.6 maxHeight=350 colorTargets="good error warn"}} +
+
+
+
+{{/if}} + +{{outlet}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs index 68dabc948c6..11757f06241 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. --}} -
+
{{#if model.nodes}} {{em-table columns=columns rows=model.nodes definition=tableDefinition}} -- 2.13.5 (Apple Git-94) From 775b0b8aff8e5960fef6ebdf8014eb2fe573cfa6 Mon Sep 17 00:00:00 2001 From: Vasu Date: Tue, 14 Nov 2017 13:10:37 +0530 Subject: [PATCH 3/3] Fix review comments --- .../app/controllers/{yarn-nodes-managers.js => yarn-nodes-status.js} | 4 ++-- .../hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js | 2 +- .../hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs | 4 ++-- .../main/webapp/app/templates/yarn-nodes/{managers.hbs => status.hbs} | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/{yarn-nodes-managers.js => yarn-nodes-status.js} (94%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/{managers.hbs => status.hbs} (100%) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-managers.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-status.js similarity index 94% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-managers.js rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-status.js index 8618408223b..b007cf48938 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-managers.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-status.js @@ -29,8 +29,8 @@ export default Ember.Controller.extend({ text: "Nodes", routeName: 'yarn-nodes.table', }, { - text: "Node managers", - routeName: 'yarn-nodes-managers', + text: "Node status", + routeName: 'yarn-nodes-status', }] }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js index a51351fc2b6..64e9ad2b381 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js @@ -31,7 +31,7 @@ Router.map(function() { this.route('yarn-nodes', function(){ this.route('table'); this.route('heatmap'); - this.route('managers'); + this.route('status'); }); this.route('yarn-queue', {path: '/yarn-queue/:queue_name'}, function() { this.route('info'); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs index f9bddc89d16..c850386b681 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs @@ -28,8 +28,8 @@ {{/link-to}} {{/link-to}} - {{#link-to 'yarn-nodes.managers' tagName="li"}} - {{#link-to 'yarn-nodes.managers'}}Node Managers + {{#link-to 'yarn-nodes.status' tagName="li"}} + {{#link-to 'yarn-nodes.status'}}Node Status {{/link-to}} {{/link-to}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/managers.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/status.hbs similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/managers.hbs rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/status.hbs -- 2.13.5 (Apple Git-94)