[ 
https://issues.apache.org/jira/browse/STORM-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13972396#comment-13972396
 ] 

ASF GitHub Bot commented on STORM-173:
--------------------------------------

GitHub user dschiavu reopened a pull request:

    https://github.com/apache/incubator-storm/pull/73

    Treat command line "-c" option number config values as such (STORM-173)

    This fixes the `ClassCastException` when submitting numeric config values 
using the `storm` utility's `-c` option.
    It works by first checking if the `-c` configuration value is numeric (via 
Apache Commons' `NumberUtils#isNumber`) and, if positive, converting it to a 
numeric type. See STORM-173.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dschiavu/incubator-storm 
STORM-173-storm-number-config-value

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-storm/pull/73.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 #73
    
----
commit c4ff804c30b331be0af032f01d1b2819d62c7dc2
Author: Danijel Schiavuzzi <[email protected]>
Date:   2014-04-11T16:11:55Z

    Treat command line "-c" option number config values as such (STORM-173)

commit 442d8e75103f425d211a022184621072326925f0
Author: Danijel Schiavuzzi <[email protected]>
Date:   2014-04-16T16:01:34Z

    Move command line options values introspection logic to
    Utils#readCommandLineOpts (STORM-173)

commit a0e2aa6e37ddfd1174c3430499de2b18b34052c5
Author: Danijel Schiavuzzi <[email protected]>
Date:   2014-04-17T08:25:54Z

    Parse command line options as JSON values (STORM-173)

----


> use "-c " command to define Number config value will generate 
> ClassCastException
> --------------------------------------------------------------------------------
>
>                 Key: STORM-173
>                 URL: https://issues.apache.org/jira/browse/STORM-173
>             Project: Apache Storm (Incubating)
>          Issue Type: New Feature
>            Reporter: caofangkun
>            Priority: Minor
>
> storm -c topology.workers=3 -c storm.zookeeper.root=/storm/cluster001 jar 
> ./storm-starter-0.0.1-SNAPSHOT.jar storm.starter.WordCountTopology2 
> WordCountTopology2
> Will generate SerConf like this :
> Submitting topology WordCountTopology2 in distributed mode with conf 
> {"storm.zookeeper.root":"\/storm\/cluster001","topology.workers":"3","topology.debug":true}
> but "topology.workers":"3" is wrong and should be "topology.workers":3
> And can find errors in $STOMR_HOME/logs/nimbus.log as following:
> 2013-12-10 11:18:44 o.a.t.s.TNonblockingServer [ERROR] Unexpected exception 
> while invoking!
> java.lang.ClassCastException: java.lang.String cannot be cast to 
> java.lang.Number
> at backtype.storm.thrift$mk_plain_component_common.doInvoke(thrift.clj:93) 
> ~[storm-core-0.9.0-rc2.jar:na]
> at clojure.lang.RestFn.invoke(RestFn.java:494) ~[clojure-1.4.0.jar:na]
> at backtype.storm.thrift$mk_bolt_spec_STAR_.doInvoke(thrift.clj:158) 
> ~[storm-core-0.9.0-rc2.jar:na]
> at clojure.lang.RestFn.invoke(RestFn.java:573) ~[clojure-1.4.0.jar:na]
> at backtype.storm.daemon.common$add_acker_BANG_.invoke(common.clj:183) 
> ~[storm-core-0.9.0-rc2.jar:na]
> at backtype.storm.daemon.common$system_topology_BANG_.invoke(common.clj:280) 
> ~[storm-core-0.9.0-rc2.jar:na]
> at 
> backtype.storm.daemon.nimbus$fn__5822$exec_fn__1273__auto__$reify__5835.submitTopologyWithOpts(nimbus.clj:931)
>  ~[storm-core-0.9.0-rc2.jar:na]
> at 
> backtype.storm.daemon.nimbus$fn__5822$exec_fn__1273__auto__$reify__5835.submitTopology(nimbus.clj:949)
>  ~[storm-core-0.9.0-rc2.jar:na]
> at 
> backtype.storm.generated.Nimbus$Processor$submitTopology.getResult(Nimbus.java:1223)
>  ~[storm-core-0.9.0-rc2.jar:na]
> at 
> backtype.storm.generated.Nimbus$Processor$submitTopology.getResult(Nimbus.java:1211)
>  ~[storm-core-0.9.0-rc2.jar:na]
> at org.apache.thrift7.ProcessFunction.process(ProcessFunction.java:32) 
> ~[libthrift7-0.7.0-2.jar:0.7.0-2]
> at org.apache.thrift7.TBaseProcessor.process(TBaseProcessor.java:34) 
> ~[libthrift7-0.7.0-2.jar:0.7.0-2]
> at 
> org.apache.thrift7.server.TNonblockingServer$FrameBuffer.invoke(TNonblockingServer.java:632)
>  ~[libthrift7-0.7.0-2.jar:0.7.0-2]
> at org.apache.thrift7.server.THsHaServer$Invocation.run(THsHaServer.java:201) 
> [libthrift7-0.7.0-2.jar:0.7.0-2]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>  [na:1.6.0_37]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>  [na:1.6.0_37]
> at java.lang.Thread.run(Thread.java:662) [na:1.6.0_37]



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to