You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Fred Miller <fr...@frederickmiller.com> on 2014/05/02 02:58:18 UTC

Re: RedStorm: How to Add More than 1 JRubyShellBolt to a Topology

The solution ... thanks to Jess Hottenstein:

 bolt JRubyShellBolt, ["python", "splitsentence.py"] do

    output_fields "word"

    source SimpleSpout, :shuffle

  end

 bolt JRubyShellBolt, ["python", "splitsentence2.py"], :id => :sentence2 do
    output_fields "word2"

    source SimpleSpout, :shuffle

  end


On Apr 29, 2014, at 8:33 AM, Fred Miller <fr...@frederickmiller.com> wrote:

> 1.  Using the shell_topology.rb example, it's not clear if we can have more 
> than 1 JRubyShellBolt in the topology.
> Whereas the bolt definitions for the JRuby bolts are clear:
>  bolt TestBolt1 < RedStorm::DSL::Bolt
>  ...
>  end
>  bolt TestBolt2 < RedStorm::DSL::Bolt
>  ...
>  end,
>  
> it's unclear how to create more than one JRubyShellBolt:
>  
> Per the example:
>  bolt JRubyShellBolt, ["python", "splitsentence.py"] do
>    output_fields "word"
>    source SimpleSpout, :shuffle
>  end
>  
> How would I do something like:
>  bolt SplitSentence, ["python", "splitsentence.py"] do
>    output_fields "word"
>    source SimpleSpout, :shuffle
>  end
>  bolt SplitSentence2, ["python", "splitsentence.py"] do
>    output_fields "word"
>    source SplitSentence, :shuffle
>  end
> 
> 2.  Doing the following will NOT work,
> java_import 'readstorm.storm.jruby.JRubyShellBolt'
> SplitSentence = JRubyShellBolt
> SplitSentence2 = JRubyShellBolt
>  
> and results in: 
>  
> ... duplicate id in Java::RedstormStormJruby::JRubyShellBolt on id=j_ruby_shell_bolt ...
>  
> because SplitSentence2 is a reference.
>  
> Thanks in advance,
> Fred
>  
> 
> 
>