You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by "Rick Kellogg (JIRA)" <ji...@apache.org> on 2015/10/05 03:56:28 UTC

[jira] [Updated] (STORM-463) lack of static helper registerMetricsConsumer for backtype.storm.Config

     [ https://issues.apache.org/jira/browse/STORM-463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Kellogg updated STORM-463:
-------------------------------
    Component/s: storm-core

> lack of static helper registerMetricsConsumer for backtype.storm.Config
> -----------------------------------------------------------------------
>
>                 Key: STORM-463
>                 URL: https://issues.apache.org/jira/browse/STORM-463
>             Project: Apache Storm
>          Issue Type: Improvement
>          Components: storm-core
>    Affects Versions: 0.9.2-incubating, 0.9.1-incubating, 0.9.3
>            Reporter: Michael Pershyn
>            Assignee: Michael Pershyn
>             Fix For: 0.9.3
>
>
> 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.3.4#6332)