Repository: tez Updated Branches: refs/heads/master b59b6a9b6 -> 12fc2c708
TEZ-2455. Tez UI: Dag view caching, error handling and minor layout changes (Sreenath Somarajapuram via pramachandran) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/12fc2c70 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/12fc2c70 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/12fc2c70 Branch: refs/heads/master Commit: 12fc2c70858ac88459436334a34bc69f7ddf9589 Parents: b59b6a9 Author: Prakash Ramachandran <[email protected]> Authored: Mon May 18 16:30:21 2015 +0530 Committer: Prakash Ramachandran <[email protected]> Committed: Mon May 18 16:30:21 2015 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../components/dag-view/data-processor.js | 9 +++ .../scripts/components/dag-view/graph-view.js | 11 ++++ .../app/scripts/components/dag-view/tip.js | 1 + .../scripts/controllers/dag-view-controller.js | 63 ++++++++++---------- .../main/webapp/app/scripts/helpers/number.js | 2 + .../scripts/mixins/data-array-loader-minxin.js | 2 +- .../app/scripts/mixins/paginated_content.js | 5 +- .../src/main/webapp/app/templates/dag/view.hbs | 2 +- 9 files changed, 60 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/12fc2c70/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 8697dc9..21ae041 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -18,6 +18,7 @@ Release 0.7.1: Unreleased INCOMPATIBLE CHANGES ALL CHANGES: + TEZ-2455. Tez UI: Dag view caching, error handling and minor layout changes TEZ-2453. Tez UI: show the dagInfo is the application has set the same. TEZ-2447. Tez UI: Generic changes based on feedbacks. http://git-wip-us.apache.org/repos/asf/tez/blob/12fc2c70/tez-ui/src/main/webapp/app/scripts/components/dag-view/data-processor.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/components/dag-view/data-processor.js b/tez-ui/src/main/webapp/app/scripts/components/dag-view/data-processor.js index 53bb7c9..e145fc1 100644 --- a/tez-ui/src/main/webapp/app/scripts/components/dag-view/data-processor.js +++ b/tez-ui/src/main/webapp/app/scripts/components/dag-view/data-processor.js @@ -482,6 +482,15 @@ App.DagViewComponent.dataProcessor = (function (){ }); vertex.setDepth(depth); + + // Adds a dummy child to intermediate inputs so that they + // gets equal relevance as adjacent nodes on plotting the tree! + if(children.length) { + vertex.ifForEach('inputs', function (input) { + input._setChildren([DataNode.create()]); + }); + } + children.push.apply(children, vertex.get('inputs')); vertex._setChildren(children); http://git-wip-us.apache.org/repos/asf/tez/blob/12fc2c70/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js b/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js index f3a87fd..1f8504b 100644 --- a/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js +++ b/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js @@ -344,6 +344,17 @@ App.DagViewComponent.graphView = (function (){ } } } + + // Put all single vertex outputs in-line with the vertex node + // So that they are directly below the respective vertex in vertical layout + nodes.forEach(function (node) { + if(node.type == App.DagViewComponent.dataProcessor.types.OUTPUT && + node.get('vertex.outputs.length') == 1 && + node.get('treeParent.x') != node.get('x') + ) { + node.x = node.get('vertex.x'); + } + }); } function _getType(node) { http://git-wip-us.apache.org/repos/asf/tez/blob/12fc2c70/tez-ui/src/main/webapp/app/scripts/components/dag-view/tip.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/components/dag-view/tip.js b/tez-ui/src/main/webapp/app/scripts/components/dag-view/tip.js index e26223d..44c8bb5 100644 --- a/tez-ui/src/main/webapp/app/scripts/components/dag-view/tip.js +++ b/tez-ui/src/main/webapp/app/scripts/components/dag-view/tip.js @@ -78,6 +78,7 @@ App.DagViewComponent.tip = (function () { function _setData(data) { _element.find('.tip-title').html(data.title || ""); _element.find('.tip-text').html(data.text || ""); + _element.find('.tip-text')[data.text ? 'show' : 'hide'](); _element.find('.tip-list').html(_createList(data.kvList) || ""); } http://git-wip-us.apache.org/repos/asf/tez/blob/12fc2c70/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js index a748cdf..5241060 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js @@ -16,43 +16,40 @@ * limitations under the License. */ -App.DagViewController = Em.ObjectController.extend(App.PaginatedContentMixin, App.ColumnSelectorMixin, { +App.DagViewController = App.TablePageController.extend({ controllerName: 'DagViewController', + needs: ["dag", "dagVertices"], - childEntityType: 'vertex', + entityType: 'dagVertex', + filterEntityType: 'dag', + filterEntityId: Ember.computed.alias('controllers.dag.id'), - needs: ["dag", "dagVertices"], - pageTitle: 'Dag View', + cacheDomain: Ember.computed.alias('controllers.dag.id'), columnSelectorTitle: 'Customize vertex tooltip', - count: Number.MAX_SAFE_INTEGER - 1, + beforeLoad: function () { + var dagController = this.get('controllers.dag'), + model = dagController.get('model'); + return model.reload().then(function () { + return dagController.loadAdditional(model); + }); + }, + + afterLoad: function () { + var data = this.get('data'), + runningVerticesIdx, + isUnsuccessfulDag = App.Helpers.misc.isStatusInUnsuccessful( + this.get('controllers.dag.status') + ); - loadData: function() { - var filters = { - primary: { - TEZ_DAG_ID: this.get('controllers.dag.id') - } + if(isUnsuccessfulDag) { + data.filterBy('status', 'RUNNING').forEach(function (vertex) { + vertex.set('status', 'KILLED'); + }); } - this.setFiltersAndLoadEntities(filters); - }, - load: function () { - var dag = this.get('controllers.dag.model'), - controller = this.get('controllers.dag'), - t = this; - t.set('loading', true); - dag.reload().then(function () { - return controller.loadAdditional(dag); - }).then(function () { - t.resetNavigation(); - t.loadEntities(); - }).catch(function(error){ - Em.Logger.error(error); - var err = App.Helpers.misc.formatError(error, defaultErrMsg); - var msg = 'error code: %@, message: %@'.fmt(err.errCode, err.msg); - App.Helpers.ErrorBar.getInstance().show(msg, err.details); - }); + return this._super(); }, actions: { @@ -85,13 +82,13 @@ App.DagViewController = Em.ObjectController.extend(App.PaginatedContentMixin, Ap var configs = this.get('controllers.dagVertices.columnConfigs'); return configs.filter(function (config) { return (config.contentPath) || - (config.getCellContent && !config.tableCellViewClass); + (config.getCellContent && config.searchAndSortable != false); }); }.property(), viewData: function () { - var vertices = this.get('controllers.dag.vertices'), - entities = this.get('entities'), + var vertices = this.get('controllers.dag.vertices') || [], + entities = this.get('data') || [], finalVertex, dagStatus = this.get('controllers.dag.status'), needsStatusFixup = App.Helpers.misc.isStatusInUnsuccessful(dagStatus); @@ -103,7 +100,7 @@ App.DagViewController = Em.ObjectController.extend(App.PaginatedContentMixin, Ap vertices.forEach(function (vertex) { vertex.data = entities[vertex.vertexName]; - if (needsStatusFixup && vertex.data.get('status') == 'RUNNING') { + if (needsStatusFixup && vertex.data && vertex.data.get('status') == 'RUNNING') { vertex.data.set('status', 'KILLED'); } }); @@ -113,5 +110,5 @@ App.DagViewController = Em.ObjectController.extend(App.PaginatedContentMixin, Ap edges: this.get('controllers.dag.edges'), vertexGroups: this.get('controllers.dag.vertexGroups') }; - }.property('entities') + }.property('data', 'controllers.dag.vertices', 'controllers.dag') }); http://git-wip-us.apache.org/repos/asf/tez/blob/12fc2c70/tez-ui/src/main/webapp/app/scripts/helpers/number.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/helpers/number.js b/tez-ui/src/main/webapp/app/scripts/helpers/number.js index 912e8f5..3e5b3d3 100644 --- a/tez-ui/src/main/webapp/app/scripts/helpers/number.js +++ b/tez-ui/src/main/webapp/app/scripts/helpers/number.js @@ -17,6 +17,8 @@ App.Helpers.number = { + MAX_SAFE_INTEGER: 9007199254740991, + /** * Convert byte size to other metrics. * http://git-wip-us.apache.org/repos/asf/tez/blob/12fc2c70/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js b/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js index e5dbbf9..ce9831c 100644 --- a/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js +++ b/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js @@ -41,7 +41,7 @@ App.DataArrayLoaderMixin = Em.Mixin.create({ getFilter: function (limit) { return { - limit: limit || Number.MAX_SAFE_INTEGER - 1, + limit: limit || App.Helpers.number.MAX_SAFE_INTEGER, primaryFilter: '%@:%@'.fmt( App.Helpers.misc.getTimelineFilterForType(this.get('filterEntityType')), this.get('filterEntityId') http://git-wip-us.apache.org/repos/asf/tez/blob/12fc2c70/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js b/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js index 13e27cc..3acce39 100644 --- a/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js +++ b/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js @@ -26,6 +26,9 @@ App.PaginatedContentMixin = Em.Mixin.create({ // The dropdown contents for number of items to show. rowCountOptions: [5, 10, 25, 50, 100], + maxRowCount: function () { + return Math.max.apply(null, this.get('rowCountOptions')); + }.property('rowCountOptions'), isRefreshable: true, @@ -148,7 +151,7 @@ App.PaginatedContentMixin = Em.Mixin.create({ getFilterProperties: function() { var params = { - limit: this.rowCount + 1 + limit: Math.min(this.rowCount, this.get('maxRowCount')) + 1 }; var f = this._paginationFilters; http://git-wip-us.apache.org/repos/asf/tez/blob/12fc2c70/tez-ui/src/main/webapp/app/templates/dag/view.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/dag/view.hbs b/tez-ui/src/main/webapp/app/templates/dag/view.hbs index 3ea27c7..9c5e2e4 100644 --- a/tez-ui/src/main/webapp/app/templates/dag/view.hbs +++ b/tez-ui/src/main/webapp/app/templates/dag/view.hbs @@ -19,7 +19,7 @@ <div {{bind-attr class=":margin-small-vertical loading:no-visible"}}> {{load-time-component isRefreshable=isRefreshable - time=entities.content.0.timeStamp + time=data.content.0.timeStamp refresh='refresh' }} </div>
