From b0944100e339f6d28c6c7bb936bef8ebb1948d89 Mon Sep 17 00:00:00 2001 From: Alessandro Bellina Date: Mon, 19 Sep 2016 13:33:37 -0500 Subject: [PATCH] STORM-2101: fixes npe in compute-executors in nimbus --- .../clj/org/apache/storm/daemon/nimbus.clj | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj b/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj index 76b39171e12..393899030cc 100644 --- a/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj +++ b/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj @@ -637,16 +637,17 @@ storm-conf (read-storm-conf-as-nimbus storm-id blob-store) topology (read-storm-topology-as-nimbus storm-id blob-store) task->component (get-clojurified-task-info topology storm-conf)] - (->> (StormCommon/stormTaskInfo topology storm-conf) - (Utils/reverseMap) - clojurify-structure - (map-val sort) - ((fn [ & maps ] (Utils/joinMaps (into-array Map (into [component->executors] maps))))) - (clojurify-structure) - (map-val (partial apply (fn part-fixed [a b] (Utils/partitionFixed a b)))) - (mapcat second) - (map to-executor-id) - ))) + (if (nil? component->executors) + [] + (->> (StormCommon/stormTaskInfo topology storm-conf) + (Utils/reverseMap) + clojurify-structure + (map-val sort) + ((fn [ & maps ] (Utils/joinMaps (into-array Map (into [component->executors] maps))))) + (clojurify-structure) + (map-val (partial apply (fn part-fixed [a b] (Utils/partitionFixed a b)))) + (mapcat second) + (map to-executor-id))))) (defn- compute-executor->component [nimbus storm-id] (let [conf (:conf nimbus)