Repository: storm Updated Branches: refs/heads/master ada8097e1 -> 04cf3f616
Merge pull request #579 from ppoulosk/YSTORM-2270 [YSTORM-2270] Fix arraylist of strings as config value for childopts Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/103125d4 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/103125d4 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/103125d4 Branch: refs/heads/master Commit: 103125d428e13aed20acbd7881ab8b1aaa423ed9 Parents: 1822491 Author: Paul Poulosky <ppoul...@yahoo-inc.com> Authored: Thu Oct 8 17:51:34 2015 -0500 Committer: Paul Poulosky <ppoul...@thenperfect-lm.champ.corp.yahoo.com> Committed: Thu Oct 8 18:05:45 2015 -0500 ---------------------------------------------------------------------- storm-core/src/clj/backtype/storm/daemon/supervisor.clj | 2 +- storm-core/test/clj/backtype/storm/supervisor_test.clj | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/103125d4/storm-core/src/clj/backtype/storm/daemon/supervisor.clj ---------------------------------------------------------------------- diff --git a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj index c78e865..a31a262 100644 --- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj +++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj @@ -644,7 +644,7 @@ replacement-map)] (cond (nil? value) nil - (list? value) (map sub-fn value) + (sequential? value) (vec (map sub-fn value)) :else (-> value sub-fn (clojure.string/split #"\s+"))))) (defn java-cmd [] http://git-wip-us.apache.org/repos/asf/storm/blob/103125d4/storm-core/test/clj/backtype/storm/supervisor_test.clj ---------------------------------------------------------------------- diff --git a/storm-core/test/clj/backtype/storm/supervisor_test.clj b/storm-core/test/clj/backtype/storm/supervisor_test.clj index 64dd1cb..2c8aa52 100644 --- a/storm-core/test/clj/backtype/storm/supervisor_test.clj +++ b/storm-core/test/clj/backtype/storm/supervisor_test.clj @@ -573,6 +573,17 @@ childopts-with-ids (supervisor/substitute-childopts childopts worker-id topology-id port)] (is (= expected-childopts childopts-with-ids))))) +(deftest test-substitute-childopts-happy-path-arraylist + (testing "worker-launcher replaces ids in childopts from arraylist" + (let [worker-id "w-01" + topology-id "s-01" + port 9999 + mem-onheap 512 + childopts '["-Xloggc:/home/y/lib/storm/current/logs/gc.worker-%ID%-%TOPOLOGY-ID%-%WORKER-ID%-%WORKER-PORT%.log" "-Xms256m" "-Xmx%HEAP-MEM%m"] + expected-childopts '("-Xloggc:/home/y/lib/storm/current/logs/gc.worker-9999-s-01-w-01-9999.log" "-Xms256m" "-Xmx512m") + childopts-with-ids (supervisor/substitute-childopts childopts worker-id topology-id port mem-onheap)] + (is (= expected-childopts childopts-with-ids))))) + (deftest test-substitute-childopts-topology-id-alone (testing "worker-launcher replaces ids in childopts" (let [worker-id "w-01"