Skip to content

Commit 2b6418c

Browse files
author
Nathan Marz
committed
optimize topology debug check
1 parent 0de685a commit 2b6418c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/clj/backtype/storm/daemon/task.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@
9191
emit-sampler (mk-stats-sampler storm-conf)
9292
stream->component->grouper (:stream->component->grouper executor-data)
9393
user-context (:user-context task-data)
94-
executor-stats (:stats executor-data)]
94+
executor-stats (:stats executor-data)
95+
debug? (storm-conf TOPOLOGY-DEBUG)]
9596
(fn ([^Integer out-task-id ^String stream ^List values]
96-
(when (= true (storm-conf TOPOLOGY-DEBUG))
97+
(when debug?
9798
(log-message "Emitting direct: " out-task-id "; " component-id " " stream " " values))
9899
(let [target-component (.getComponentId worker-context out-task-id)
99100
component->grouping (get stream->component->grouper stream)
@@ -109,7 +110,7 @@
109110
(if out-task-id [out-task-id])
110111
))
111112
([^String stream ^List values]
112-
(when (= true (storm-conf TOPOLOGY-DEBUG))
113+
(when debug?
113114
(log-message "Emitting: " component-id " " stream " " values))
114115
(let [out-tasks (ArrayList.)]
115116
(doseq [[out-component grouper] (get stream->component->grouper stream)]

0 commit comments

Comments
 (0)