storm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Trost (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (STORM-197) registering metrics in an IRichSpout used in Trident Topology throws an Exception
Date Wed, 05 Feb 2014 10:56:09 GMT

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

Jason Trost commented on STORM-197:
-----------------------------------

yes, I modified storm-starter's TridentWordCount to use the RandomSentenceSpout (with metrics
collection added).

https://github.com/jt6211/storm-starter/tree/STORM-197_demo

It should error out immediate when running with this error:

{noformat}
java.lang.RuntimeException: java.lang.RuntimeException: TopologyContext.registerMetric can
only be called from within overridden IBolt::prepare() or ISpout::open() method.
	at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:90) ~[storm-core-0.9.0.1.jar:na]
	at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:61)
~[storm-core-0.9.0.1.jar:na]
	at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:62) ~[storm-core-0.9.0.1.jar:na]
	at backtype.storm.daemon.executor$fn__3498$fn__3510$fn__3557.invoke(executor.clj:730) ~[storm-core-0.9.0.1.jar:na]
	at backtype.storm.util$async_loop$fn__444.invoke(util.clj:403) ~[storm-core-0.9.0.1.jar:na]
	at clojure.lang.AFn.run(AFn.java:24) [clojure-1.4.0.jar:na]
	at java.lang.Thread.run(Thread.java:722) [na:1.7.0_17]
Caused by: java.lang.RuntimeException: TopologyContext.registerMetric can only be called from
within overridden IBolt::prepare() or ISpout::open() method.
	at backtype.storm.task.TopologyContext.registerMetric(TopologyContext.java:213) ~[storm-core-0.9.0.1.jar:na]
	at storm.starter.spout.RandomSentenceSpout.open(RandomSentenceSpout.java:26) ~[classes/:na]
	at storm.trident.spout.RichSpoutBatchExecutor$RichSpoutEmitter.emitBatch(RichSpoutBatchExecutor.java:88)
~[storm-core-0.9.0.1.jar:na]
	at storm.trident.spout.TridentSpoutExecutor.execute(TridentSpoutExecutor.java:65) ~[storm-core-0.9.0.1.jar:na]
	at storm.trident.topology.TridentBoltExecutor.execute(TridentBoltExecutor.java:352) ~[storm-core-0.9.0.1.jar:na]
	at backtype.storm.daemon.executor$fn__3498$tuple_action_fn__3500.invoke(executor.clj:615)
~[storm-core-0.9.0.1.jar:na]
	at backtype.storm.daemon.executor$mk_task_receiver$fn__3421.invoke(executor.clj:383) ~[storm-core-0.9.0.1.jar:na]
	at backtype.storm.disruptor$clojure_handler$reify__2962.onEvent(disruptor.clj:43) ~[storm-core-0.9.0.1.jar:na]
	at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:87) ~[storm-core-0.9.0.1.jar:na]
	... 6 common frames omitted
{noformat}

> registering metrics in an IRichSpout used in Trident Topology throws an Exception
> ---------------------------------------------------------------------------------
>
>                 Key: STORM-197
>                 URL: https://issues.apache.org/jira/browse/STORM-197
>             Project: Apache Storm (Incubating)
>          Issue Type: Bug
>            Reporter: Jason Trost
>
> Because of how the RichSpoutBatchExecutor initializes and calls open() of the IRichSpout,
any metric registrations cause an exception to be thrown.  See stacktrace below.
> java.lang.RuntimeException: java.lang.RuntimeException: TopologyContext.registerMetric
can only be called from within overridden IBolt::prepare() or ISpout::open() method.
>     at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:90)
>     at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:61)
>     at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:62)
>     at backtype.storm.daemon.executor$fn__3498$fn__3510$fn__3557.invoke(executor.clj:730)
>     at backtype.storm.util$async_loop$fn__444.invoke(util.clj:403)
>     at clojure.lang.AFn.run(AFn.java:24)
>     at java.lang.Thread.run(Thread.java:722)
> Caused by: java.lang.RuntimeException: TopologyContext.registerMetric can only be called
from within overridden IBolt::prepare() or ISpout::open() method.
>     at backtype.storm.task.TopologyContext.registerMetric(TopologyContext.java:213)
>     at com.XXXXXXX.spouts.amqp.AMQPSpout.open(AMQPSpout.java:232)
>     at storm.trident.spout.$RichSpoutEmitter.emitBatch(RichSpoutBatchExecutor.java:88)
>     at storm.trident.spout.TridentSpoutExecutor.execute(TridentSpoutExecutor.java:65)
>     at storm.trident.topology.TridentBoltExecutor.execute(TridentBoltExecutor.java:352)
>     at backtype.storm.daemon.executor$fn__3498$tuple_action_fn__3500.invoke(executor.clj:615)
>     at backtype.storm.daemon.executor$mk_task_receiver$fn__3421.invoke(executor.clj:383)
>     at backtype.storm.disruptor$clojure_handler$reify__2962.onEvent(disruptor.clj:43)
>     at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:87)
>     ... 6 more



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message