Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/700#discussion_r38022357
--- Diff: storm-core/src/clj/backtype/storm/daemon/worker.clj ---
@@ -114,12 +114,34 @@
(fast-list-iter [[task tuple :as pair] tuple-batch]
(.serialize serializer tuple)))
+(defn- mk-backpressure-handler [executors]
+ "make a handler that checks and updates worker's backpressure flag"
+ (disruptor/backpressure-handler
+ (fn [worker]
+ (let [storm-id (:storm-id worker)
+ assignment-id (:assignment-id worker)
+ port (:port worker)
+ storm-cluster-state (:storm-cluster-state worker)]
+ (if executors
+ (if (reduce #(or %1 %2) (map #(.get-backpressure-flag %1)
executors))
+ (reset! (:backpressure worker) true) ;; at least one
executor has set backpressure
+ (reset! (:backpressure worker) false))) ;; no executor has
backpressure set
+ ;; update the worker's backpressure flag to zookeeper here
+ (.worker-backpressure! storm-cluster-state storm-id assignment-id
port @(:backpressure worker))
+ ))))
+
(defn mk-transfer-fn [worker]
(let [local-tasks (-> worker :task-ids set)
local-transfer (:transfer-local-fn worker)
- ^DisruptorQueue transfer-queue (:transfer-queue worker)
+ transfer-queue (:transfer-queue worker)
--- End diff --
Why did we drop the type hint?
---
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.
---