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-2252. Tez UI: in graphical view some of the sinks are hidden as they overlap (Sreenath Somarajapuram via pramachandran)
Date Mon, 13 Apr 2015 11:30:24 GMT
Repository: tez
Updated Branches:
  refs/heads/master f719c7bc5 -> cb6721b7f


TEZ-2252. Tez UI: in graphical view some of the sinks are hidden as they overlap (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/cb6721b7
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/cb6721b7
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/cb6721b7

Branch: refs/heads/master
Commit: cb6721b7f515fdfe09163324d2e485e283be857a
Parents: f719c7b
Author: Prakash Ramachandran <pramachandran@hortonworks.com>
Authored: Mon Apr 13 16:59:55 2015 +0530
Committer: Prakash Ramachandran <pramachandran@hortonworks.com>
Committed: Mon Apr 13 16:59:55 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../components/dag-view/data-processor.js       | 45 +++++++++++++++++---
 .../scripts/components/dag-view/graph-view.js   |  4 +-
 3 files changed, 41 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/cb6721b7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 882f1f9..df8b06c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,6 +9,7 @@ INCOMPATIBLE CHANGES
   TEZ-1993. Implement a pluggable InputSizeEstimator for grouping fairly
 
 ALL CHANGES:
+  TEZ-2252. Tez UI: in graphical view some of the sinks are hidden as they overlap
   TEZ-2275. Tez UI: enable faster loading and caching of data in tables
   TEZ-2234. Add API for statistics information - allow vertex managers to get
   output size per source vertex

http://git-wip-us.apache.org/repos/asf/tez/blob/cb6721b7/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 362a602..53bb7c9 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
@@ -167,6 +167,33 @@ App.DagViewComponent.dataProcessor = (function (){
   };
 
   /**
+   * Iterates the array in a symmetric order, from middle to outwards
+   * @param array {Array} Array to be iterated
+   * @param callback {Function} Function to be called for each item
+   * @return A new array created with value returned by callback
+   */
+  function centericMap(array, callback) {
+    var retArray = [],
+        length,
+        left, right;
+
+    if(array) {
+      length = array.length - 1,
+      left = length >> 1;
+
+      while(left >= 0) {
+        retArray[left] = callback(array[left]);
+        right = length - left;
+        if(right != left) {
+          retArray[right] = callback(array[right]);
+        }
+        left--;
+      }
+    }
+    return retArray;
+  }
+
+  /**
    * Abstract class for all types of data nodes
    */
   var DataNode = Em.Object.extend({
@@ -425,13 +452,12 @@ App.DagViewComponent.dataProcessor = (function (){
    * @param vertex {VertexDataNode}
    */
   function _treefyData(vertex, depth) {
-    var children = [],
-        parentChildren,
-        inputDepth;
+    var children,
+        parentChildren;
 
     depth++;
 
-    vertex.ifForEach('inEdgeIds', function (edgeId) {
+    children = centericMap(vertex.get('inEdgeIds'), function (edgeId) {
       var child = _data.vertices.get(_data.edges.get(edgeId).get('inputVertexName'));
       if(!child.isSelfOrAncestor(vertex)) {
         if(child.depth) {
@@ -446,10 +472,15 @@ App.DagViewComponent.dataProcessor = (function (){
           }
         }
         child.setParent(vertex);
-        children.push(_treefyData(child, depth));
+        return _treefyData(child, depth);
       }
     });
 
+    // Remove undefined entries
+    children = children.filter(function (child) {
+      return child;
+    });
+
     vertex.setDepth(depth);
     children.push.apply(children, vertex.get('inputs'));
 
@@ -481,7 +512,7 @@ App.DagViewComponent.dataProcessor = (function (){
 
     // For a symmetric display of output nodes
     if(childVertices && childVertices.length) {
-      midIndex = Math.ceil(childVertices.length / 2);
+      midIndex = Math.floor(childVertices.length / 2);
       if(childVertices.length % 2 == 0) {
         midIndex--;
       }
@@ -676,7 +707,7 @@ App.DagViewComponent.dataProcessor = (function (){
         return "Sink vertex not found!";
       }
 
-      dummy._setChildren(_data.rootVertices.map(function (vertex) {
+      dummy._setChildren(centericMap(_data.rootVertices, function (vertex) {
         return _treefyData(vertex, 2);
       }));
 

http://git-wip-us.apache.org/repos/asf/tez/blob/cb6721b7/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 c3c090b..6b54ce4 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
@@ -329,13 +329,13 @@ App.DagViewComponent.graphView = (function (){
     if(rootChildCount % 2 == 0) {
       dummyIndex = rootChildren.indexOf(_treeData.get('dummy'));
       if(dummyIndex >= rootChildCount / 2) {
-        for(var i = dummyIndex - 1; i >= 0; i--) {
+        for(var i = 0; i < dummyIndex; i++) {
           rootChildren[i].x = rootChildren[i + 1].x,
           rootChildren[i].y = rootChildren[i + 1].y;
         }
       }
       else {
-        for(var i = dummyIndex + 1; i < rootChildCount; i++) {
+        for(var i = rootChildCount - 1; i > dummyIndex; i--) {
           rootChildren[i].x = rootChildren[i - 1].x,
           rootChildren[i].y = rootChildren[i - 1].y;
         }


Mime
View raw message