Github user knusbaum commented on a diff in the pull request:
https://github.com/apache/storm/pull/694#discussion_r37785236
--- Diff: storm-core/src/clj/backtype/storm/daemon/executor.clj ---
@@ -445,6 +445,32 @@
ret
))
+(defn init-batching-buffer [worker-context component-id]
+ (let [batchSize (.get_batch_size (.getComponentCommon worker-context
component-id))]
+ (if (> batchSize 1)
+ (let [consumer-ids (flatten (for [cids (vals (.getTargets
worker-context component-id))] (keys cids)))
+ consumer-task-ids (flatten (for [cid consumer-ids :when (not
(.startsWith cid "__"))] (into '() (.getComponentTasks worker-context cid))))]
+ (HashMap. (zipmap consumer-task-ids (repeatedly (count
consumer-task-ids) #(Batch. batchSize)))))
+ (HashMap.)
+ )))
+
+(defn emit-msg [out-task out-tuple overflow-buffer output-batch-buffer
transfer-fn]
+ (let [out-batch (.get output-batch-buffer out-task)]
+ (if out-batch
--- End diff --
Unless I misunderstand, this is going to end up being always true or always
false, depending on the result of `.get_batch_size` for the component at
startup. In that case, can we decide this when we're setting up the transfer
function instead of each time we're emitting a tuple?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---