tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prak...@apache.org
Subject tez git commit: TEZ-2829. Tez UI: minor fixes to in-progress update of UI from AM (pramachandran)
Date Wed, 16 Sep 2015 02:56:25 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.7 d382117a7 -> fd7c2fc13


TEZ-2829. Tez UI: minor fixes to in-progress update of UI from AM (pramachandran)

(cherry picked from commit 6b43887d66333fa91d92956001cee190bab2a83a)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/fd7c2fc1
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/fd7c2fc1
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/fd7c2fc1

Branch: refs/heads/branch-0.7
Commit: fd7c2fc1356559008e08b4243c7e8e260a3236b6
Parents: d382117
Author: Prakash Ramachandran <pramachandran@hortonworks.com>
Authored: Wed Sep 16 08:15:06 2015 +0530
Committer: Prakash Ramachandran <pramachandran@hortonworks.com>
Committed: Wed Sep 16 08:21:42 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../app/scripts/controllers/dag_controller.js   | 15 ++++++++++++-
 .../scripts/controllers/dag_index_controller.js | 13 +++++++++++-
 .../app/scripts/controllers/dag_vertices.js     | 22 +++++++++++++-------
 .../scripts/helpers/entity-array-pollster.js    |  2 ++
 5 files changed, 43 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/fd7c2fc1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3e6df02..9c8bde4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,7 @@ Release 0.7.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2829. Tez UI: minor fixes to in-progress update of UI from AM
   TEZ-2663. SessionNotRunning exceptions are wrapped in a ServiceException from a dying AM.
   TEZ-2825. Report progress in terms of completed tasks to reduce load on AM for Tez UI
   TEZ-2812. Tez UI: Update task & attempt tables while in progress.

http://git-wip-us.apache.org/repos/asf/tez/blob/fd7c2fc1/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
index cd750d0..334c72a 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
@@ -73,7 +73,7 @@ App.DagController = Em.ObjectController.extend(App.Helpers.DisplayHelper,
{
       });
       if (dag.get('status') === 'RUNNING') {
         // update the progress info if available. this need not block the UI
-        if (dag.get('amWebServiceVersion') == 'v1') {
+        if (dag.get('amWebServiceVersion') == '1') {
           that.updateInfoFromAM(dag);
         } else {
           // if AM version is v2 we keep updating the status, progress etc live.
@@ -88,6 +88,19 @@ App.DagController = Em.ObjectController.extend(App.Helpers.DisplayHelper,
{
     return allLoaders;
   },
 
+  // called only for v1 version of am api.
+  updateInfoFromAM: function(dag) {
+    var that = this;
+    var aminfoLoader = this.store.find('dagProgress', dag.get('id'), {
+      appId: dag.get('applicationId'),
+      dagIdx: dag.get('idx')
+    }).then(function(dagProgressInfo) {
+      that.set('amDagInfo', dagProgressInfo);
+    }).catch(function (error) {
+      Em.Logger.error("Failed to fetch dagProgress" + e);
+    });
+  },
+
   updateAMDagInfo: function() {
     var dagId = this.get('id')
         that = this,

http://git-wip-us.apache.org/repos/asf/tez/blob/fd7c2fc1/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 35b59db..a85c707 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
@@ -248,9 +248,20 @@ App.DagIndexController = Em.ObjectController.extend(App.ModelRefreshMixin,
{
 
   updateAMInfo: function() {
     var status = this.get('amDagInfo.status');
+        progress = this.get('amDagInfo.progress'),
+        infoUpdated = false;
     if (!Em.isNone(status)) {
       this.set('status', status);
-      this.set('progress', this.get('amDagInfo.progress'));
+      infoUpdated = true;
+    }
+
+    if (!Em.isNone(progress)) {
+      this.set('progress', progress);
+      infoUpdated = true;
+    }
+
+    if (infoUpdated) {
+      Em.tryInvoke(this.get('model'), 'didLoad');
     }
   }.observes('amDagInfo', 'amDagInfo._amInfoLastUpdatedTime')
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/fd7c2fc1/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js
index 5f60d5d..087eaa8 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js
@@ -52,14 +52,14 @@ App.DagVerticesController = App.TablePageController.extend({
       });
     }
 
-    if (this.get('controllers.dag.amWebServiceVersion') == 'v1') {
+    if (this.get('controllers.dag.amWebServiceVersion') == '1') {
       this._loadProgress(data);
     }
 
     return this._super();
   },
 
-  // Load progress in parallel
+  // Load progress in parallel for v1 version of the api
   _loadProgress: function (vertices) {
     var that = this,
         runningVerticesIdx = vertices
@@ -74,8 +74,7 @@ App.DagVerticesController = App.TablePageController.extend({
         metadata: {
           appId: that.get('applicationId'),
           dagIdx: that.get('idx'),
-          vertexIds: runningVerticesIdx.join(','),
-          counters: counters
+          vertexIds: runningVerticesIdx.join(',')
         }
       }).then(function(vertexProgressInfo) {
         that.set('controllers.dag.amVertexInfo', vertexProgressInfo);
@@ -92,11 +91,18 @@ App.DagVerticesController = App.TablePageController.extend({
   overlayVertexInfo: function(vertex, amVertexInfo) {
     if (Em.isNone(amVertexInfo) || Em.isNone(vertex)) return;
     amVertexInfo.set('_amInfoLastUpdatedTime', moment());
-    vertex.setProperties(amVertexInfo.getProperties('status', 'progress', '_amInfoLastUpdatedTime'));
 
-    vertex.set('counterGroups',
-      App.Helpers.misc.mergeCounterInfo(vertex.get('counterGroups'), amVertexInfo.get('counters')).slice(0)
-    );
+    var props = ['progress', '_amInfoLastUpdatedTime']; 
+    if (this.get('controllers.dag.amWebServiceVersion') != '1') {
+      // status is not available for v1 version.
+      props.push('status')
+    }
+    var propValues = amVertexInfo.getProperties(props);
+    propValues['counterGroups'] = App.Helpers.misc.mergeCounterInfo(vertex.get('counterGroups'),
+                                    amVertexInfo.get('counters')).slice(0);
+    vertex.setProperties(propValues);
+
+    Em.tryInvoke(vertex, 'didLoad');
   },
 
   updateVertexInfo: function() {

http://git-wip-us.apache.org/repos/asf/tez/blob/fd7c2fc1/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 fb3dd76..10e217f 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
@@ -100,6 +100,8 @@ App.Helpers.EntityArrayPollster = App.Helpers.Pollster.extend({
         var info = polledRecords.findBy('id', row.get('id')),
              merge = !!info;
 
+        row.didLoad();
+
         if(merge && row.get('progress') && info.get('progress')) {
           if(row.get('progress') >= info.get('progress')) {
             merge = false;


Mime
View raw message