falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venkat...@apache.org
Subject [3/3] git commit: FALCON-203 Do not generate transitive closure for the dependency graph. Contributed by Haohui Mai
Date Fri, 15 Nov 2013 22:33:26 GMT
FALCON-203 Do not generate transitive closure for the dependency graph. Contributed by Haohui
Mai


Project: http://git-wip-us.apache.org/repos/asf/incubator-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-falcon/commit/82393d1e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/82393d1e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/82393d1e

Branch: refs/heads/master
Commit: 82393d1e3e7071fd8e204cd09cab52f67da7d51b
Parents: f6f2a05
Author: Venkatesh Seetharam <venkatesh@apache.org>
Authored: Fri Nov 15 14:33:15 2013 -0800
Committer: Venkatesh Seetharam <venkatesh@apache.org>
Committed: Fri Nov 15 14:33:15 2013 -0800

----------------------------------------------------------------------
 CHANGES.txt                  |  3 +++
 html5-ui/js/falcon-entity.js |  5 ++--
 html5-ui/js/falcon.js        | 55 +++++++++++++++++++--------------------
 3 files changed, 33 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82393d1e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3d28b44..f6cf839 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -184,6 +184,9 @@ Release Version: 0.4-incubating
     FALCON-201 Package oozie-el-extensions jar files as part of tarball
     (Ashish Singh via Venkatesh Seetharam)
 
+    FALCON-203 Do not generate transitive closure for the dependency graph
+    (Haohui Mai via Venkatesh Seetharam)
+
 
 
 Release Version: 0.3-incubating

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82393d1e/html5-ui/js/falcon-entity.js
----------------------------------------------------------------------
diff --git a/html5-ui/js/falcon-entity.js b/html5-ui/js/falcon-entity.js
index de2eae5..8ae1acb 100644
--- a/html5-ui/js/falcon-entity.js
+++ b/html5-ui/js/falcon-entity.js
@@ -111,6 +111,7 @@
     var NODE_HEIGHT = 60;
     var RECT_ROUND  = 5;
     var SEPARATION  = 40;
+    var UNIVERSAL_SEP = 80;
 
     // Function to draw the lines of the edge
     var LINE_FUNCTION = d3.svg.line()
@@ -223,12 +224,12 @@
         var n = nodes[key];
         for (var i = 0, l = n.dependency.length; i < l; ++i) {
           var d = n.dependency[i];
-          g.addEdge(null, d, n.id);
+          g.addEdge(null, n.id, d);
         }
       }
 
       layout = dagre.layout()
-        .universalSep(100).rankSep(SEPARATION)
+        .universalSep(UNIVERSAL_SEP).rankSep(SEPARATION)
         .run(g);
       layout.eachEdge(drawEdge);
       layout.eachNode(drawNode);

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82393d1e/html5-ui/js/falcon.js
----------------------------------------------------------------------
diff --git a/html5-ui/js/falcon.js b/html5-ui/js/falcon.js
index 14758bc..ff3a929 100644
--- a/html5-ui/js/falcon.js
+++ b/html5-ui/js/falcon.js
@@ -63,9 +63,6 @@
       var nodes = {};
       var next_node_id = 0;
 
-      var STATE_UNINITIALIZED = 0;
-      var STATE_REQUEST_SENT = 1;
-
       var requests_in_fly = 0;
 
       function key(type, name) {
@@ -78,7 +75,6 @@
           return nodes[k];
 
         var n = {
-          "request_state": STATE_UNINITIALIZED,
           "id": next_node_id++,
           "type": type,
           "name": name,
@@ -102,36 +98,39 @@
             var l = data.entity.length;
             for (var i = 0; i < l; ++i) {
               var e = data.entity[i];
-              node.dependency.push(getOrCreateNode(e.type, e.name).id);
-              enqueue(e.type, e.name);
+              /**
+               * The REST API provides both the in and the out egeds
+               * of the dependency graph. Here we add the edeges based
+               * on the rules. (-> means the dependency edge)
+               *
+               * Feed->cluster, process->feed, process->cluster
+               */
+              var d = getOrCreateNode(e.type, e.name);
+              var src = null, dst = null;
+              if (d.type === "cluster") {
+                src = node; dst = d;
+              } else if (d.type === "process") {
+                src = d; dst = node;
+              } else {
+                if (node.type === "cluster") {
+                  src = d; dst = node;
+                } else {
+                  src = node; dst = d;
+                }
+              }
+              console.log(src.name + '->' + dst.name);
+              src.dependency.push(dst.id);
             }
-          })
-          .always(function () {
-            --requests_in_fly;
 
-            if (requests_in_fly == 0)
-              done_callback(nodes);
-          });
+            done_callback(nodes);
+          })
       }
 
-      function enqueue(type, name) {
-        // There's no dependency for clusters
-        if (type === 'cluster')
-          return;
-
-        var k = key(type, name);
-
-        if (nodes[k] !== undefined && nodes[k].request_state !== STATE_UNINITIALIZED)
-          return;
-
-        var n = getOrCreateNode(type, name);
-        n.request_state = STATE_REQUEST_SENT;
-
-        ++requests_in_fly;
+      function load() {
+        var n = getOrCreateNode(entity_type, entity_name);
         loadEntry(n);
       }
-
-      enqueue(entity_type, entity_name);
+      load();
     }
   };
 


Mime
View raw message