Repository: tez Updated Branches: refs/heads/branch-0.7 b99bd29b7 -> 896861301
TEZ-2929. Tez UI: Dag details page displays vertices to be running even when dag have completed (sree) (cherry picked from commit 38b39003ba23a36f34bfb6fd015542964ab89999) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/89686130 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/89686130 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/89686130 Branch: refs/heads/branch-0.7 Commit: 89686130127279bd8b0200cf1fc58c834808a3e5 Parents: b99bd29 Author: Sreenath Somarajapuram <s...@apache.org> Authored: Sun Nov 8 07:59:11 2015 +0530 Committer: Sreenath Somarajapuram <s...@apache.org> Committed: Sun Nov 8 08:00:59 2015 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../scripts/controllers/dag_index_controller.js | 47 ++++++++++++++++++-- .../scripts/helpers/entity-array-pollster.js | 4 +- 3 files changed, 47 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/89686130/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 0049610..4714ff0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES TEZ-2679. Admin forms of launch env settings ALL CHANGES + TEZ-2929. Tez UI: Dag details page displays vertices to be running even when dag have completed TEZ-2927. Tez UI: Graciously fail when system-metrics-publisher is disabled TEZ-2915. Tez UI: Getting back to the DAG details page is difficult TEZ-2895. Tez UI: Add option to enable and disable in-progress http://git-wip-us.apache.org/repos/asf/tez/blob/89686130/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js index 61b4912..45a82ff 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js @@ -28,6 +28,9 @@ App.DagIndexController = App.TablePageController.extend({ pollingType: 'vertexInfo', + _isRunning: false, + _autoReloaded: false, + init: function () { this._super(); this.set('pollster.mergeProperties', ['progress', 'status', 'runningTasks', 'pendingTasks', @@ -37,23 +40,61 @@ App.DagIndexController = App.TablePageController.extend({ reset: function () { this._super(); this.set('data', null); + this.set('_autoReloaded', false); }, + _statusObserver: function () { + var rowsDisplayed, + isRunning = false; + + if(this.get('status') == 'RUNNING') { + isRunning = true; + } + else if(rowsDisplayed = this.get('rowsDisplayed')){ + rowsDisplayed.forEach(function (row) { + if(row.get('status') == 'RUNNING') { + isRunning = true; + } + }); + } + + this.set('_isRunning', isRunning); + }.observes('status', 'rowsDisplayed.@each.status'), + + pollingObserver: function () { + if(this.get('pollingEnabled')) { + this.set('_autoReloaded', false); + } + }.observes('pollingEnabled'), + pollsterControl: function () { - if(this.get('status') == 'RUNNING' && + if(this.get('_isRunning') && this.get('amWebServiceVersion') != '1' && !this.get('loading') && this.get('isActive') && this.get('pollingEnabled') && this.get('rowsDisplayed.length') > 0) { - this.get('pollster').start(); + this.get('pollster').start(!this.get('_autoReloaded')); } else { this.get('pollster').stop(); } - }.observes('status', 'amWebServiceVersion', 'loading', 'isActive', 'pollingEnabled'), + }.observes('_isRunning', 'amWebServiceVersion', 'loading', 'isActive', 'pollingEnabled'), + + parentStatusObserver: function () { + var parentStatus = this.get('status'), + previousStatus = this.get('parentStatus'); + + if(parentStatus != previousStatus && previousStatus == 'RUNNING' && this.get('pollingEnabled')) { + this.get('pollster').stop(); + this.set('_autoReloaded', true); + this.loadData(true); + } + this.set('parentStatus', parentStatus); + }.observes('status'), applicationComplete: function () { + this.set('_autoReloaded', true); this._super(); if(this.get('controllers.dag.status') == 'SUCCEEDED') { this.set('controllers.dag.progress', 1); http://git-wip-us.apache.org/repos/asf/tez/blob/89686130/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js b/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js index 8557b56..ca81d19 100644 --- a/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js +++ b/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js @@ -35,10 +35,10 @@ App.Helpers.EntityArrayPollster = App.Helpers.Pollster.extend({ this.get('targetRecords.length'); }.property('entityType', 'store', 'options', 'targetRecords.length'), - start: function(interval) { + start: function(runImmediate, interval) { if(!this.get('isRunning')) { this.set('isRunning', true); - this._super(true, interval); + this._super(runImmediate == undefined ? true : runImmediate, interval); } },