You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/06/09 21:51:55 UTC

git commit: Add missing ACLs to error znodes and remove auto vivification of error znodes

Repository: incubator-storm
Updated Branches:
  refs/heads/security 698bb9c97 -> 6592b8209


Add missing ACLs to error znodes and remove auto vivification of error znodes


Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/6592b820
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/6592b820
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/6592b820

Branch: refs/heads/security
Commit: 6592b8209c49a98db15b3d6d228f488aa6c2e623
Parents: 698bb9c
Author: Kishor Patil <pa...@yahoo.com>
Authored: Mon Jun 9 15:42:39 2014 +0000
Committer: Kishor Patil <pa...@yahoo.com>
Committed: Mon Jun 9 15:44:50 2014 +0000

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/cluster.clj   | 20 ++++++++++++--------
 .../src/clj/backtype/storm/daemon/executor.clj  |  3 ++-
 2 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/6592b820/storm-core/src/clj/backtype/storm/cluster.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/cluster.clj b/storm-core/src/clj/backtype/storm/cluster.clj
index 7c43aea..9969815 100644
--- a/storm-core/src/clj/backtype/storm/cluster.clj
+++ b/storm-core/src/clj/backtype/storm/cluster.clj
@@ -32,6 +32,7 @@
   (get-data [this path watch?])
   (get-children [this path watch?])
   (mkdirs [this path acls])
+  (exists-node? [this path watch?])
   (close [this])
   (register [this callback])
   (unregister [this id])
@@ -110,6 +111,9 @@
      (mkdirs [this path acls]
              (zk/mkdirs zk path acls))
      
+     (exists-node? [this path watch?]
+             (zk/exists-node? zk path watch?))
+
      (close [this]
             (reset! active false)
             (.close zk))
@@ -388,14 +392,14 @@
 
       (errors [this storm-id component-id]
          (let [path (error-path storm-id component-id)
-               _ (mkdirs cluster-state path acls)
-               children (get-children cluster-state path false)
-               errors (dofor [c children]
-                             (let [data (-> (get-data cluster-state (str path "/" c) false)
-                                            maybe-deserialize)]
-                               (when data
-                                 (struct TaskError (:error data) (:time-secs data))
-                                 )))
+               errors (if (exists-node? cluster-state path false)
+                        (dofor [c (get-children cluster-state path false)]
+                          (let [data (-> (get-data cluster-state (str path "/" c) false)
+                                         maybe-deserialize)]
+                            (when data
+                              (struct TaskError (:error data) (:time-secs data))
+                              )))
+                        ())
                ]
            (->> (filter not-nil? errors)
                 (sort-by (comp - :time-secs)))))

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/6592b820/storm-core/src/clj/backtype/storm/daemon/executor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/executor.clj b/storm-core/src/clj/backtype/storm/daemon/executor.clj
index d193a9f..29cce08 100644
--- a/storm-core/src/clj/backtype/storm/daemon/executor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/executor.clj
@@ -229,7 +229,8 @@
      :batch-transfer-queue batch-transfer->worker
      :transfer-fn (mk-executor-transfer-fn batch-transfer->worker storm-conf)
      :suicide-fn (:suicide-fn worker)
-     :storm-cluster-state (cluster/mk-storm-cluster-state (:cluster-state worker))
+     :storm-cluster-state (cluster/mk-storm-cluster-state (:cluster-state worker) 
+                                                          :acls (Utils/getWorkerACL storm-conf))
      :type executor-type
      ;; TODO: should refactor this to be part of the executor specific map (spout or bolt with :common field)
      :stats (mk-executor-stats <> (sampling-rate storm-conf))