[
https://issues.apache.org/jira/browse/STORM-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14065609#comment-14065609
]
ASF GitHub Bot commented on STORM-373:
--------------------------------------
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)]
```
> Provide Additional String substitutions for *.worker.childopts
> ---------------------------------------------------------------
>
> Key: STORM-373
> URL: https://issues.apache.org/jira/browse/STORM-373
> Project: Apache Storm (Incubating)
> Issue Type: Improvement
> Affects Versions: 0.9.2-incubating
> Reporter: Kishor Patil
> Labels: master
>
> As a storm application developer, I would like to name my GC log uniquely, so
> that the log is not blown away each time the worker restarts.
> Add %WORKER-ID% (worker-id) %STORM-ID% (storm-id) to the substitution
> whenlaunching the worker JVM.
--
This message was sent by Atlassian JIRA
(v6.2#6252)