colinsurprenant / redstorm

JRuby on Storm
Other
298 stars 56 forks source link

newbie question: multiple threads in local mode #96

Closed bwalsh closed 10 years ago

bwalsh commented 10 years ago

Congratulations on a great project. I was able to get it up in running in a few hours.

One question: In local mode, should I see some degree of parallelism? All my bolts are logging with the same thread id

80800 [Thread-24] INFO  FilterBolt  ....
80802 [Thread-24] INFO  FilterBolt ....
colinsurprenant commented 10 years ago

@bwalsh absolutely, all Storm paralelism controls works in local mode. Here are a few pointers to better understand the wait it works: https://github.com/nathanmarz/storm/wiki/Local-mode https://github.com/nathanmarz/storm/wiki/Understanding-the-parallelism-of-a-Storm-topology

you can check in the examples but here's a sample:

      bolt SomeBolt, :parallelism => 2 do
        [...]
      end

      configure do |env|
        max_task_parallelism 4
        num_workers 2
        max_spout_pending 100
      end

Let me know if you can make it work for you or if you have any more questions

bwalsh commented 10 years ago

Thanks very much for the quick response. Changing the source of the bolt from :global to :shuffle worked.

  bolt FilterBolt , :parallelism => 4 do
    source FileSpout, :shuffle
  end