storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptgo...@apache.org
Subject [01/24] git commit: fix the issue that tick tuple cannot work with system bolt
Date Tue, 19 Nov 2013 15:26:38 GMT
Updated Branches:
  refs/heads/master 1e3d2660c -> 66a397368


fix the issue that tick tuple cannot work with system bolt


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

Branch: refs/heads/master
Commit: 483ce454a3b2cd31b5d1c34e9365346459b358a8
Parents: 1e3d266
Author: James Xu <xumingming64398966@gmail.com>
Authored: Wed Oct 9 22:08:28 2013 +0800
Committer: James Xu <xumingming64398966@gmail.com>
Committed: Wed Oct 9 22:08:28 2013 +0800

----------------------------------------------------------------------
 .../src/clj/backtype/storm/daemon/executor.clj  |  7 ++--
 .../test/clj/backtype/storm/tick_tuple_test.clj | 35 ++++++++++++++++++++
 2 files changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/483ce454/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 431bf35..40f5561 100644
--- a/storm-core/src/clj/backtype/storm/daemon/executor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/executor.clj
@@ -283,9 +283,10 @@
         receive-queue (:receive-queue executor-data)
         context (:worker-context executor-data)]
     (when tick-time-secs
-      (if (and (not (storm-conf TOPOLOGY-ENABLE-MESSAGE-TIMEOUTS))
-               (= :spout (:type executor-data)))
-        (log-message "Timeouts disabled for executor " (:executor-id executor-data))
+      (if (or (system-id? (:component-id executor-data))
+              (and (not (storm-conf TOPOLOGY-ENABLE-MESSAGE-TIMEOUTS))
+                   (= :spout (:type executor-data))))
+        (log-message "Timeouts disabled for executor " (:component-id executor-data) ":"
(:executor-id executor-data))
         (schedule-recurring
           (:user-timer worker)
           tick-time-secs

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/483ce454/storm-core/test/clj/backtype/storm/tick_tuple_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/tick_tuple_test.clj b/storm-core/test/clj/backtype/storm/tick_tuple_test.clj
new file mode 100644
index 0000000..b1679c5
--- /dev/null
+++ b/storm-core/test/clj/backtype/storm/tick_tuple_test.clj
@@ -0,0 +1,35 @@
+(ns backtype.storm.tick-tuple-test
+  (:use [clojure test])
+  (:use [backtype.storm bootstrap testing])
+  (:use [backtype.storm.daemon common]))
+
+(bootstrap)
+
+(defbolt noop-bolt ["tuple"] {:prepare true}
+  [conf context collector]
+  (bolt
+   (execute [tuple])))
+
+(defspout noop-spout ["tuple"]
+  [conf context collector]
+  (spout
+   (nextTuple [])))
+
+(deftest test-tick-tuple-works-with-system-bolt
+  (with-simulated-time-local-cluster [cluster]
+    (let [topology (thrift/mk-topology
+                    {"1" (thrift/mk-spout-spec noop-spout)}
+                    {"2" (thrift/mk-bolt-spec {"1" ["tuple"]} noop-bolt)})]
+      (try
+        (submit-local-topology (:nimbus cluster)
+                               "test"
+                               {TOPOLOGY-TICK-TUPLE-FREQ-SECS 1}
+                               topology)
+        (advance-cluster-time cluster 2)
+        ;; if reaches here, it means everything works ok.
+        (is true)
+        (catch Exception e
+          (is false))))))
+
+
+


Mime
View raw message