storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/3] storm git commit: Update timer.clj
Date Tue, 25 Aug 2015 00:24:17 GMT
Repository: storm
Updated Branches:
  refs/heads/0.10.x-branch 2b0ec2465 -> 844d46c83


Update timer.clj

Give a upper bound to the sleeping time, to guarantee a bounded response time for detecting
new events.


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

Branch: refs/heads/0.10.x-branch
Commit: 29d1ba55fc76c5a12d86c59c8a5bb88ad73927d8
Parents: 2b0ec24
Author: Li Wang <wangli1426@gmail.com>
Authored: Wed Aug 12 22:00:15 2015 +0800
Committer: Jungtaek Lim <kabhwan@gmail.com>
Committed: Tue Aug 25 09:12:52 2015 +0900

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/timer.clj | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/29d1ba55/storm-core/src/clj/backtype/storm/timer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/timer.clj b/storm-core/src/clj/backtype/storm/timer.clj
index 6f00a5c..1025b28 100644
--- a/storm-core/src/clj/backtype/storm/timer.clj
+++ b/storm-core/src/clj/backtype/storm/timer.clj
@@ -53,8 +53,11 @@
                                    ;; event generation. If any recurring events
                                    ;; are scheduled then we will always go
                                    ;; through this branch, sleeping only the
-                                   ;; exact necessary amount of time.
-                                   (Time/sleep (- time-millis (current-time-millis)))
+                                   ;; exact necessary amount of time. We give
+                                   ;; an upper bound, e.g. 1000 millis, to the
+                                   ;; sleeping time, to limit the response time
+                                   ;; for detecting any new event within 1 secs.
+                                   (Time/sleep (max 1000 (- time-millis (current-time-millis))))
                                    ;; Otherwise poll to see if any new event
                                    ;; was scheduled. This is, in essence, the
                                    ;; response time for detecting any new event


Mime
View raw message