[
https://issues.apache.org/jira/browse/STORM-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14103853#comment-14103853
]
ASF GitHub Bot commented on STORM-463:
--------------------------------------
GitHub user pershyn opened a pull request:
https://github.com/apache/incubator-storm/pull/232
STORM-463: added static version of metrics helpers for Config
Extended `registerMetricsConsumer` helper for backtype.storm.Config to be
compliant with other helpers. Details described in
[STORM-463](https://issues.apache.org/jira/browse/STORM-463)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/pershyn/incubator-storm STORM-463
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-storm/pull/232.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #232
----
commit acc1ae6a757cf426e5917dfdd910c746442b2bc2
Author: Michael Pershyn <[email protected]>
Date: 2014-08-20T13:06:24Z
STORM-463: added static version of metrics helpers for Config
----
> lack of static helper registerMetricsConsumer for backtype.storm.Config
> -----------------------------------------------------------------------
>
> Key: STORM-463
> URL: https://issues.apache.org/jira/browse/STORM-463
> Project: Apache Storm (Incubating)
> Issue Type: Improvement
> Affects Versions: 0.9.2-incubating, 0.9.1-incubating, 0.9.3-incubating
> Reporter: Michael Pershyn
>
> In backtype.storm.Config there is the concept in design to use regular maps,
> while providing only helpers to operate on that map.
> Most of the methods are using this concept by providing static versions.
> For example, {{registerSerialization}} method.
> {code}
> public static void registerSerialization(Map conf, Class klass) {
> getRegisteredSerializations(conf).add(klass.getName());
> }
> public void registerSerialization(Class klass) {
> registerSerialization(this, klass);
> }
> {code}
> However recently added metrics interface doesn't follow this approach.
> Unfortunately, this breaks the concept of using HashMap as configuration
> container by user. And it is still only HashMap inside storm.
> Also, not having static version of {{registerMetricsConsumer}}, while
> introducing metrics feature breaks the configuration code in clojure that
> previosly was just a map.
> Without static helper this code should be instance of
> {{backtype.storm.Config}} class, and it is not possible to keep configuration
> as simple as in pseudocode example below in submitter call.
> {code}
> (let [topology-config (doto { TOPOLOGY-DEBUG false
> TOPOLOGY-STATS-SAMPLE-RATE 0.01
> TOPOLOGY-RECEIVER-BUFFER-SIZE 32
> TOPOLOGY-TRANSFER-BUFFER-SIZE 4096
> TOPOLOGY-EXECUTOR-RECEIVE-BUFFER-SIZE 2048 }
> ;; using static helper to add serialization class to
> config.
> storm.backtype.Config/registerSerialization
> EXMPLSerializer
>
> serializer)]
> (StormSubmitter/submitTopology
> topology-name
> topology-config
> (mk-topology)))
> {code}
> Proposed solution to create a static version of `registerMetricsConsumer`
> they way it is done by all other {{backtype.storm.Config}} helpers.
--
This message was sent by Atlassian JIRA
(v6.2#6252)