Repository: storm Updated Branches: refs/heads/0.10.x-branch 101fb1fc5 -> b2d366a35
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/f0793dde Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/f0793dde Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/f0793dde Branch: refs/heads/0.10.x-branch Commit: f0793dde3c377a52dda1f2279611fde16b0ab5b0 Parents: 101fb1f Author: Paul Poulosky <ppoul...@yahoo-inc.com> Authored: Thu Oct 8 17:51:34 2015 -0500 Committer: Jungtaek Lim <kabh...@gmail.com> Committed: Sat Oct 10 23:01:10 2015 +0900 ---------------------------------------------------------------------- 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/f0793dde/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 548e365..81e4152 100644 --- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj +++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj @@ -641,7 +641,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/f0793dde/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 e3c1595..26b0fc8 100644 --- a/storm-core/test/clj/backtype/storm/supervisor_test.clj +++ b/storm-core/test/clj/backtype/storm/supervisor_test.clj @@ -568,6 +568,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"