diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app-flowrun.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app-flowrun.js new file mode 100644 index 0000000..7aa71ae --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app-flowrun.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: "timelineWebAddress", + restNameSpace: "timelineV2", + serverName: "YTS", + + urlForQuery(query, modelName){ + var url = this._buildURL(); + var flowrunUid = query['flowrunUid']; + url = url + '/run-uid/' + flowrunUid + '/apps?fields=info'; + return url; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-container.js index 30501d8..c7be40a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-container.js @@ -36,14 +36,14 @@ export default DS.JSONAPIAdapter.extend({ var rmHosts = this.get(`hosts.rmWebAddress`); var tsHosts = this.get(`hosts.timelineWebAddress`); var rmNamespaces = this.get(`env.app.namespaces.cluster`); - var tsNamespaces = this.get(`env.app.namespaces.timeline`); + var ahsNamespaces = this.get(`env.app.namespaces.applicationHistory`); if (query.is_rm) { this.set("host", rmHosts); this.set("namespace", rmNamespaces); } else { this.set("host", tsHosts); - this.set("namespace", tsNamespaces); + this.set("namespace", ahsNamespaces); } var url = this._buildURL(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-entity.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-entity.js new file mode 100644 index 0000000..bf7b374 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-entity.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: "timelineWebAddress", + restNameSpace: "timelineV2", + serverName: "YTS", + + urlForQuery(query, modelName){ + var url = this._buildURL(); + var appUid = query.app_uid; + url = url + '/app-uid/' + appUid + '/entities/' + query.entity_type + '?fields=info'; + return url; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flow-activity.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flow-activity.js new file mode 100644 index 0000000..8417499 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flow-activity.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 AbstractAdapter from './abstract'; + +export default AbstractAdapter.extend({ + address: "timelineWebAddress", + restNameSpace: "timelineV2", + serverName: "YTS", + + pathForType(modelName) { + return 'flows'; // move to some common place, return path by modelname. + }, +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flowrun-brief.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flowrun-brief.js new file mode 100644 index 0000000..2685d9c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flowrun-brief.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 AbstractAdapter from './abstract'; + +export default AbstractAdapter.extend({ + address: "timelineWebAddress", + restNameSpace: "timelineV2", + serverName: "YTS", + + urlForQuery(query, modelName){ + var url = this._buildURL(); + var flowuid = query['flowuid']; + return url + '/flow-uid/' + flowuid + '/runs'; + }, +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flowrun-metric.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flowrun-metric.js new file mode 100644 index 0000000..39133f7 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flowrun-metric.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 AbstractAdapter from './abstract'; + +export default AbstractAdapter.extend({ + address: "timelineWebAddress", + restNameSpace: "timelineV2", + serverName: "YTS", + + urlForQueryRecord(query, modelName){ + var url = this._buildURL(); + var flowrunuid = query.flowrun_uid; + console.log(flowrunuid); + url = url + '/run-uid/' + flowrunuid; + return url; + }, +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flowrun.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flowrun.js new file mode 100644 index 0000000..7b5b871 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-flowrun.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 AbstractAdapter from './abstract'; + +export default AbstractAdapter.extend({ + address: "timelineWebAddress", + restNameSpace: "timelineV2", + serverName: "YTS", + urlForQueryRecord(query, modelName){ + var url = this._buildURL(); + var flowrunuid = query.flowrun_uid; + url = url + '/run-uid/' + flowrunuid; + return url; + }, + + pathForType(modelName) { + return 'run-uid'; // move to some common place, return path by modelname. + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-timeline-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-timeline-container.js new file mode 100644 index 0000000..9df27a2 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-timeline-container.js @@ -0,0 +1,41 @@ +/** + * 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'; +import Converter from 'yarn-ui/utils/converter'; + +export default AbstractAdapter.extend({ + address: "timelineWebAddress", + restNameSpace: "timelineV2", + serverName: "YTS", + + urlForQuery(query, modelName){ + var url = this._buildURL(); + var app_attempt_id = query.app_attempt_id; + query.fields = 'ALL'; + delete query.app_attempt_id; + url = url + '/apps/' + Converter.attemptIdToAppId(app_attempt_id) + + '/appattempts/' + app_attempt_id + '/containers'; + console.log(url); + return url; + }, + + pathForType(modelName) { + return ''; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/em-table-html-cell.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/em-table-html-cell.js new file mode 100644 index 0000000..56fc68a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/em-table-html-cell.js @@ -0,0 +1,23 @@ +/** + * 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({ + content: null +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/sunburst-chart.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/sunburst-chart.js new file mode 100644 index 0000000..ff8a08e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/sunburst-chart.js @@ -0,0 +1,268 @@ +/** + * 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() { + var json = buildHierarchy(this.get("arr")); + createVisualization(json); + }, + +}); +// Dimensions of sunburst. +var width = 1000; +var height = 750; +var radius = Math.min(width, height) / 2; +// Breadcrumb dimensions: width, height, spacing, width of tip/tail. +var b = { w: 225, h: 30, s: 3, t: 10 }; +// Total size of all segments; we set this later, after loading the data. +var totalSize = 0; +var vis = null; +var partition = null; +var arc = null; +var colors = d3.scale.category20c(); + +function colorMap(d) { + return colors(d.name); +} + +// Given a node in a partition layout, return an array of all of its ancestor +// nodes, highest first, but excluding the root. +function getAncestors(node) { + var path = []; + var current = node; + while (current.parent) { + path.unshift(current); + current = current.parent; + } + return path; +} + +// Main function to draw and set up the visualization, once we have the data. +function createVisualization(json) { + partition = d3.layout.partition() + .size([2 * Math.PI, radius * radius]) + .value(function(d) { return d.size; }); + arc = d3.svg.arc() + .startAngle(function(d) { return d.x; }) + .endAngle(function(d) { return d.x + d.dx; }) + .innerRadius(function(d) { return Math.sqrt(d.y); }) + .outerRadius(function(d) { return Math.sqrt(d.y + d.dy); }); + // Basic setup of page elements. + initializeBreadcrumbTrail(); + //drawLegend(); + //d3.select("#togglelegend").on("click", toggleLegend); + + // Bounding circle underneath the sunburst, to make it easier to detect + // when the mouse leaves the parent g. + vis = d3.select("#chart").append("svg:svg") + .attr("width", width) + .attr("height", height) + .append("svg:g") + .attr("id", "container") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + vis.append("svg:circle").attr("r", radius) + .style("opacity", 0); + + // For efficiency, filter nodes to keep only those large enough to see. + var nodes = partition.nodes(json) + .filter(function(d) { + return (d.dx > 0.005); // 0.005 radians = 0.29 degrees + }); + var uniqueNames = (function(a) { + var output = []; + a.forEach(function(d) { + if (output.indexOf(d.name) === -1) output.push(d.name); + }); + return output; + })(nodes); + + var path = vis.data([json]).selectAll("path") + .data(nodes) + .enter().append("svg:path") + .attr("display", function(d) { return d.depth ? null : "none"; }) + .attr("d", arc) + .attr("fill-rule", "evenodd") + .attr("fill", colorMap) + .style("opacity", 1) + .on("mouseover", mouseover); + // Add the mouseleave handler to the bounding circle. + d3.select("#container").on("mouseleave", mouseleave); + + // Get total size of the tree = value of root node from partition. + totalSize = path.node().__data__.value; +} + + // Take a 2-column CSV and transform it into a hierarchical structure suitable + // for a partition layout. The first column is a sequence of step names, from + // root to leaf, separated by hyphens. The second column is a count of how + // often that sequence occurred. +function buildHierarchy(csv) { + var root = {"name": "root", "children": []}; + for (var i = 0; i < csv.length; i++) { + var sequence = csv[i][0]; + var size = +csv[i][1]; + if (isNaN(size)) { // e.g. if this is a header row + continue; + } + var parts = sequence.split("-"); + var currentNode = root; + for (var j = 0; j < parts.length; j++) { + var children = currentNode["children"]; + var nodeName = parts[j]; + var childNode; + if (j + 1 < parts.length) { + // Not yet at the end of the sequence; move down the tree. + var foundChild = false; + for (var k = 0; k < children.length; k++) { + if (children[k]["name"] == nodeName) { + childNode = children[k]; + foundChild = true; + break; + } + } + // If we don't already have a child node for this branch, create it. + if (!foundChild) { + childNode = {"name": nodeName, "children": []}; + children.push(childNode); + } + currentNode = childNode; + } else { + // Reached the end of the sequence; create a leaf node. + childNode = {"name": nodeName, "size": size, "children": [], "sequence": sequence}; + children.push(childNode); + } + } + } + return root; +} + +// Fade all but the current sequence, and show it in the breadcrumb trail. +function mouseover(d) { + //var percentage = (100 * d.value / totalSize).toPrecision(3); + //var percentageString = percentage + "%"; + var percentageString = d.value; + + d3.select("#percentage").html('

' + percentageString + + '


(' + d.name + ')

'); + d3.select("#explanation").style("visibility", ""); + + var sequenceArray = getAncestors(d); + updateBreadcrumbs(sequenceArray, percentageString); + + // Fade all the segments. + d3.selectAll("path").style("opacity", 0.2); + + // Then highlight only those that are an ancestor of the current segment. + vis.selectAll("path") + .filter(function(node) { + return (sequenceArray.indexOf(node) >= 0); + }) + .style("opacity", 1); +} + +// Restore everything to full opacity when moving off the visualization. +function mouseleave(d) { + // Hide the breadcrumb trail + d3.select("#trail").style("visibility", "hidden"); + + // Deactivate all segments during transition. + d3.selectAll("path").on("mouseover", null); + + // Transition each segment to full opacity and then reactivate it. + d3.selectAll("path") + .transition() + .duration(1000) + .style("opacity", 1) + .each("end", function() { + d3.select(this).on("mouseover", mouseover); + }); + + d3.select("#explanation") + .style("visibility", "hidden"); +} + +function initializeBreadcrumbTrail() { + // Add the svg area. + var trail = d3.select("#sequence").append("svg:svg") + .attr("width", width) + .attr("height", 50) + .attr("id", "trail"); + // Add the label at the end, for the percentage. + trail.append("svg:text") + .attr("id", "endlabel") + .style("fill", "#000"); +} + +// Generate a string that describes the points of a breadcrumb polygon. +function breadcrumbPoints(d, i) { + var points = []; + points.push("0,0"); + points.push(b.w + ",0"); + points.push(b.w + b.t + "," + (b.h / 2)); + points.push(b.w + "," + b.h); + points.push("0," + b.h); + if (i > 0) { // Leftmost breadcrumb; don't include 6th vertex. + points.push(b.t + "," + (b.h / 2)); + } + return points.join(" "); +} + +// Update the breadcrumb trail to show the current sequence and percentage. +function updateBreadcrumbs(nodeArray, percentageString) { + // Data join; key function combines name and depth (= position in sequence). + var g = d3.select("#trail") + .selectAll("g") + .data(nodeArray, function(d) { return d.name + d.depth; }); + + // Add breadcrumb and label for entering nodes. + var entering = g.enter().append("svg:g"); + + entering.append("svg:polygon") + .attr("points", breadcrumbPoints) + .attr("fill", colorMap); + + entering.append("svg:text") + .attr("x", (b.w + b.t) / 2) + .attr("y", b.h / 2) + .attr("dy", "0.35em") + .attr("text-anchor", "middle") + .text(function(d) { return d.name; }); + + // Set position for entering and updating nodes. + g.attr("transform", function(d, i) { + return "translate(" + i * (b.w + b.s) + ", 0)"; + }); + + // Remove exiting nodes. + g.exit().remove(); + + // Now move and update the percentage at the end. + d3.select("#trail").select("#endlabel") + .attr("x", (nodeArray.length + 0.5) * (b.w + b.s)) + .attr("y", b.h / 2) + .attr("dy", "0.35em") + .attr("text-anchor", "middle") + .text(percentageString); + + // Make the breadcrumb trail visible, if it's hidden. + d3.select("#trail") + .style("visibility", ""); +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js index 516b114..e1782ed 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js @@ -18,6 +18,8 @@ import Ember from 'ember'; import Converter from 'yarn-ui/utils/converter'; +import TableDef from 'em-table/utils/table-definition'; +import ColumnDef from 'em-table/utils/column-definition'; export default Ember.Component.extend({ canvas: { @@ -31,6 +33,8 @@ export default Ember.Component.extend({ modelArr: [], colors: d3.scale.category10().range(), _selected: undefined, + gridColumns: [], + gridRows: [], selected: function() { return this._selected; @@ -206,7 +210,7 @@ export default Ember.Component.extend({ .on("mousemove", function(d) { this.tooltip.style("opacity", .9); this.tooltip.html(d.get("tooltipLabel")) - .style("left", (d3.event.pageX) + "px") + .style("left", (d3.event.pageX + 5) + "px") .style("top", (d3.event.pageY - 28) + "px"); }.bind(this)) .on("mouseout", function(d) { @@ -273,5 +277,188 @@ export default Ember.Component.extend({ if (this.modelArr.length > 0) { this.setSelected(this.modelArr[0]); } + + if (this.get('attemptModel')) { + this.setAttemptsGridColumnsAndRows(); + } else { + this.setContainersGridColumnsAndRows(); + } + }, + + setAttemptsGridColumnsAndRows: function() { + var columns = [], + data = [], + row = null; + + columns.push({ + id: 'attemptId', + headerTitle: 'Attempt ID', + contentPath: 'attemptId', + observePath: true, + cellComponentName: 'em-table-linked-cell', + getCellContent: function(row) { + return { + displayText: row.get('attemptId'), + routeName: 'yarn-app-attempt', + id: row.get('attemptId') + }; + } + }, { + id: 'startTime', + headerTitle: 'Start Time', + contentPath: 'startTime', + observePath: true + }, { + id: 'finishedTime', + headerTitle: 'Finished Time', + contentPath: 'finishedTime', + observePath: true + }, { + id: 'elapsedTime', + headerTitle: 'Elapsed Time', + contentPath: 'elapsedTime', + observePath: true + }, { + id: 'amContainerId', + headerTitle: 'AM Container ID', + contentPath: 'amContainerId', + observePath: true + }, { + id: 'amNodeId', + headerTitle: 'AM Node ID', + contentPath: 'amNodeId', + observePath: true + }, { + id: 'nodeManagerWebUrl', + headerTitle: 'NodeManager Web UI', + contentPath: 'nodeManagerWebUrl', + observePath: true, + cellComponentName: 'em-table-html-cell', + getCellContent: function(row) { + return `${row.get('nodeManagerWebUrl')}`; + } + }, { + id: 'logsUrl', + headerTitle: 'Logs', + contentPath: 'logsUrl', + observePath: true, + cellComponentName: 'em-table-html-cell', + getCellContent: function(row) { + return `Link`; + } + }); + + var gridCols = ColumnDef.make(columns); + this.set('gridColumns', gridCols); + + this.modelArr.forEach(function(attempt) { + row = Ember.Object.create({ + attemptId: attempt.get('id'), + startTime: attempt.get('attemptStartedTime'), + finishedTime: attempt.get('finishedTime'), + elapsedTime: attempt.get('elapsedTime'), + amContainerId: attempt.get('appMasterContainerId'), + amNodeId: attempt.get('amNodeId'), + nodeManagerWebUrl: attempt.get('nodeHttpAddress'), + logsUrl: attempt.get('logsLink'), + attemptState: attempt.get('attemptState') + }); + data.push(row); + }); + + var gridRows = Ember.A(data); + this.set('gridRows', gridRows); }, -}); \ No newline at end of file + + setContainersGridColumnsAndRows: function() { + var columns = [], + data = [], + row = null; + + columns.push({ + id: 'containerId', + headerTitle: 'Container ID', + contentPath: 'containerId', + observePath: true + }, { + id: 'startTime', + headerTitle: 'Start Time', + contentPath: 'startTime', + observePath: true + }, { + id: 'finishedTime', + headerTitle: 'Finished Time', + contentPath: 'finishedTime', + observePath: true + }, { + id: 'elapsedTime', + headerTitle: 'Elapsed Time', + contentPath: 'elapsedTime', + observePath: true + }, { + id: 'priority', + headerTitle: 'Priority', + contentPath: 'priority', + observePath: true + }, { + id: 'exitStatus', + headerTitle: 'Exit Status', + contentPath: 'exitStatus', + observePath: true + }, { + id: 'state', + headerTitle: 'State', + contentPath: 'state', + observePath: true + }, { + id: 'logUrl', + headerTitle: 'Logs', + contentPath: 'logUrl', + observePath: true, + cellComponentName: 'em-table-html-cell', + getCellContent: function(row) { + var url = row.get('logUrl'); + if (url) { + return `${url}`; + } else { + return ''; + } + } + }, { + id: 'nodeManagerAddress', + headerTitle: 'Node Manager UI', + contentPath: 'nodeManagerAddress', + observePath: true, + cellComponentName: 'em-table-html-cell', + getCellContent: function(row) { + var address = row.get('nodeManagerAddress'); + if (address) { + return `${address}`; + } else { + return ''; + } + } + }); + + var gridCols = ColumnDef.make(columns); + this.set('gridColumns', gridCols); + + this.modelArr.forEach(function(container) { + row = Ember.Object.create({ + containerId: container.get('id'), + startTime: container.get('startedTime'), + finishedTime: container.get('finishedTime'), + elapsedTime: container.get('elapsedTime'), + priority: container.get('priority'), + exitStatus: container.get('containerExitStatus'), + state: container.get('containerState'), + logUrl: container.get('logUrl'), + nodeManagerAddress: container.get('nodeHttpAddress') + }); + data.push(row); + }); + + var gridRows = Ember.A(data); + this.set('gridRows', gridRows); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js index 34f4c2e..3f5d36b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js @@ -48,7 +48,12 @@ export default Ember.Controller.extend({ html = html + ' class="active"'; } html = html + '>Nodes' + - '(current)'; + '(current)
  • Flow Activities(current)
  • '; return Ember.String.htmlSafe(html); }.property('currentPath') }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempt.js index a458842..414adf2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempt.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempt.js @@ -27,13 +27,17 @@ export default Ember.Controller.extend({ routeName: 'application' },{ text: "Applications", - routeName: 'yarn-apps' + routeName: 'yarn-apps.apps' }, { text: `App [${appId}]`, routeName: 'yarn-app', model: appId }, { - text: "Attempt", + text: `Attempts List [${appId}]`, + routeName: 'yarn-app-attempts', + model: appId + }, { + text: "Attempt" }]; }) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempts.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempts.js index 9ebc2a6..92de2f9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempts.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempts.js @@ -27,7 +27,7 @@ export default Ember.Controller.extend({ routeName: 'application' },{ text: "Applications", - routeName: 'yarn-apps' + routeName: 'yarn-apps.apps' }, { text: `App [${appId}]`, routeName: 'yarn-app', diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js index f6b9404..7f5a46e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js @@ -27,7 +27,7 @@ export default Ember.Controller.extend({ routeName: 'application' },{ text: "Applications", - routeName: 'yarn-apps' + routeName: 'yarn-apps.apps' }, { text: `App [${appId}]`, routeName: 'yarn-app', diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-appattempt-containers.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-appattempt-containers.js new file mode 100644 index 0000000..4a047c5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-appattempt-containers.js @@ -0,0 +1,47 @@ +/** + * 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({ + breadcrumbs: Ember.computed("model.attempt.appId", "model.attempt.id", function () { + var appId = this.get("model.attempt.appId"); + var attemptId = this.get("model.attempt.id"); + return [{ + text: "Home", + routeName: 'application' + }, { + text: "Applications", + routeName: 'yarn-apps.apps' + }, { + text: `App [${appId}]`, + routeName: 'yarn-app', + model: appId + }, { + text: `Attempts List [${appId}]`, + routeName: 'yarn-app-attempts', + model: appId + }, { + text: `Attempt [${attemptId}]`, + routeName: 'yarn-app-attempt', + model: attemptId + }, { + text: "Containers" + }]; + }) +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps.js index 396f83b..3aa7f04 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps.js @@ -19,13 +19,12 @@ import Ember from 'ember'; export default Ember.Controller.extend({ - breadcrumbs: [{ text: "Home", routeName: 'application' }, { text: "Applications", - routeName: 'yarn-apps', + routeName: 'yarn-apps.apps', }] }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow-activity.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow-activity.js new file mode 100644 index 0000000..a386ad6 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow-activity.js @@ -0,0 +1,115 @@ +/** + * 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 TableDef from 'em-table/utils/table-definition'; +import ColumnDef from 'em-table/utils/column-definition'; +import _ from 'lodash/lodash'; + +function _createColumns() { + var columns = []; + columns.push({ + id: 'flowName', + headerTitle: 'Flow Name', + contentPath: 'flowName', + observePath: true, + }, { + id: 'user', + headerTitle: 'User', + contentPath: 'user', + observePath: true + }, { + id: 'flowId', + headerTitle: 'Flow ID', + contentPath: 'flowId', + observePath: true, + cellComponentName: 'em-table-linked-cell', + getCellContent: function (row) { + return { + routeName: 'yarn-flow', + id: row.get('flowId'), + displayText: row.get('flowId') + }; + } + }, { + id: 'lastExecDate', + headerTitle: 'Last Execution Date', + contentPath: 'lastExecDate', + observePath: true + }); + return ColumnDef.make(columns); +} + +function _getAggregatedFlowsData(flows) { + var aggregatedFlows = []; + flows = flows.get('content'); + + var aggregated = _.groupBy(flows, function(flow) { + return flow.getRecord().get('uid'); + }); + + _.forIn(aggregated, function(flows, uid) { + let flowsInAsc = _.sortBy(flows, function(flow) { + return flow.getRecord().get('lastExecDate'); + }); + let flowsInDesc = flowsInAsc.reverse(); + aggregatedFlows.push(flowsInDesc[0]); + }); + + return aggregatedFlows; +} + +function _createRows(flows) { + var data = [], + aggregatedFlows = null, + row = null; + + aggregatedFlows = _getAggregatedFlowsData(flows); + + aggregatedFlows.forEach(function(flow) { + flow = flow.getRecord(); + row = Ember.Object.create({ + user: flow.get('user'), + flowName: flow.get('flowName'), + flowId: flow.get('uid'), + lastExecDate: flow.get('lastExecDate') + }); + data.push(row); + }); + + return Ember.A(data); +} + +export default Ember.Controller.extend({ + breadcrumbs: [{ + text: "Home", + routeName: 'application' + }, { + text: "Flow Activities", + routeName: 'yarn-flow-activity', + }], + + columns: _createColumns(), + rows: Ember.computed('model', function() { + return _createRows(this.get('model')); + }), + tableDefinition: TableDef.create({ + sortColumnId: 'lastExecDate', + sortOrder: 'desc' + }) +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow.js new file mode 100644 index 0000000..dd57268 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow.js @@ -0,0 +1,140 @@ +/** + * 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 Converter from 'yarn-ui/utils/converter'; + +import TableDef from 'em-table/utils/table-definition'; +import ColumnDef from 'em-table/utils/column-definition'; + +function createColumn() { + var columns = []; + + // Generate columns + columns.push({ + id: 'flowName', + headerTitle: 'Flow Name', + contentPath: 'flowName', + observePath: true + }); + + columns.push({ + id: 'user', + headerTitle: 'User', + contentPath: 'user', + observePath: true + }); + + columns.push({ + id: 'runid', + headerTitle: 'Run ID', + contentPath: 'runid', + observePath: true, + cellComponentName: 'em-table-linked-cell', + getCellContent: function (row) { + return { + routeName: 'yarn-flowrun', + id: row.get('uid'), + displayText: row.get('shownid') + }; + } + }); + + columns.push({ + id: 'createTime', + headerTitle: 'Creation Time', + contentPath: 'createTime', + observePath: true + }); + + columns.push({ + id: 'endTime', + headerTitle: 'End Time', + contentPath: 'endTime', + observePath: true + }); + + return ColumnDef.make(columns); +} + +export default Ember.Controller.extend({ + flowUid: '', + breadcrumbs: Ember.computed("flowUid", function() { + var flowUid = this.get('flowUid'); + return [{ + text: "Home", + routeName: 'application' + }, { + text: `Flow [${flowUid}]`, + routeName: 'yarn-flow', + model: flowUid + }]; + }), + columns: createColumn(), + rows: function() { + var data = [], + row; + // Generate static part of data + this.get('model').forEach(function(currFlow) { + row = Ember.Object.create(); + row.set('flowName', currFlow.get('flowName')); + row.set('runid', currFlow.get('runid')); + row.set('type', currFlow.get('type')); + row.set('createTime', currFlow.get('createTime')); + row.set('endTime', currFlow.get('endTime')); + row.set('user', currFlow.get('user')); + row.set('uid', currFlow.get('uid')); + row.set('shownid', currFlow.get('shownid')); + data.push(row); + }); + return Ember.A(data); + }.property('model'), + + tableDefinition: TableDef.create({ + sortColumnId: 'createTime', + sortOrder: 'desc' + }), + + flowName: function() { + var flowName; + this.get('model').forEach(function(flowrun) { + flowName = flowrun.get('flowName'); + }); + return flowName; + }.property('model'), + + earliestStartTime: function() { + var earliestStart = Number.MAX_VALUE; + this.get('model').forEach(function(flowrun) { + if (flowrun.get('createTimeRaw') < earliestStart) { + earliestStart = flowrun.get('createTimeRaw'); + } + }); + return Converter.timeStampToDate(earliestStart); + }.property('model'), + + latestFinishTime: function() { + var latestFinish = 0; + this.get('model').forEach(function(flowrun) { + if (flowrun.get('endTimeRaw') > latestFinish) { + latestFinish = flowrun.get('endTimeRaw'); + } + }); + return Converter.timeStampToDate(latestFinish); + }.property('model') +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flowrun-metrics.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flowrun-metrics.js new file mode 100644 index 0000000..876d1e5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flowrun-metrics.js @@ -0,0 +1,50 @@ +/** + * 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({ + flowrunUid: '', + parentFlowUid: '', + + breadcrumbs: Ember.computed('flowrunUid', 'parentFlowUid', function() { + var flowRunId = this.get('flowrunUid'); + var parentFlowUid = this.get('parentFlowUid'); + var crumbs = [{ + text: "Home", + routeName: 'application' + }]; + if (parentFlowUid) { + crumbs.push({ + text: `Flow [${parentFlowUid}]`, + routeName: 'yarn-flow', + model: parentFlowUid + }); + } + crumbs.push({ + text: `Flow Run [${flowRunId}]`, + routeName: 'yarn-flowrun', + model: flowRunId + }, { + text: 'Metrics', + routeName: 'yarn-flowrun-metrics', + model: flowRunId + }); + return crumbs; + }) +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flowrun.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flowrun.js new file mode 100644 index 0000000..e0a049e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flowrun.js @@ -0,0 +1,89 @@ +/** + * 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 TableDef from 'em-table/utils/table-definition'; +import ColumnDef from 'em-table/utils/column-definition'; + +function createColumn() { + var columns = []; + + // Generate columns + columns.push({ + id: 'appId', + headerTitle: 'Application ID', + contentPath: 'appId', + observePath: true, + cellComponentName: 'em-table-linked-cell', + getCellContent: function (row) { + return { + routeName: 'yarn-app', + id: row.get('appId'), + displayText: row.get('appId') + }; + } + }); + + columns.push({ + id: 'appType', + headerTitle: 'Application Type', + contentPath: 'type', + observePath: true + }); + + return ColumnDef.make(columns); +} + +export default Ember.Controller.extend({ + flowrun_uid: '', + parentFlowUid: '', + breadcrumbs: Ember.computed('flowrun_uid', 'parentFlowUid', function() { + var flowRunId = this.get('flowrun_uid'); + var parentFlowUid = this.get('parentFlowUid'); + var crumbs = [{ + text: "Home", + routeName: 'application' + }]; + if (parentFlowUid) { + crumbs.push({ + text: `Flow [${parentFlowUid}]`, + routeName: 'yarn-flow', + model: parentFlowUid + }); + } + crumbs.push({ + text: `Flow Run [${flowRunId}]`, + routeName: 'yarn-flowrun', + model: flowRunId + }); + return crumbs; + }), + columns: createColumn(), + rows: function() { + var data = [], + row; + this.get('apps').forEach(function(currApp) { + row = Ember.Object.create(); + row.set('appId', currApp.get('appId')); + row.set('type', currApp.get('type')); + data.push(row); + }); + return Ember.A(data); + }.property('model') +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/single-metric-table.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/single-metric-table.js new file mode 100644 index 0000000..be09c95 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/single-metric-table.js @@ -0,0 +1,48 @@ +/** + * 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'; + +/** + * Represent log files as comma separated list. + */ +export default Ember.Helper.helper(function(params,hash) { + var metrics = hash.metrics; + var uid = hash.uid; + var html = '
    '; + html = html + '
    '; + html = html + '
    Metrics
    '; + html = html + ''; + for (var i = 0; i < metrics.length; i++) { + var k = 0; + for(var j in metrics[i].values){ + html = html + ''; + } else { + html = html + metrics[i].id + ''; + } + html = html + ''; + html = html + ''; + break; + } + } + html = html + '
    '; + if (metrics[i].values[j] > 0) { + html = html + '' + metrics[i].id + '' + metrics[i].values[j] + '
    '; + return Ember.String.htmlSafe(html); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js index 3601f72..b82208c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js @@ -140,4 +140,4 @@ export default DS.Model.extend({ return this.get("state"); }.property(), -}); \ No newline at end of file +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-flowrun.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-flowrun.js new file mode 100644 index 0000000..3cf39bf --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-flowrun.js @@ -0,0 +1,26 @@ +/** + * 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({ + appId: DS.attr('string'), + type: DS.attr('string'), + uid: DS.attr('string'), + metrics: DS.attr('array') +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-entity.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-entity.js new file mode 100644 index 0000000..533c82d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-entity.js @@ -0,0 +1,26 @@ +/** + * 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({ + entityId: DS.attr('string'), + type: DS.attr('string'), + uid: DS.attr('string'), + metrics: DS.attr('array') +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flow-activity.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flow-activity.js new file mode 100644 index 0000000..1095cfe --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flow-activity.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({ + cluster: DS.attr('string'), + flowName: DS.attr('string'), + lastExecDate: DS.attr('string'), + user: DS.attr('string'), + flowruns: DS.attr('string'), + uid: DS.attr('string') +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-brief.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-brief.js new file mode 100644 index 0000000..f5aeb04 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-brief.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 DS from 'ember-data'; + +export default DS.Model.extend({ + flowName: DS.attr('string'), + runid: DS.attr('string'), + shownid: DS.attr('string'), + type: DS.attr('string'), + createTime: DS.attr('string'), + createTimeRaw: DS.attr(), + endTime: DS.attr('string'), + endTimeRaw: DS.attr(), + user: DS.attr('string'), + uid: DS.attr('string') +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-metric.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-metric.hbs new file mode 100644 index 0000000..c4c45da --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-metric.hbs @@ -0,0 +1 @@ +

    {{flowrun.shownid}}

    diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun.js new file mode 100644 index 0000000..a86b78b --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun.js @@ -0,0 +1,52 @@ +/** + * 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 DS from 'ember-data'; + +// For now, similar to yarn-flowrun-brief, but may add more in future. + +export default DS.Model.extend({ + flowName: DS.attr('string'), + runid: DS.attr('string'), + shownid: DS.attr('string'), + type: DS.attr('string'), + createTime: DS.attr('string'), + endTime: DS.attr('string'), + user: DS.attr('string'), + metrics: DS.attr('array'), + singleMetricHtml: function() { + var html = '
    '; + html = html + '
    '; + html = html + '
    Metrics
    '; + html = html + ''; + var metrics = this.get("metrics"); + for (var i = 0; i < metrics.length; i++) { + html = html + ''; + var k = 0; + for(var j in metrics[i].values){ + html = html + ''; + break; + } + html = html + ''; + } + html = html + '
    ' + metrics[i].id + '' + metrics[i].values[j] + '
    '; + return Ember.String.htmlSafe(html); + }.property("metrics") +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js new file mode 100644 index 0000000..17f6cca --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js @@ -0,0 +1,64 @@ +/** + * 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 Converter from 'yarn-ui/utils/converter'; + +export default DS.Model.extend({ + allocatedMB: DS.attr('number'), + allocatedVCores: DS.attr('number'), + assignedNodeId: DS.attr('string'), + priority: DS.attr('number'), + startedTime: DS.attr('number'), + finishedTime: DS.attr('number'), + logUrl: DS.attr('string'), + containerExitStatus: DS.attr('number'), + containerState: DS.attr('string'), + nodeHttpAddress: DS.attr('string'), + + startTs: function() { + return Converter.dateToTimeStamp(this.get("startedTime")); + }.property("startedTime"), + + finishedTs: function() { + var ts = Converter.dateToTimeStamp(this.get("finishedTime")); + return ts; + }.property("finishedTime"), + + validatedFinishedTs: function() { + if (this.get("finishedTs") < this.get("startTs")) { + return ""; + } + return this.get("finishedTime"); + }.property("finishedTime"), + + elapsedTime: function() { + var elapsedMs = this.get("finishedTs") - this.get("startTs"); + if (elapsedMs <= 0) { + elapsedMs = Date.now() - this.get("startTs"); + } + + return Converter.msToElapsedTime(elapsedMs); + }.property(), + + tooltipLabel: function() { + return "

    Id:" + this.get("id") + + "

    ElapsedTime:" + + String(this.get("elapsedTime")) + "

    "; + }.property(), +}); 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 87a018d..5bcbea9 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 @@ -48,6 +48,14 @@ Router.map(function() { this.route('cluster-overview'); this.route('yarn-app', { path: '/yarn-app/:app_id' }); this.route('yarn-app-attempt', { path: '/yarn-app-attempt/:app_attempt_id'}); + this.route('yarn-appattempt-containers', {path: '/yarn-appattempt-containers/:app_attempt_id'}); + + this.route('yarn-flow-activity'); + this.route('yarn-flow', { path: '/yarn-flow/:flow_uid'}); + this.route('yarn-flowrun', { path: '/yarn-flowrun/:flowrun_uid'}); + this.route('yarn-flowrun-metrics', { path: '/yarn-flowrun-metrics/:flowrun_uid'}); + this.route('yarn-flowrun-metric', { path: '/yarn-flowrun-metric/:flowrun_uid/:metric_id'}); + this.route('error'); this.route('notfound', { path: '*:' }); this.route('yarn-app-attempts', { path: '/yarn-app-attempts/:app_id' }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js index 07b3792..d540fb5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js @@ -28,7 +28,6 @@ export default Ember.Route.extend({ */ error: function (error) { Ember.Logger.log(error.stack); - if (error && error.errors[0] && error.errors[0].status == 404) { this.intermediateTransitionTo('/notfound'); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js index 1068126..7572249 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js @@ -41,4 +41,4 @@ export default AbstractRoute.extend({ this.store.unloadAll('yarn-app'); this.store.unloadAll('yarn-queue'); } -}); \ No newline at end of file +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js index e7f790b7..f4d38f3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js @@ -23,28 +23,11 @@ import AbstractRoute from './abstract'; export default AbstractRoute.extend({ model(param) { return Ember.RSVP.hash({ - attempt: this.store.findRecord('yarn-app-attempt', param.app_attempt_id), - - rmContainers: this.store.query('yarn-container', - { - app_attempt_id: param.app_attempt_id, - is_rm: true - }), - - tsContainers: this.store.query('yarn-container', - { - app_attempt_id: param.app_attempt_id, - is_rm: false - }).catch (function() { - // Promise rejected, fulfill with some default value to - // use as the route's model and continue on with the transition - return []; - }) + attempt: this.store.findRecord('yarn-app-attempt', param.app_attempt_id) }); }, unloadAll() { this.store.unloadAll('yarn-app-attempt'); - this.store.unloadAll('yarn-container'); } -}); \ No newline at end of file +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-appattempt-containers.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-appattempt-containers.js new file mode 100644 index 0000000..6c84fa5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-appattempt-containers.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 Ember from 'ember'; +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(params) { + return Ember.RSVP.hash({ + attempt: this.store.findRecord('yarn-app-attempt', params.app_attempt_id), + rmContainers: this.store.query('yarn-container', { + app_attempt_id: params.app_attempt_id, + is_rm: true + }), + tsContainers: this.store.query('yarn-timeline-container', { + app_attempt_id: params.app_attempt_id + }).catch(function() { + return []; + }) + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-app-attempt'); + this.store.unloadAll('yarn-container'); + this.store.unloadAll('yarn-timeline-container'); + } +}); 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 0ac503c..e6c0c11 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 @@ -24,7 +24,7 @@ export default AbstractRoute.extend({ model() { return Ember.RSVP.hash({ apps: this.store.findAll('yarn-app'), - clusterMetrics: this.store.findAll('ClusterMetric'), + clusterMetrics: this.store.findAll('ClusterMetric') }); }, 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..d006e6f 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,5 @@ 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-apps/services.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js index 8719170..d006e6f 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,5 @@ 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-flow-activity.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flow-activity.js new file mode 100644 index 0000000..a8c793f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flow-activity.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 Ember from 'ember'; +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model() { + return this.store.findAll('yarn-flow-activity'); + }, + + unloadAll() { + this.store.unloadAll('yarn-flow-activity'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flow.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flow.js new file mode 100644 index 0000000..189eff3 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flow.js @@ -0,0 +1,39 @@ +/** + * 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 AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(params) { + return Ember.RSVP.hash({ + data: this.store.query('yarn-flowrun-brief', {flowuid: params.flow_uid}), + flowUid: params.flow_uid + }); + }, + + setupController(controller, model) { + this._super(controller, model.data); + controller.set('flowUid', model.flowUid); + }, + + unloadAll() { + this.store.unloadAll('yarn-flowrun-brief'); + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flowrun-metric.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flowrun-metric.js new file mode 100644 index 0000000..03f08c1 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flowrun-metric.js @@ -0,0 +1,89 @@ +/** + * 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({ + model: function(params) { + var _this = this; + var appsArr = []; + var flowrun = _this.store.queryRecord('yarn-flowrun', {flowrun_uid: params.flowrun_uid, + metricstoretrieve: params.metric_id}).then(function(value) { + var apps = _this.store.query('yarn-app-flowrun', {flowrunUid: params.flowrun_uid, + metricstoretrieve: params.metric_id}).then(function(value) { + for (var i = 0; i < value.content.length; i++) { + var tasks = undefined; + // No need to fetch task or container info for Job counters. + if (params.metric_id.indexOf("JobCounter") == -1) { + var entityType = "MAPREDUCE_TASK"; + // CPU and MEMORY are container metrics. + if (params.metric_id == "CPU" || params.metric_id == "MEMORY") { + entityType = "YARN_CONTAINER"; + } + tasks = _this.store.query('yarn-entity', {app_uid: value.content[i]._data.uid, metricslimit: 100, + metricstoretrieve: params.metric_id, entity_type: entityType}).then(function(value) { + var tasksArr = []; + for (var j = 0; j < value.content.length; j++) { + tasksArr.push(Ember.RSVP.hash({id: value.content[j].id, metrics: value.content[j]._data.metrics})); + } + return Ember.RSVP.all(tasksArr); + }); + } + appsArr.push(Ember.RSVP.hash({id: value.content[i].id, tasks: tasks , metrics: value.content[i]._data.metrics})); + } + return Ember.RSVP.all(appsArr); + }); + return Ember.RSVP.hash({run: value, id: value.id, metrics: value._internalModel._data.metrics, apps: apps}); + }); + return Ember.RSVP.all([Ember.RSVP.hash({flowrun:flowrun, metricId: params.metric_id})]); + }, + + getMetricValue: function(metrics) { + var metricValue = 0; + if (metrics.length > 0) { + for (var j in metrics[0].values) { + metricValue = metrics[0].values[j]; + break; + } + } + console.log(metricValue); + return metricValue.toString(); + }, + + setupController: function(controller, model) { + var metricsArr = []; + var flowRunId = model[0].flowrun.id; + //console.log(model[0]); + //console.log(JSON.stringify(model[0].flowrun.metrics)); + metricsArr.push([model[0].flowrun.id, this.getMetricValue(model[0].flowrun.metrics)]); + for (var i = 0; i < model[0].flowrun.apps.length; i++) { + var appId = flowRunId + '-' + model[0].flowrun.apps[i].id; + metricsArr.push([appId, this.getMetricValue(model[0].flowrun.apps[i].metrics)]); + if (model[0].flowrun.apps[i].tasks) { + for (var j = 0; j < model[0].flowrun.apps[i].tasks.length; j++) { + var taskId = appId + '-' + model[0].flowrun.apps[i].tasks[j].id; + metricsArr.push([taskId, this.getMetricValue(model[0].flowrun.apps[i].tasks[j].metrics)]); + } + } + } + console.log(metricsArr); + controller.set('flowrun', model[0].flowrun); + controller.set('metric_id', model[0].metricId); + controller.set('arr', metricsArr); + }, +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flowrun-metrics.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flowrun-metrics.js new file mode 100644 index 0000000..02f6da0 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flowrun-metrics.js @@ -0,0 +1,42 @@ +/** + * 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 AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model(params) { + return Ember.RSVP.hash({ + flowrun: this.store.findRecord('yarn-flowrun', params.flowrun_uid), + flowrun_uid: params.flowrun_uid + }); + }, + + setupController(controller, model) { + this._super(controller, model); + controller.set('flowrun', model.flowrun); + controller.set('flowrunUid', model.flowrun_uid); + var parentFlowModel = this.modelFor('yarn-flow'); + var parentFlowId = parentFlowModel? parentFlowModel.flowUid : ''; + controller.set('parentFlowUid', parentFlowId); + }, + + unloadAll() { + this.store.unloadAll('yarn-flowrun'); + }, +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flowrun.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flowrun.js new file mode 100644 index 0000000..b83c989 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-flowrun.js @@ -0,0 +1,53 @@ +/** + * 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 AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + model: function(params) { + return Ember.RSVP.hash({ + flowrun: this.store.findRecord('yarn-flowrun', params.flowrun_uid), + apps: this.store.query('yarn-app-flowrun', {flowrunUid: params.flowrun_uid}), + flowrun_uid: params.flowrun_uid + }); + }, + + setupController: function(controller, model) { + controller.set('flowrun', model.flowrun); + controller.set('flowrun_uid', model.flowrun_uid); + controller.set('apps', model.apps); + var parentFlowModel = this.modelFor('yarn-flow'); + var parentFlowId = parentFlowModel? parentFlowModel.flowUid : ''; + model.parentFlowUid = parentFlowId; + controller.set('parentFlowUid', parentFlowId); + this._super(controller, model); + }, + + unloadAll: function() { + this.store.unloadAll('yarn-flowrun'); + this.store.unloadAll('yarn-app-flowrun'); + }, + + actions: { + reload: function() { + this.modelFor('apps').reload() + } + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-flowrun.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-flowrun.js new file mode 100644 index 0000000..e5a322e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-flowrun.js @@ -0,0 +1,53 @@ +/** + * 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({ + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, // yarn-app + attributes: { + appId: payload.id, + type: payload.info.YARN_APPLICATION_TYPE, + uid: payload.info.UID, + metrics: payload.metrics + } + }; + + return this._super(store, primaryModelClass, fixedPayload, id, + requestType); + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // 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.map(singleApp => { + return this.normalizeSingleResponse(store, primaryModelClass, + singleApp, singleApp.id, requestType); + }, this); + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-entity.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-entity.js new file mode 100644 index 0000000..9ae2dd3 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-entity.js @@ -0,0 +1,53 @@ +/** + * 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({ + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, // yarn-entity + attributes: { + entityId: payload.id, + type: payload.type, + uid: payload.info.UID, + metrics: payload.metrics + } + }; + + return this._super(store, primaryModelClass, fixedPayload, id, + requestType); + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // 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.map(singleApp => { + return this.normalizeSingleResponse(store, primaryModelClass, + singleApp, singleApp.id, requestType); + }, this); + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flow-activity.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flow-activity.js new file mode 100644 index 0000000..2c91aa4 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flow-activity.js @@ -0,0 +1,56 @@ +/** + * 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 Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, // yarn-timeline-flow + attributes: { + cluster: payload.info.SYSTEM_INFO_CLUSTER, + flowName: payload.info.SYSTEM_INFO_FLOW_NAME, + lastExecDate: Converter.timeStampToDateOnly(payload.info.SYSTEM_INFO_DATE), + user: payload.info.SYSTEM_INFO_USER, + flowruns: payload.flowruns, + uid: payload.info.UID + } + }; + + return this._super(store, primaryModelClass, fixedPayload, id, + requestType); + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // 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.map(singleEntity => { + return this.normalizeSingleResponse(store, primaryModelClass, + singleEntity, singleEntity.id, requestType); + }, this); + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun-brief.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun-brief.js new file mode 100644 index 0000000..178051a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun-brief.js @@ -0,0 +1,60 @@ +/** + * 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 Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var fixedPayload = { + id: id, + type: primaryModelClass.modelName, // yarn-app + attributes: { + flowName: payload.info.SYSTEM_INFO_FLOW_NAME, + runid: payload.info.SYSTEM_INFO_FLOW_RUN_ID, + shownid: payload.id, + type: payload.type, + createTime: Converter.timeStampToDate(payload.createdtime), + createTimeRaw: payload.createdtime, + endTime: Converter.timeStampToDate(payload.info.SYSTEM_INFO_FLOW_RUN_END_TIME), + endTimeRaw: payload.info.SYSTEM_INFO_FLOW_RUN_END_TIME, + user: payload.info.SYSTEM_INFO_USER, + uid: payload.info.UID + } + }; + + return this._super(store, primaryModelClass, fixedPayload, id, + requestType); + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // 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.map(singleApp => { + return this.normalizeSingleResponse(store, primaryModelClass, + singleApp, singleApp.id, requestType); + }, this); + return normalizedArrayResponse; + } +}); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun.js new file mode 100644 index 0000000..fa8f9b7 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun.js @@ -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. + */ + +import DS from 'ember-data'; +import Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + + internalNormalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var recordId = id; + if (!recordId) { + recordId = payload.id; + } + var fixedPayload = { + id: recordId, + type: primaryModelClass.modelName, + attributes: { + flowName: payload.info.SYSTEM_INFO_FLOW_NAME, + runid: payload.info.SYSTEM_INFO_FLOW_RUN_ID, + shownid: payload.id, + type: payload.type, + createTime: Converter.timeStampToDate(payload.createdtime), + endTime: Converter.timeStampToDate(payload.info.SYSTEM_INFO_FLOW_RUN_END_TIME), + user: payload.info.SYSTEM_INFO_USER, + metrics: payload.metrics, + } + }; + + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id, + requestType) { + var p = this.internalNormalizeSingleResponse(store, + primaryModelClass, payload, id, requestType); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, + requestType) { + // 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.map(singleApp => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, + singleApp, singleApp.id, requestType); + }, this); + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js new file mode 100644 index 0000000..e1c94d1 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js @@ -0,0 +1,66 @@ +/** + * 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 Converter from 'yarn-ui/utils/converter'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload, id, requestType) { + var payloadEvents = payload.events, + createdEvent = payloadEvents.filterBy('id', 'YARN_RM_CONTAINER_CREATED')[0], + startedTime = createdEvent? createdEvent.timestamp : Date.now(), + finishedEvent = payloadEvents.filterBy('id', 'YARN_RM_CONTAINER_FINISHED')[0], + finishedTime = finishedEvent? finishedEvent.timestamp : Date.now(); + + var fixedPayload = { + id: payload.id, + type: primaryModelClass.modelName, + attributes: { + allocatedMB: payload.info.YARN_CONTAINER_ALLOCATED_MEMORY, + allocatedVCores: payload.info.YARN_CONTAINER_ALLOCATED_VCORE, + assignedNodeId: payload.info.YARN_CONTAINER_ALLOCATED_HOST, + priority: payload.info.YARN_CONTAINER_ALLOCATED_PRIORITY, + startedTime: Converter.timeStampToDate(startedTime), + finishedTime: Converter.timeStampToDate(finishedTime), + nodeHttpAddress: payload.info.YARN_CONTAINER_ALLOCATED_HOST_HTTP_ADDRESS + } + }; + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id, requestType) { + var normalized = this.internalNormalizeSingleResponse(store, primaryModelClass, + payload, id, requestType); + return { + data: normalized + }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) { + var normalizedArrayResponse = { + data: [] + }; + if (payload && Ember.isArray(payload) && !Ember.isEmpty(payload)) { + normalizedArrayResponse.data = payload.map(singleContainer => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, + singleContainer, singleContainer.id, requestType); + }); + } + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.css b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.css index 57c6c7c..977116f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.css +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/styles/app.css @@ -277,3 +277,45 @@ li a.navigation-link.ember-view { .x-scroll { overflow-x: scroll; } + +#main { + float: left; + width: 750px; +} + +#sidebar { + float: right; + width: 100px; +} + +#sequence { + width: 600px; + height: 70px; +} + +#legend { + padding: 10px 0 0 3px; +} + +#sequence text, #legend text { + font-weight: 600; + fill: #fff; +} + +#chart { + position: relative; +} + +#chart path { + stroke: #fff; +} + +#explanation { + position: absolute; + top: 360px; + left: 385px; + width: 230px; + text-align: center; + color: #666; + z-index: -1; +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs index 7783db4..b6fe4c3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs @@ -51,6 +51,11 @@ (current) {{/link-to}} {{/link-to}} + {{#link-to 'yarn-flow-activity' tagName="li"}} + {{#link-to 'yarn-flow-activity' class="navigation-link"}}Flow Activity + (current) + {{/link-to}} + {{/link-to}} {{#link-to 'yarn-nodes.table' tagName="li"}} {{#link-to 'yarn-nodes.table' class="navigation-link"}}Nodes (current) @@ -68,7 +73,6 @@


    -
    +
    -

    -
    -
    - - -
    -
    -
    - {{#if selected.link}} - {{#link-to selected.linkname selected.id}}{{selected.id}}{{/link-to}} - {{else}} - {{selected.id}} - {{/if}} +
    +
    +

    +
    + +
    +
    +
    + {{#if selected.link}} + {{#link-to selected.linkname selected.id}}{{selected.id}}{{/link-to}} + {{else}} + {{selected.id}} + {{/if}} +
    + {{#if attemptModel}} + {{app-attempt-table attempt=selected}} + {{else}} + {{container-table container=selected}} + {{/if}} +
    - {{#if attemptModel}} - {{app-attempt-table attempt=selected}} - {{else}} - {{container-table container=selected}} - {{/if}} +
    +
    + {{em-table columns=gridColumns rows=gridRows}}
    -{{outlet}} \ No newline at end of file +{{outlet}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs index 1dbae9a..1c08383 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs @@ -18,26 +18,41 @@ {{breadcrumb-bar breadcrumbs=breadcrumbs}}


    -
    -
    - {{#if model.attempt}} -
    +
    +
    +
    +
    +
    + Application Attempts +
    +
    +
    + +
    +
    +
    +
    +
    + {{#if model.attempt}}
    - Application attempt Information + Application Attempt Information
    {{app-attempt-table attempt=model.attempt}}
    -
    - {{/if}} -
    - - -
    - {{#if (or model.rmContainers model.tsContainers)}} - {{timeline-view parent-id="containers-timeline-div" my-id="timeline-view" height="400" rmModel=model.rmContainers tsModel=model.tsContainers label="shortAppAttemptId" attemptModel=false}} - {{/if}} + {{/if}} +
    +
    + {{outlet}} +
    - -{{outlet}} \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-appattempt-containers.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-appattempt-containers.hbs new file mode 100644 index 0000000..93378a0 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-appattempt-containers.hbs @@ -0,0 +1,50 @@ +{{! + * 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. +}} + +{{breadcrumb-bar breadcrumbs=breadcrumbs}} + +
    +
    +
    +
    +
    + Application Attempts +
    +
    +
    + +
    +
    +
    +
    +
    + {{#if (or model.rmContainers model.tsContainers)}} + {{timeline-view parent-id="containers-timeline-div" my-id="timeline-view" height="400" rmModel=model.rmContainers tsModel=model.tsContainers label="shortAppAttemptId" attemptModel=false}} + {{/if}} +
    +
    +
    diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps.hbs index d5f6347..ec78e6e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps.hbs @@ -24,18 +24,18 @@
    -

    Application

    +
    + YARN Applications +
    @@ -44,7 +44,7 @@
    - {{#if model.clusterMetrics}} + {{#if (and model.clusterMetrics)}}
    @@ -87,4 +87,4 @@
    -
    \ No newline at end of file +
    diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flow-activity.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flow-activity.hbs new file mode 100644 index 0000000..c9b682c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flow-activity.hbs @@ -0,0 +1,45 @@ +{{!-- + 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. +--}} + +
    +
    + {{breadcrumb-bar breadcrumbs=breadcrumbs}} +
    +
    +
    +
    +
    + Flow Activity +
    +
    + +
    +
    +
    +
    +

    Recent Flow Activities

    + {{em-table columns=columns rows=rows definition=tableDefinition}} +
    +
    +
    + +{{outlet}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flow.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flow.hbs new file mode 100644 index 0000000..c74220d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flow.hbs @@ -0,0 +1,58 @@ +{{!-- + 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. +--}} + +
    +
    + {{breadcrumb-bar breadcrumbs=breadcrumbs}} +
    +
    +
    +
    +
    +
    + Flow Information +
    +
    +
    + +
    +
    +
    +
    +

    Flow {{flowName}}

    +
      +
    • + First run started {{earliestStartTime}} +
    • +
    • + Last run finished {{latestFinishTime}} +
    • +
    + +

    Runs in this flow

    + {{em-table columns=columns rows=rows definition=tableDefinition}} + {{outlet}} +
    +
    +
    diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flowrun-metric.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flowrun-metric.hbs new file mode 100644 index 0000000..d0256c7 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flowrun-metric.hbs @@ -0,0 +1,16 @@ +
    +
    +

    Sunburst chart for Metric "{{metric_id}}"

    +

    (Flowrun: {{flowrun.id}})

    +
    +
    +
    + +
    +
    +
    +
    +{{sunburst-chart arr=arr}} +{{outlet}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flowrun-metrics.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flowrun-metrics.hbs new file mode 100644 index 0000000..c6ea461 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flowrun-metrics.hbs @@ -0,0 +1,63 @@ +{{! + * 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. +}} + +
    +
    + {{breadcrumb-bar breadcrumbs=breadcrumbs}} +
    +
    +
    +
    +
    +
    + Flow Run Information +
    +
    +
    + +
    +
    +
    +
    +

    Flow Run {{flowrun.shownid}}

    + {{#if flowrun.metrics}} + {{single-metric-table metrics=flowrun.metrics uid=flowrunUid}} + {{else}} +
    +
    +
    +
    + No Metrics Available!!! +
    +
    +
    +
    + {{/if}} + {{outlet}} +
    +
    +
    diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flowrun.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flowrun.hbs new file mode 100644 index 0000000..52c3e6d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-flowrun.hbs @@ -0,0 +1,67 @@ +{{!-- + 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. +--}} + +
    +
    + {{breadcrumb-bar breadcrumbs=breadcrumbs}} +
    +
    +
    +
    +
    +
    + Flow Run Information +
    +
    +
    + +
    +
    +
    +
    +

    Flow Run {{flowrun.shownid}}

    +
      +
    • + Flow name {{flowrun.flowName}}, run sequence id: {{flowrun.runid}} +
    • +
    • + Launched by: {{flowrun.user}} +
    • +
    • + Start time: {{flowrun.createTime}} +
    • +
    • + End time: {{flowrun.endTime}} +
    • +
    + +

    Applications

    + {{em-table columns=columns rows=rows}} + {{outlet}} +
    +
    +
    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 ed5522e..9926999 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 @@ -22,7 +22,9 @@
    -

    Nodes

    +
    + Nodes +