storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/5] storm git commit: Update timer.clj
Date Tue, 25 Aug 2015 00:24:03 GMT
Repository: storm
Updated Branches:
  refs/heads/master ce6c1c389 -> 949da3853


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/d1a6f4a7
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/d1a6f4a7
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/d1a6f4a7

Branch: refs/heads/master
Commit: d1a6f4a753661f7e825eeec0c51782462fca4d5f
Parents: b0baa63
Author: Li Wang <wangli1426@gmail.com>
Authored: Wed Aug 12 22:00:15 2015 +0800
Committer: Li Wang <wangli1426@gmail.com>
Committed: Wed Aug 12 22:00:15 2015 +0800

----------------------------------------------------------------------
 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/d1a6f4a7/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