You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2014/02/27 20:29:50 UTC

git commit: AMBARI-4875. Job details UI keeps flashing every 6s. (srimanth)

Repository: ambari
Updated Branches:
  refs/heads/trunk a8884594e -> f5dc33261


AMBARI-4875. Job details UI keeps flashing every 6s. (srimanth)


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

Branch: refs/heads/trunk
Commit: f5dc33261e672227955080aba3ca32365312a31b
Parents: a888459
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Thu Feb 27 11:23:09 2014 -0800
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Thu Feb 27 11:23:16 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/mappers/jobs/hive_job_mapper.js | 27 ++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f5dc3326/ambari-web/app/mappers/jobs/hive_job_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/jobs/hive_job_mapper.js b/ambari-web/app/mappers/jobs/hive_job_mapper.js
index cb14ccb..2681d82 100644
--- a/ambari-web/app/mappers/jobs/hive_job_mapper.js
+++ b/ambari-web/app/mappers/jobs/hive_job_mapper.js
@@ -155,9 +155,30 @@ App.hiveJobMapper = App.QuickDataMapper.create({
             vertices : vertexIds,
             edges : edgeIds
           }
-          App.store.loadMany(App.TezDagVertex, vertices);
-          App.store.loadMany(App.TezDagEdge, edges);
-          App.store.load(App.TezDag, tezDag);
+          // Once the DAG is loaded, we do not need to
+          // reload as the structure does not change. Reloading
+          // here causes missing data (got from other calls)
+          // to propagate into UI - causing flashing.
+          var newVertices = [];
+          var newEdges = [];
+          vertices.forEach(function(v) {
+            var vertexRecord = App.TezDagVertex.find(v.id);
+            if (!vertexRecord.get('isLoaded')) {
+              newVertices.push(v);
+            }
+          });
+          edges.forEach(function(e) {
+            var edgeRecord = App.TezDagEdge.find(e.id);
+            if (!edgeRecord.get('isLoaded')) {
+              newEdges.push(e);
+            }
+          });
+          App.store.loadMany(App.TezDagVertex, newVertices);
+          App.store.loadMany(App.TezDagEdge, newEdges);
+          var dagRecord = App.TezDag.find(tezDag.id);
+          if (!dagRecord.get('isLoaded')) {
+            App.store.load(App.TezDag, tezDag);
+          }
           hiveJob.tezDag = tezDag.id;
         }
       }