[
https://issues.apache.org/jira/browse/STORM-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14109232#comment-14109232
]
ASF GitHub Bot commented on STORM-463:
--------------------------------------
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-storm/pull/232
> 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
> Assignee: Michael Pershyn
> Fix For: 0.9.3-incubating
>
>
> 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)