diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-labelmapping.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-labelmapping.js new file mode 100644 index 0000000..81d2fc5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-labelmapping.js @@ -0,0 +1,32 @@ +/** + * 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 AbstractAdapter from './abstract'; + +export default AbstractAdapter.extend({ + address: "rmWebAddress", + restNameSpace: "cluster", + serverName: "RM", + + urlForFindAll() { + var url = this._buildURL(); + url = url + "/label-mappings"; + return url; + } + +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-nodelabel.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-nodelabel.js new file mode 100644 index 0000000..106e883 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-nodelabel.js @@ -0,0 +1,32 @@ +/** + * 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 AbstractAdapter from './abstract'; + +export default AbstractAdapter.extend({ + address: "rmWebAddress", + restNameSpace: "cluster", + serverName: "RM", + + urlForFindAll() { + var url = this._buildURL(); + url = url + "/get-node-labels"; + return url; + } + +}); 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 82d2d46..a62bae9 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 @@ -25,7 +25,7 @@ export default BaseChartComponent.extend({ /* * data = [{label="xx", value=},{...}] */ - renderDonutChart: function(data, title, showLabels = false, + renderDonutChart: function(data, title, showLabels = false, middleLabel = "Total", middleValue = undefined, suffix = "") { var g = this.chart.g; var layout = this.getLayout(); @@ -181,7 +181,7 @@ export default BaseChartComponent.extend({ this.colors = ColorUtils.getColors(this.get("data").length, targets, colorTargetReverse); } - this.renderDonutChart(this.get("data"), this.get("title"), this.get("showLabels"), + this.renderDonutChart(this.get("data"), this.get("title"), this.get("showLabels"), this.get("middleLabel"), this.get("middleValue")); }, @@ -189,4 +189,4 @@ export default BaseChartComponent.extend({ this.initChart(); this.draw(); }, -}); \ No newline at end of file +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/queues-tree-view.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/queues-tree-view.js new file mode 100644 index 0000000..695a6bb --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/queues-tree-view.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.Component.extend({ + didInsertElement: function() { + this.$('ul.nav.nav-tabs').on('shown.bs.tab', function (e) { + let partition = this.$(e.target).data('label'); + if (partition !== 'DEFAULT_PARTITION') { + this.sendAction('setActivePartition', partition); + } else { + this.sendAction('setActivePartition', undefined); + } + }.bind(this)); + }, + + willDestroyElement: function() { + this.$('ul.nav.nav-tabs').off('shown.bs.tab'); + } +}); 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 3d72b2f..944e380 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 @@ -149,7 +149,7 @@ export default Ember.Component.extend({ nodeEnter.append("circle") .attr("r", 1e-6) .style("fill", function(d) { - var usedCap = d.queueData.get("usedCapacity"); + var usedCap = this.getQueueCapacityByPartition(d.queueData, this.get('partitionName')); if (usedCap <= 60.0) { return "LimeGreen"; } else if (usedCap <= 100.0) { @@ -157,7 +157,7 @@ export default Ember.Component.extend({ } else { return "LightCoral"; } - }); + }.bind(this)); // append percentage nodeEnter.append("text") @@ -166,13 +166,13 @@ export default Ember.Component.extend({ .attr("fill", "white") .attr("text-anchor", function() { return "middle"; }) .text(function(d) { - var usedCap = d.queueData.get("usedCapacity"); + var usedCap = this.getQueueCapacityByPartition(d.queueData, this.get('partitionName')); if (usedCap >= 100.0) { return usedCap.toFixed(0) + "%"; } else { return usedCap.toFixed(1) + "%"; } - }) + }.bind(this)) .style("fill-opacity", 1e-6); // append queue name @@ -292,6 +292,22 @@ export default Ember.Component.extend({ }, didInsertElement: function() { - this.reDraw(); - } + this.reDraw(); + }, + + getQueueCapacityByPartition: function(queueData, partitionName) { + var usedCap = queueData.get("usedCapacity"); + var queuePartition = queueData.get('partitions').findBy('name', partitionName); + if (partitionName && queuePartition) { + usedCap = queuePartition.get('usedCapacity'); + } + return usedCap; + }, + + partitionObserver: function() { + if (this.get('partitionName')) { + d3.select('#' + this.get("parentId") + ' svg').remove(); + this.reDraw(); + } + }.observes('partitionName') }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/label.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/label.js new file mode 100644 index 0000000..4bbc18d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/label.js @@ -0,0 +1,118 @@ +/** + * 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({ + nodeLabels: Ember.computed('model.nodes', 'model.nodeLabels', function() { + var nodes = this.get('model.nodes'); + var nodeLabels = this.get('model.nodeLabels'); + var nodeCount = 0; + nodeLabels.forEach((label) => { + nodeCount += label.get('nodesCount'); + }); + var defaultNodeList = this.getDefaultPartitionNodesList(nodes); + var defaultLabel = this.store.createRecord('yarn-labelmapping', { + id: 'labelmapping_default_partition_' + Date.now(), + labelName: 'DEFAULT_PARTITION', + exclusivity: 'Exclusive', + nodesList: defaultNodeList, + nodesCount: nodes.get('length') - nodeCount + }); + this.setLabelResources(defaultLabel); + nodeLabels.forEach((label) => { + this.setLabelResources(label); + }); + return nodeLabels; + }), + + getDefaultPartitionNodesList(nodes) { + var list = []; + nodes.forEach(function(node) { + if(!node.get('nodeLabels')) { + list.push(node.get('id')); + } + }); + return list; + }, + + setLabelResources(label) { + var totMem = 0; + var totVCore = 0; + label.get('nodesList').forEach((nodeId) => { + let node = this.store.peekRecord('yarn-rm-node', nodeId); + if(node) { + totMem += node.get('usedMemoryMB') + node.get('availMemoryMB'); + totVCore += node.get('usedVirtualCores') + node.get('availableVirtualCores'); + } + }); + label.set('totalMemory', totMem); + label.set('totalVCores', totVCore); + }, + + getMemoryDataForDonutChart: Ember.computed(function() { + var labelmappings = this.store.peekAll('yarn-labelmapping'); + var chartData = []; + labelmappings.forEach(function(mapping) { + chartData.push({ + label: mapping.get('labelName'), + value: mapping.get('totalMemory') + }); + }); + return chartData; + }), + + getVCoreDataForDonutChart: Ember.computed(function() { + var labelmappings = this.store.peekAll('yarn-labelmapping'); + var chartData = []; + labelmappings.forEach(function(mapping) { + chartData.push({ + label: mapping.get('labelName'), + value: mapping.get('totalVCores') + }); + }); + return chartData; + }), + + columns: Ember.computed(function() { + var colums = []; + colums.push({ + id: 'labelName', + headerTitle: 'Label Name', + contentPath: 'labelName' + }, { + id: 'exclusivity', + headerTitle: 'Label Type', + contentPath: 'exclusivity' + }, { + id: 'nodesCount', + headerTitle: 'Nodes Count', + contentPath: 'nodesCount' + }, { + id: 'totalResources', + headerTitle: 'Total Resources', + contentPath: 'totalResources', + observePath: true, + getCellContent: function(row) { + return `Memory: ${row.get('totalMemory')}, VCores: ${row.get('totalVCores')}`; + } + }); + return ColumnDef.make(colums); + }) +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queues.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queues.js index 9658ded..c41da4c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queues.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queues.js @@ -22,6 +22,13 @@ export default Ember.Controller.extend({ needReload: true, selectedQueue: undefined, showLoading: true, + activePartition: undefined, + + actions: { + setActivePartition(partition) { + this.set('activePartition', partition); + } + }, breadcrumbs: [{ text: "Home", diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-labelmapping.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-labelmapping.js new file mode 100644 index 0000000..86e5b13 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-labelmapping.js @@ -0,0 +1,28 @@ +/** + * 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 DS from 'ember-data'; + +export default DS.Model.extend({ + labelName: DS.attr('string'), + exclusivity: DS.attr('string'), + nodesList: DS.attr(), + nodesCount: DS.attr('number'), + totalMemory: DS.attr('number'), + totalVCores: DS.attr('number') +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-nodelabel.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-nodelabel.js new file mode 100644 index 0000000..6cbc653 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-nodelabel.js @@ -0,0 +1,24 @@ +/** + * 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 DS from 'ember-data'; + +export default DS.Model.extend({ + name: DS.attr('string'), + exclusivity: DS.attr('string') +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue.js index 27c48f7..8a4daca 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue.js @@ -34,7 +34,8 @@ export default DS.Model.extend({ preemptionDisabled: DS.attr('number'), numPendingApplications: DS.attr('number'), numActiveApplications: DS.attr('number'), - users: DS.hasMany('YarnUser'), + users: DS.hasMany('yarn-user'), + partitions: DS.hasMany('yarn-queuepartition'), isLeafQueue: function() { var len = this.get("children.length"); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queuepartition.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queuepartition.js new file mode 100644 index 0000000..dd78424 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queuepartition.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 DS from 'ember-data'; + +export default DS.Model.extend({ + name: DS.attr('string'), + queueName: DS.attr('string'), + capacity: DS.attr('number'), + maxCapacity: DS.attr('number'), + usedCapacity: DS.attr('number'), + absCapacity: DS.attr('number'), + absMaxCapacity: DS.attr('number'), + absUsedCapacity: DS.attr('number') +}); 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 a52107a..41f1957 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('label'); }); 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/routes/yarn-nodes.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js index d31eb5c..71efb78 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js @@ -22,14 +22,17 @@ import AbstractRoute from './abstract'; export default AbstractRoute.extend({ model() { + this.unloadAll(); return Ember.RSVP.hash({ nodes: this.store.findAll('yarn-rm-node', {reload: true}), clusterMetrics: this.store.findAll('ClusterMetric', {reload: true}), + nodeLabels: this.store.findAll('yarn-labelmapping', {reload: true}) }); }, unloadAll() { this.store.unloadAll('yarn-rm-node'); this.store.unloadAll('ClusterMetric'); + this.store.unloadAll('yarn-labelmapping'); } }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/label.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/label.js new file mode 100644 index 0000000..8719170 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/label.js @@ -0,0 +1,22 @@ +/** + * 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.Route.extend({ +}); 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 e4f145d..249f51f 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 @@ -27,11 +27,15 @@ export default AbstractRoute.extend({ this.controllerFor('yarn-queues').set('showLoading', false); } else { this.controllerFor('yarn-queues').set('showLoading', true); + this.controllerFor('yarn-queues').set('activePartition', undefined); } + this.store.unloadAll('yarn-nodelabel'); return Ember.RSVP.hash({ selected : queueName, queues: this.store.query('yarn-queue', {}), - selectedQueue : undefined + selectedQueue : undefined, + apps: this.store.findAll('yarn-app', {reload: true}), + labels: this.store.findAll('yarn-nodelabel', {reload: true}) }); }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-labelmapping.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-labelmapping.js new file mode 100644 index 0000000..08845b7 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-labelmapping.js @@ -0,0 +1,74 @@ +/** + * 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 DS from 'ember-data'; +import Ember from 'ember'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload) { + if (payload.entry) { + payload = payload.entry; + } + var actualNodeList = []; + if (Ember.isArray(payload.value.nodes)) { + actualNodeList = payload.value.nodes.filter(function(nodeName) { + return nodeName.split(':')[1] !== "0"; + }); + } else { + actualNodeList = payload.value.nodes.split(':')[1] !== "0"? [payload.value.nodes] : []; + } + var fixedPayload = { + id: "labelmapping_" + payload.key.name + "_" + Date.now(), + type: primaryModelClass.modelName, + attributes: { + labelName: payload.key.name, + exclusivity: payload.key.exclusivity === "true"? 'Exclusive' : 'Non-Exclusive', + nodesList: actualNodeList, + nodesCount: actualNodeList.length + } + }; + + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload/*, id, requestType*/) { + var p = this.internalNormalizeSingleResponse(store, primaryModelClass, payload.labelsToNodes); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload/*, id, requestType*/) { + // return expected is { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + + // payload has labelsToNodes : { entry: [ {},{},{} ] } + if(payload.labelsToNodes && payload.labelsToNodes.entry) { + if (Ember.isArray(payload.labelsToNodes.entry)) { + normalizedArrayResponse.data = payload.labelsToNodes.entry.map(singleLabel => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, singleLabel); + }, this); + } else { + var nomalizedSingleResponse = this.internalNormalizeSingleResponse(store, primaryModelClass, payload.labelsToNodes); + normalizedArrayResponse.data = [nomalizedSingleResponse]; + } + } else { + normalizedArrayResponse.data = []; + } + + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-nodelabel.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-nodelabel.js new file mode 100644 index 0000000..63d4de5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-nodelabel.js @@ -0,0 +1,54 @@ +/** + * 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 DS from 'ember-data'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload) { + var fixedPayload = { + id: "nodelabel_" + payload.name + "_" + Date.now(), + type: primaryModelClass.modelName, + attributes: { + name: payload.name, + exclusivity: payload.exclusivity === "true"? 'Exclusive' : 'Non-Exclusive' + } + }; + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload/*, id, requestType*/) { + var p = this.internalNormalizeSingleResponse(store, primaryModelClass, payload.nodeLabelInfo); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload/*, id, requestType*/) { + // return expected is { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + + // payload has { nodeLabelInfo: [ {}, {} ] } + if (payload.nodeLabelInfo) { + normalizedArrayResponse.data = payload.nodeLabelInfo.map(singleLabel => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, singleLabel); + }, this); + } else { + normalizedArrayResponse.data = []; + } + + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue.js index 766c5c7..91e3225 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue.js @@ -31,12 +31,13 @@ export default DS.JSONAPISerializer.extend({ var includedData = []; var relationshipUserData = []; + var relationshipPartitionData = []; // update user models if (payload.users && payload.users.user) { payload.users.user.forEach(function(u) { includedData.push({ - type: "YarnUser", + type: "yarn-user", id: u.username + "_" + payload.queueName, attributes: { name: u.username, @@ -47,12 +48,39 @@ export default DS.JSONAPISerializer.extend({ }); relationshipUserData.push({ - type: "YarnUser", + type: "yarn-user", id: u.username + "_" + payload.queueName, }); }); } + //Update queue partion models + if (payload.capacities && payload.capacities.queueCapacitiesByPartition) { + payload.capacities.queueCapacitiesByPartition.forEach(function(partition) { + var partitionName = partition.partitionName? partition.partitionName : 'DEFAULT_PARTITION'; + var partitionId = partitionName + '_' + payload.queueName; + includedData.push({ + id: partitionId, + type: 'yarn-queuepartition', + attributes: { + name: partitionName, + queueName: payload.queueName, + capacity: partition.capacity, + usedCapacity: partition.usedCapacity, + maxCapacity: partition.maxCapacity, + absCapacity: partition.absoluteCapacity, + absMaxCapacity: partition.absoluteMaxCapacity, + absUsedCapacity: partition.absoluteUsedCapacity + } + }); + + relationshipPartitionData.push({ + id: partitionId, + type: 'yarn-queuepartition' + }); + }); + } + var fixedPayload = { id: id, @@ -78,6 +106,9 @@ export default DS.JSONAPISerializer.extend({ relationships: { users: { data: relationshipUserData + }, + partitions: { + data: relationshipPartitionData } } }; @@ -126,20 +157,8 @@ export default DS.JSONAPISerializer.extend({ normalizedArrayResponse.data = result.data; normalizedArrayResponse.included = result.includedData; - console.log(normalizedArrayResponse); - return normalizedArrayResponse; - - /* // return expected is { data: [ {}, {} ] } - var normalizedArrayResponse = {}; - - // payload has apps : { app: [ {},{},{} ] } - // need some error handling for ex apps or app may not be defined. - normalizedArrayResponse.data = payload.apps.app.map(singleApp => { - return this.normalizeSingleResponse(store, primaryModelClass, singleApp, singleApp.id, requestType); - }, this); - return normalizedArrayResponse; - */ + // payload has { apps: { app: [ {}, {}, {} ] } } } -}); \ No newline at end of file +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/queues-tree-view.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/queues-tree-view.hbs new file mode 100644 index 0000000..6958e93 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/queues-tree-view.hbs @@ -0,0 +1,62 @@ +{{! + * 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. +}} + +
+
+
+ +
+
+
+ {{tree-selector + model=model + parentId="defaultpartition_tree_container" + selected=selected + partitionName=undefined + }} +
+
+
+
+ {{tree-selector + model=model + parentId="labelpartition_tree_container" + selected=selected + partitionName=activePartition + }} +
+
+
+
+
+
+ +{{yield}} 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 874b3c4..ce12169 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 @@ -33,11 +33,15 @@ {{/link-to}} {{/link-to}} + {{#link-to 'yarn-nodes.label' tagName="li"}} + {{#link-to 'yarn-nodes.label'}}Node Labels + {{/link-to}} + {{/link-to}} + {{#link-to 'yarn-nodes.heatmap' tagName="li"}} {{#link-to 'yarn-nodes.heatmap'}}Nodes Heatmap Chart {{/link-to}} {{/link-to}} - diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/label.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/label.hbs new file mode 100644 index 0000000..ee26fec --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/label.hbs @@ -0,0 +1,68 @@ +{{!-- + 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 nodeLabels}} + {{em-table columns=columns rows=nodeLabels}} + {{else}} +

No labels found on this cluster

+ {{/if}} +
+
+ + +
+ +
+
+
+ NodeLabel - Memory +
+
+ {{donut-chart data=getMemoryDataForDonutChart + showLabels=true + parentId="label-mem-donut-chart" + ratio=0.5 + maxHeight=350 + colorTargets="good" + colorTargetReverse=true + type="memory" + }} +
+
+
+ +
+
+
+ NodeLabel - VCores +
+
+ {{donut-chart data=getVCoreDataForDonutChart + showLabels=true + parentId="label-vcore-donut-chart" + ratio=0.5 + maxHeight=350 + colorTargets="good" + colorTargetReverse=true + }} +
+
+
+ +
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queues.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queues.hbs index 6dfb220..a0ca012 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queues.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queues.hbs @@ -19,7 +19,13 @@ {{breadcrumb-bar breadcrumbs=breadcrumbs}}
- {{queue-navigator model=model.queues selected=model.selected}} + {{queues-tree-view + model=model.queues + selected=model.selected + nodelabels=model.labels + activePartition=activePartition + setActivePartition="setActivePartition" + }}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/integration/components/queues-tree-view-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/integration/components/queues-tree-view-test.js new file mode 100644 index 0000000..da2c026 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/integration/components/queues-tree-view-test.js @@ -0,0 +1,43 @@ +/** + * 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 { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('queues-tree-view', 'Integration | Component | queues tree view', { + integration: true +}); + +test('it renders', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... });" + EOL + EOL + + + this.render(hbs`{{queues-tree-view}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage:" + EOL + + this.render(hbs` + {{#queues-tree-view}} + template block text + {{/queues-tree-view}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-labelmapping-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-labelmapping-test.js new file mode 100644 index 0000000..eb420a9 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-labelmapping-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('adapter:yarn-labelmapping', 'Unit | Adapter | yarn labelmapping', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-nodelabel-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-nodelabel-test.js new file mode 100644 index 0000000..f05e5f1 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-nodelabel-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('adapter:yarn-nodelabel', 'Unit | Adapter | yarn nodelabel', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/label-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/label-test.js new file mode 100644 index 0000000..79ddbd8 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/label-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/label', 'Unit | Controller | yarn nodes/label', { + // 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); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-labelmapping-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-labelmapping-test.js new file mode 100644 index 0000000..3e7ce3b --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-labelmapping-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 { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-labelmapping', 'Unit | Model | yarn labelmapping', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('it exists', function(assert) { + let model = this.subject(); + // let store = this.store(); + assert.ok(!!model); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-nodelabel-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-nodelabel-test.js new file mode 100644 index 0000000..ccd741d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-nodelabel-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 { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-nodelabel', 'Unit | Model | yarn nodelabel', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('it exists', function(assert) { + let model = this.subject(); + // let store = this.store(); + assert.ok(!!model); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-queuepartition-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-queuepartition-test.js new file mode 100644 index 0000000..3d17e0a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-queuepartition-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 { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-queuepartition', 'Unit | Model | yarn queuepartition', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('it exists', function(assert) { + let model = this.subject(); + // let store = this.store(); + assert.ok(!!model); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes/label-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes/label-test.js new file mode 100644 index 0000000..e4dc372 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes/label-test.js @@ -0,0 +1,29 @@ +/** + * 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('route:yarn-nodes/label', 'Unit | Route | yarn nodes/label', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-labelmapping-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-labelmapping-test.js new file mode 100644 index 0000000..aa9d4e1 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-labelmapping-test.js @@ -0,0 +1,33 @@ +/** + * 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 { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-labelmapping', 'Unit | Serializer | yarn labelmapping', { + // Specify the other units that are required for this test. + needs: ['serializer:yarn-labelmapping'] +}); + +// Replace this with your real tests. +test('it serializes records', function(assert) { + let record = this.subject(); + + let serializedRecord = record.serialize(); + + assert.ok(serializedRecord); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-nodelabel-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-nodelabel-test.js new file mode 100644 index 0000000..bab5317 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-nodelabel-test.js @@ -0,0 +1,33 @@ +/** + * 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 { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-nodelabel', 'Unit | Serializer | yarn nodelabel', { + // Specify the other units that are required for this test. + needs: ['serializer:yarn-nodelabel'] +}); + +// Replace this with your real tests. +test('it serializes records', function(assert) { + let record = this.subject(); + + let serializedRecord = record.serialize(); + + assert.ok(serializedRecord); +});