Github user d2r commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/164#discussion_r15086122
  
    --- Diff: storm-core/src/clj/backtype/storm/daemon/supervisor.clj ---
    @@ -445,8 +445,17 @@
             arch-resource-root (str resource-root File/separator os "-" arch)]
         (str arch-resource-root File/pathSeparator resource-root 
File/pathSeparator (conf JAVA-LIBRARY-PATH)))) 
     
    -(defn- substitute-worker-childopts [value port]
    -  (let [sub-fn (fn [s] (.replaceAll s "%ID%" (str port)))]
    +(defn substitute-childopts 
    +  [value worker-id storm-id port]
    +  (let [replacement-map {"%ID%"           (str port)
    +                          "%WORKER-ID%"   (str worker-id)
    +                          "%STORM-ID%"    (str storm-id)
    +                          "%WORKER-PORT%" (str port)}
    +         sub-fn (fn 
    +                  [s] 
    +                  (reduce (fn [string entry]
    +                    (apply clojure.string/replace string entry))
    +                     s replacement-map))]
    --- End diff --
    
    This can be reformatted to be cleaner:
    
    ```Clojure
    sub-fn #(reduce (fn [string entry]
                      (apply clojure.string/replace string entry))
                    %
                    replacement-map)]
    ```



---
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.
---

Reply via email to