A better way to find out how many instances of each component are created
is to take a look at the Storm UI at nimbus:8080.

It shows how many instances of each component are running and gives you
info about it. I'm not sure if the declareOutputFields should be called as
many time as groups you have, sounds like a bad thing.

Take a look at the UI and let me know if there is in fact only one bolt or
two.

Hope I could help.


On Tue, Jul 22, 2014 at 9:16 AM, Sai SaiGraph <saisaigr...@gmail.com> wrote:

> Hi
> Could some one pls help with FieldGrouping issue i am having pls.
>
> I am using the WordCount example from Getting Started book of Storm.
>
> Here is the input i am providing just 1 line:
>
> Apache Storm is great.
>
> I have tried using 1 Spout, 1 SplitSentenceBolt and 2 WordCountBolts, and
> 1 Report Bolt.
>
> Here is the topology that i have used:
>
> TopologyBuilder builder = new TopologyBuilder();
>
>         builder.setSpout(SENTENCE_SPOUT_ID, spout, 1);
>
> // SentenceSpout --> SplitSentenceBolt
>         builder.setBolt(SPLIT_BOLT_ID, splitBolt, 1)
>                 .shuffleGrouping(SENTENCE_SPOUT_ID);
>
> // SplitSentenceBolt --> WordCountBolt
>         builder.setBolt(COUNT_BOLT_ID, countBolt, 2)
>                 .fieldsGrouping(SPLIT_BOLT_ID, new Fields("word"));
>
> // WordCountBolt --> ReportBolt
>         builder.setBolt(REPORT_BOLT_ID, reportBolt)
>                 .globalGrouping(COUNT_BOLT_ID);
>
> Here is the code in WordCountBolt>>declareOutputFields:
>
> public void declareOutputFields(OutputFieldsDeclarer declarer) {
>         Sop("3 WordCountBolt dOFs WordCountBolt --> word,count ");
>         declarer.declare(new Fields("word", "count"));
>  }
>
> Since  i have used a parallelism of 2 here for WCBolt:
>
>         builder.setBolt(COUNT_BOLT_ID, countBolt, 2)
>
> i have assumed there will be 2 instances of WordCountBolt  needs to be
> created which means the above method
> declareOutputFields should be called twice as the Fields should be
> partitioned and routed to 2 diff instances of WCBolt. But i am noticing
> there is only 1 instance of WCBolt getting created in other words i am
> logging via the declareOutputFields method to find how many instances of
> WCBolt are created and there is only 1 print statement printed.
>
> I have also tried using multiple lines as input but noticed only 1
> instance of WCBolt is getting created even for multiple lines input.
>
> Could some one pls provide any suggestions if i am doing any thing
> incorrect here.
>
> Your help will be really appreciated.
> Thanks
> Sai
>



-- 
------------------------------------------
Telles Mota Vidal Nobrega
M.sc. Candidate at UFCG
B.sc. in Computer Science at UFCG
Software Engineer at OpenStack Project - HP/LSD-UFCG

Reply via email to