You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by su...@apache.org on 2017/02/28 08:19:34 UTC
hadoop git commit: YARN-5335. Use em-table in app/nodes pages for new
YARN UI. Contributed by Sunil G.
Repository: hadoop
Updated Branches:
refs/heads/trunk f187d6381 -> ef488044d
YARN-5335. Use em-table in app/nodes pages for new YARN UI. Contributed by Sunil G.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ef488044
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ef488044
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ef488044
Branch: refs/heads/trunk
Commit: ef488044d08983e84235e8da1cf3a7fdacadd70d
Parents: f187d63
Author: Sunil G <su...@apache.org>
Authored: Tue Feb 28 13:49:19 2017 +0530
Committer: Sunil G <su...@apache.org>
Committed: Tue Feb 28 13:49:19 2017 +0530
----------------------------------------------------------------------
.../src/main/webapp/app/adapters/yarn-app.js | 4 +-
.../app/components/app-usage-donut-chart.js | 1 -
.../main/webapp/app/components/donut-chart.js | 1 -
.../webapp/app/controllers/app-table-columns.js | 98 +++++++++++++++++
.../webapp/app/controllers/yarn-apps/apps.js | 25 +++++
.../app/controllers/yarn-apps/services.js | 25 +++++
.../main/webapp/app/controllers/yarn-node.js | 3 +-
.../webapp/app/controllers/yarn-nodes/table.js | 109 +++++++++++++++++++
.../webapp/app/controllers/yarn-queue/apps.js | 31 ++++++
.../src/main/webapp/app/models/yarn-rm-node.js | 8 ++
.../src/main/webapp/app/routes/yarn-apps.js | 2 -
.../main/webapp/app/routes/yarn-apps/apps.js | 9 ++
.../webapp/app/routes/yarn-apps/services.js | 11 ++
.../src/main/webapp/app/routes/yarn-queue.js | 4 +-
.../src/main/webapp/app/routes/yarn-queues.js | 3 +-
.../src/main/webapp/app/serializers/yarn-app.js | 3 +-
.../webapp/app/templates/yarn-apps/apps.hbs | 13 ++-
.../webapp/app/templates/yarn-apps/services.hbs | 4 +-
.../webapp/app/templates/yarn-nodes/table.hbs | 42 +------
.../webapp/app/templates/yarn-queue/apps.hbs | 3 +-
.../hadoop-yarn-ui/src/main/webapp/package.json | 9 +-
.../unit/controllers/app-table-columns-test.js | 30 +++++
.../unit/controllers/yarn-apps/apps-test.js | 30 +++++
.../unit/controllers/yarn-apps/services-test.js | 30 +++++
.../unit/controllers/yarn-nodes/table-test.js | 30 +++++
.../unit/controllers/yarn-queue/apps-test.js | 30 +++++
26 files changed, 492 insertions(+), 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app.js
index b34c606..fc52f7c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app.js
@@ -25,9 +25,7 @@ export default AbstractAdapter.extend({
urlForQuery(query/*, modelName*/) {
var url = this._buildURL();
- if (query.state) {
- url = url + '/apps/?state=' + query.state;
- }
+ url = url + '/apps';
return url;
},
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js
index 274c219..c72d934 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js
@@ -36,7 +36,6 @@ export default BaseUsageDonutChart.extend({
value: v.toFixed(2)
});
- console.log(v);
avail = avail - v;
}
}.bind(this));
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/donut-chart.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/donut-chart.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/donut-chart.js
index e5699b4..82d2d46 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/donut-chart.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/donut-chart.js
@@ -54,7 +54,6 @@ export default BaseChartComponent.extend({
// 50 is for title
var outerRadius = (h - 50 - 2 * layout.margin) / 2;
var innerRadius = outerRadius * 0.618;
- console.log("inner:" + innerRadius + " outer:" + outerRadius);
var arc = d3.svg.arc()
.innerRadius(innerRadius)
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js
new file mode 100644
index 0000000..53a6439
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js
@@ -0,0 +1,98 @@
+/**
+ * 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';
+import ColumnDef from 'em-table/utils/column-definition';
+
+export default Ember.Controller.extend({
+ columns: function() {
+ var colums = [];
+ colums.push({
+ id: 'appId',
+ headerTitle: 'Application ID',
+ contentPath: 'id',
+ cellComponentName: 'em-table-linked-cell',
+ getCellContent: function(row) {
+\u2002\u2002 return {
+\u2002\u2002\u2002\u2002 displayText: row.id,
+\u2002\u2002\u2002\u2002 routeName: 'yarn-app',
+\u2002\u2002\u2002\u2002 id: row.id
+ };
+ },
+ minWidth: "250px"
+ }, {
+ id: 'appType',
+ headerTitle: 'Application Type',
+ contentPath: 'applicationType',
+ }, {
+ id: 'appName',
+ headerTitle: 'Application Name',
+ contentPath: 'appName',
+ }, {
+ id: 'appUsr',
+ headerTitle: 'User',
+ contentPath: 'user',
+ minWidth: "50px"
+ }, {
+ id: 'queue',
+ headerTitle: 'Queue',
+ contentPath: 'queue',
+ }, {
+ id: 'state',
+ headerTitle: 'State',
+ contentPath: 'state',
+ cellComponentName: 'em-table-status-cell',
+ minWidth: "50px"
+ }, {
+ id: 'progress',
+ headerTitle: 'Progress',
+ contentPath: 'progress',
+ cellComponentName: 'em-table-progress-cell',
+ cellDefinition: {
+\u2002\u2002\u2002\u2002\u2002\u2002 valueMax: 100
+\u2002\u2002\u2002\u2002 },
+ }, {
+ id: 'stTime',
+ headerTitle: 'Start Time',
+ contentPath: 'startTime',
+ }, {
+ id: 'elTime',
+ headerTitle: 'Elapsed Time',
+ contentPath: 'elapsedTime',
+ cellDefinition: {
+ type: "duration"
+ }
+ }, {
+ id: 'finishTime',
+ headerTitle: 'Finished Time',
+ contentPath: 'validatedFinishedTs',
+ observePath: true
+ }, {
+ id: 'priority',
+ headerTitle: 'Priority',
+ contentPath: 'priority',
+ }, {
+ id: 'cluster',
+ headerTitle: '%Cluster',
+ contentPath: 'clusterUsagePercentage',
+ observePath: true
+ });
+ return ColumnDef.make(colums);
+ }.property()
+});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js
new file mode 100644
index 0000000..5c5063b
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js
@@ -0,0 +1,25 @@
+/**
+ * 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';
+import ColumnDef from 'em-table/utils/column-definition';
+import AppTableController from '../app-table-columns';
+
+export default AppTableController.extend({
+});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/services.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/services.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/services.js
new file mode 100644
index 0000000..5c5063b
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/services.js
@@ -0,0 +1,25 @@
+/**
+ * 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';
+import ColumnDef from 'em-table/utils/column-definition';
+import AppTableController from '../app-table-columns';
+
+export default AppTableController.extend({
+});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-node.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-node.js
index 55d9b3e..335a33c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-node.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-node.js
@@ -20,8 +20,9 @@ import Ember from 'ember';
export default Ember.Controller.extend({
- breadcrumbs: Ember.computed("model.attempt.appId", function () {
+ breadcrumbs: Ember.computed("model.nodeInfo", function () {
var nodeInfo = this.get("model.nodeInfo");
+
return [{
text: "Home",
routeName: 'application'
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..3b7b0f6
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js
@@ -0,0 +1,109 @@
+/**
+ * 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';
+import ColumnDef from 'em-table/utils/column-definition';
+
+export default Ember.Controller.extend({
+ columns: function() {
+ var colums = [];
+ colums.push({
+ id: 'label',
+ headerTitle: 'Node Label',
+ contentPath: 'nodeLabelsAsString',
+ minWidth: "100px"
+ }, {
+ id: 'rack',
+ headerTitle: 'Rack',
+ contentPath: 'rack',
+ minWidth: "100px"
+ }, {
+ id: 'state',
+ headerTitle: 'Node State',
+ contentPath: 'state',
+ cellComponentName: 'em-table-status-cell',
+ minWidth: "100px"
+ }, {
+ id: 'address',
+ headerTitle: 'Node Address',
+ contentPath: 'id',
+ minWidth: "300px"
+ }, {
+ id: 'nodeId',
+ headerTitle: 'Node HTTP Address',
+ contentPath: 'nodeHTTPAddress',
+ cellComponentName: 'em-table-linked-cell',
+ getCellContent: function(row) {
+ var node_id = row.get("id"),
+ node_addr = row.get("nodeHTTPAddress"),
+ href = `#/yarn-node/${node_id}/${node_addr}`;
+ switch(row.get("nodeState")) {
+ case "SHUTDOWN":
+ case "LOST":
+ href = "";
+ }
+\u2002\u2002 return {
+ text: row.get("nodeHTTPAddress"),
+ href: href
+ };
+ },
+ minWidth: "250px"
+ }, {
+ id: 'containers',
+ headerTitle: 'Containers',
+ contentPath: 'numContainers',
+ }, {
+ id: 'memUsed',
+ headerTitle: 'Mem Used',
+ contentPath: 'usedMemoryBytes',
+ cellDefinition: {
+ type: "memory"
+ }
+ }, {
+ id: 'memAvail',
+ headerTitle: 'Mem Available',
+ contentPath: 'availMemoryBytes',
+ cellDefinition: {
+ type: "memory"
+ }
+ }, {
+ id: 'coresUsed',
+ headerTitle: 'VCores Used',
+ contentPath: 'usedVirtualCores',
+ }, {
+ id: 'coresAvail',
+ headerTitle: 'VCores Available',
+ contentPath: 'availableVirtualCores',
+ }, {
+ id: 'healthUpdate',
+ headerTitle: 'Last Health Update',
+ contentPath: 'lastHealthUpdate',
+ }, {
+ id: 'healthReport',
+ headerTitle: 'Health-Report',
+ contentPath: 'healthReport',
+ }, {
+ id: 'version',
+ headerTitle: 'Version',
+ contentPath: 'version',
+ observePath: true
+ });
+ return ColumnDef.make(colums);
+ }.property()
+});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queue/apps.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queue/apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queue/apps.js
new file mode 100644
index 0000000..905d96d
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queue/apps.js
@@ -0,0 +1,31 @@
+/**
+ * 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';
+import TableDefinition from 'em-table/utils/table-definition';
+import AppTableController from '../app-table-columns';
+
+export default AppTableController.extend({
+ // Your custom instance of table definition
+ tableDefinition: TableDefinition.create(),
+
+ // Search text alias, any change in controller's searchText would affect the table's searchText, and vice-versa.
+ _selectedObserver: Ember.on("init", Ember.observer("model.selected", function () {
+ this.set("tableDefinition.searchText", this.get("model.selected"));
+ })),
+});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js
----------------------------------------------------------------------
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 c7875b4..461bf00 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
@@ -96,4 +96,12 @@ export default DS.Model.extend({
"<p>Used Memory: " + Math.round(this.get("usedMemoryMB")) + ' MB</p>' +
"<p>Available Memory: " + Math.round(this.get("availMemoryMB")) + ' MB</p>';
}.property(),
+
+ usedMemoryBytes: function() {
+ return this.get("usedMemoryMB") * 1024 * 1024;
+ }.property("usedMemoryMB"),
+
+ availMemoryBytes: function() {
+ return this.get("availMemoryMB") * 1024 * 1024;
+ }.property("availMemoryMB"),
});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js
index 1b671da..56349aa 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js
@@ -23,13 +23,11 @@ import AbstractRoute from './abstract';
export default AbstractRoute.extend({
model() {
return Ember.RSVP.hash({
- apps: this.store.findAll('yarn-app', {reload: true}),
clusterMetrics: this.store.findAll('ClusterMetric', {reload: true}),
});
},
unloadAll() {
- this.store.unloadAll('yarn-app');
this.store.unloadAll('ClusterMetric');
}
});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js
index 8719170..b0f3745 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js
@@ -19,4 +19,13 @@
import Ember from 'ember';
export default Ember.Route.extend({
+ model() {
+ return Ember.RSVP.hash({
+ apps: this.store.findAll('yarn-app', {reload: true}),
+ });
+ },
+
+ unloadAll() {
+ this.store.unloadAll('yarn-app');
+ }
});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js
index 8719170..34ad1ad 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js
@@ -19,4 +19,15 @@
import Ember from 'ember';
export default Ember.Route.extend({
+ model() {
+ return Ember.RSVP.hash({
+ apps: this.store.query('yarn-app', {
+ applicationTypes: "org-apache-slider"
+ }),
+ });
+ },
+
+ unloadAll() {
+ this.store.unloadAll('yarn-app');
+ }
});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js
index faae8b1..1c4546c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js
@@ -26,7 +26,9 @@ export default AbstractRoute.extend({
selected : param.queue_name,
queues: this.store.query('yarn-queue', {}),
selectedQueue : undefined,
- apps: this.store.findAll('yarn-app', {reload: true})
+ apps: this.store.query('yarn-app', {
+ queue: param.queue_name
+ })
});
},
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js
index 7ef7ac3..e4f145d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js
@@ -31,8 +31,7 @@ export default AbstractRoute.extend({
return Ember.RSVP.hash({
selected : queueName,
queues: this.store.query('yarn-queue', {}),
- selectedQueue : undefined,
- apps: this.store.findAll('yarn-app', {reload: true})
+ selectedQueue : undefined
});
},
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/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 83d1e32..172286f 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
@@ -43,7 +43,8 @@ export default DS.JSONAPISerializer.extend({
queue: payload.queue,
state: payload.state,
startTime: Converter.timeStampToDate(payload.startedTime),
- elapsedTime: Converter.msToElapsedTime(payload.elapsedTime),
+ //elapsedTime: Converter.msToElapsedTime(payload.elapsedTime),
+ elapsedTime: payload.elapsedTime,
finishedTime: Converter.timeStampToDate(payload.finishedTime),
finalStatus: payload.finalStatus,
progress: payload.progress,
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs
index a2ba163..8c72ce4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs
@@ -16,9 +16,12 @@
limitations under the License.
--}}
-{{#if model.apps}}
- {{app-table table-id="apps-table" arr=model.apps}}
- {{simple-table table-id="apps-table" bFilter=true colsOrder="0,desc" colTypes="natural elapsed-time" colTargets="0 7"}}
+{{#if model.apps.isPending}}
+ <h4 align="center">Loading...</h4>
{{else}}
- <h4 align="center">Could not find any applications from this cluster</h4>
-{{/if}}
\ No newline at end of file
+ {{#if model.apps}}
+ {{em-table columns=columns rows=model.apps}}
+ {{else}}
+ <h4 align="center">Could not find any applications from this cluster</h4>
+ {{/if}}
+{{/if}}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/services.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/services.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/services.hbs
index e472e8e..7556908 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/services.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/services.hbs
@@ -17,9 +17,7 @@
--}}
{{#if model.apps}}
- {{app-table table-id="apps-table" arr=model.apps}}
- {{simple-table table-id="apps-table" bFilter=true colsOrder="0,desc"
- colTypes="natural elapsed-time" colTargets="0 7" defaultSearch="slider"}}
+ {{em-table columns=columns rows=model.apps}}
{{else}}
<h4 align="center">Could not find any applications from this cluster</h4>
{{/if}}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs
----------------------------------------------------------------------
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 d9fae3a..1390906 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
@@ -18,47 +18,7 @@
<div class="row">
{{#if model.nodes}}
- <table id="nodes-table" class="display table table-striped table-bordered"
- cellspacing="0" width="100%">
- <thead>
- <tr>
- <th>Node Labels</th>
- <th>Rack</th>
- <th>Node State</th>
- <th>Node Address</th>
- <th>Node HTTP Address</th>
- <th>Last Health Update</th>
- <th>Health-Report</th>
- <th>Containers</th>
- <th>Mem Used</th>
- <th>Mem Avail</th>
- <th>VCores Used</th>
- <th>VCores Avail</th>
- <th>Version</th>
- </tr>
- </thead>
- <tbody>
- {{#each model.nodes as |node|}}
- <tr>
- <td>{{node.nodeLabelsAsString}}</td>
- <td>{{node.rack}}</td>
- <td><span class={{node.nodeStateStyle}}>{{node.state}}</span></td>
- <td>{{node.id}}</td>
- {{node-link nodeId=node.id nodeHTTPAddress=node.nodeHTTPAddress nodeState=node.state}}
- <td>{{node.lastHealthUpdate}}</td>
- <td>{{node.healthReport}}</td>
- <td>{{node.numContainers}}</td>
- <td>{{divide num=node.usedMemoryMB den=1024}} GB</td>
- <td>{{divide num=node.availMemoryMB den=1024}} GB</td>
- <td>{{node.usedVirtualCores}}</td>
- <td>{{node.availableVirtualCores}}</td>
- <td>{{node.version}}</td>
- </tr>
- {{/each}}
- </tbody>
- </table>
-
- {{simple-table table-id="nodes-table" bFilter=true}}
+ {{em-table columns=columns rows=model.nodes}}
{{else}}
<h4 align="center">No nodes found on this cluster</h4>
{{/if}}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs
index 6d6488f..4a508c1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs
@@ -19,8 +19,7 @@
<div class="row">
<div class="col-lg-12 container-fluid">
{{#if model.apps}}
- {{app-table table-id="apps-table" arr=model.apps}}
- {{simple-table table-id="apps-table" bFilter=true colTypes="elapsed-time" colTargets="7"}}
+ {{em-table columns=columns rows=model.apps}}
{{else}}
<h4 align = "center">Could not find any applications from this cluster</h4>
{{/if}}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json
index 6a4eb16..4cd0fdc 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json
@@ -20,9 +20,9 @@
"devDependencies": {
"broccoli-asset-rev": "2.4.2",
"broccoli-funnel": "1.0.1",
- "em-table": "0.1.6",
- "ember-bootstrap": "0.5.1",
+ "em-table": "0.7.0",
"ember-array-contains-helper": "1.0.2",
+ "ember-bootstrap": "0.5.1",
"ember-cli": "1.13.13",
"ember-cli-app-version": "1.0.0",
"ember-cli-babel": "5.1.6",
@@ -47,6 +47,9 @@
"select2": "4.0.0"
},
"dependencies": {
- "em-helpers": "^0.5.13"
+ "em-helpers": "^0.8.0",
+ "em-table": "^0.7.0",
+ "ember-cli-moment-shim": "^3.0.1",
+ "ember-cli-numeral": "^0.2.0"
}
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/app-table-columns-test.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/app-table-columns-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/app-table-columns-test.js
new file mode 100644
index 0000000..b8b77ad
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/app-table-columns-test.js
@@ -0,0 +1,30 @@
+/**
+ * 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 { moduleFor, test } from 'ember-qunit';
+
+moduleFor('controller:app-table-columns', 'Unit | Controller | app table columns', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+// Replace this with your real tests.
+test('it exists', function(assert) {
+ let controller = this.subject();
+ assert.ok(controller);
+});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/apps-test.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/apps-test.js
new file mode 100644
index 0000000..a004283
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/apps-test.js
@@ -0,0 +1,30 @@
+/**
+ * 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 { moduleFor, test } from 'ember-qunit';
+
+moduleFor('controller:yarn-apps/apps', 'Unit | Controller | yarn apps/apps', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+// Replace this with your real tests.
+test('it exists', function(assert) {
+ let controller = this.subject();
+ assert.ok(controller);
+});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/services-test.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/services-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/services-test.js
new file mode 100644
index 0000000..d0a1f85
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/services-test.js
@@ -0,0 +1,30 @@
+/**
+ * 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 { moduleFor, test } from 'ember-qunit';
+
+moduleFor('controller:yarn-apps/services', 'Unit | Controller | yarn apps/services', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+// Replace this with your real tests.
+test('it exists', function(assert) {
+ let controller = this.subject();
+ assert.ok(controller);
+});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/table-test.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/table-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/table-test.js
new file mode 100644
index 0000000..fdf586e
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/table-test.js
@@ -0,0 +1,30 @@
+/**
+ * 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 { moduleFor, test } from 'ember-qunit';
+
+moduleFor('controller:yarn-nodes/table', 'Unit | Controller | yarn nodes/table', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+// Replace this with your real tests.
+test('it exists', function(assert) {
+ let controller = this.subject();
+ assert.ok(controller);
+});
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef488044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue/apps-test.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue/apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue/apps-test.js
new file mode 100644
index 0000000..3abf21a
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue/apps-test.js
@@ -0,0 +1,30 @@
+/**
+ * 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 { moduleFor, test } from 'ember-qunit';
+
+moduleFor('controller:yarn-queue/apps', 'Unit | Controller | yarn queue/apps', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+// Replace this with your real tests.
+test('it exists', function(assert) {
+ let controller = this.subject();
+ assert.ok(controller);
+});
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org