cleaned up examples
This commit is contained in:
parent
78372b569a
commit
fecfba95b8
|
@ -24,10 +24,8 @@ module RedStorm
|
|||
configure do |env|
|
||||
debug false
|
||||
max_task_parallelism 4
|
||||
if env == :cluster
|
||||
num_workers 4
|
||||
max_spout_pending(1000)
|
||||
end
|
||||
num_workers 1
|
||||
max_spout_pending 1000
|
||||
end
|
||||
|
||||
on_submit do |env|
|
||||
|
|
|
@ -21,15 +21,14 @@ module RedStorm
|
|||
|
||||
bolt ExclamationBolt, :id => :ExclamationBolt2, :parallelism => 2 do
|
||||
source ExclamationBolt, :shuffle
|
||||
debug true
|
||||
end
|
||||
|
||||
configure do |env|
|
||||
debug true
|
||||
debug false
|
||||
max_task_parallelism 4
|
||||
if env == :cluster
|
||||
num_workers 4
|
||||
max_spout_pending(1000)
|
||||
end
|
||||
num_workers 1
|
||||
max_spout_pending 1000
|
||||
end
|
||||
|
||||
on_submit do |env|
|
||||
|
|
|
@ -19,4 +19,11 @@ class HelloWorldTopology < RedStorm::DSL::Topology
|
|||
bolt HelloWorldBolt do
|
||||
source HelloWorldSpout, :global
|
||||
end
|
||||
|
||||
configure do
|
||||
debug false
|
||||
max_task_parallelism 4
|
||||
num_workers 1
|
||||
max_spout_pending 1000
|
||||
end
|
||||
end
|
|
@ -48,10 +48,14 @@ class KafkaTopology < RedStorm::DSL::Topology
|
|||
bolt SplitStringBolt do
|
||||
output_fields :word
|
||||
source KafkaSpout, :shuffle
|
||||
debug true
|
||||
end
|
||||
|
||||
configure do |env|
|
||||
debug true
|
||||
debug false
|
||||
max_task_parallelism 4
|
||||
num_workers 1
|
||||
max_spout_pending 1000
|
||||
end
|
||||
|
||||
on_submit do |env|
|
||||
|
|
|
@ -39,19 +39,15 @@ module RedStorm
|
|||
spout RedisWordSpout
|
||||
|
||||
bolt WordCountBolt, :parallelism => 2 do
|
||||
debug true
|
||||
source RedisWordSpout, :fields => ["word"]
|
||||
end
|
||||
|
||||
configure do |env|
|
||||
debug true
|
||||
case env
|
||||
when :local
|
||||
max_task_parallelism 2
|
||||
when :cluster
|
||||
max_task_parallelism 2
|
||||
num_workers 2
|
||||
max_spout_pending(1000)
|
||||
end
|
||||
debug false
|
||||
max_task_parallelism 2
|
||||
num_workers 1
|
||||
max_spout_pending 1000
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,6 +24,8 @@ module RedStorm
|
|||
spout VersionSpout
|
||||
|
||||
configure do |env|
|
||||
max_task_parallelism 1
|
||||
num_workers 1
|
||||
debug false
|
||||
end
|
||||
|
||||
|
|
|
@ -13,16 +13,15 @@ module RedStorm
|
|||
end
|
||||
|
||||
bolt WordCountBolt, :parallelism => 2 do
|
||||
debug true
|
||||
source SplitSentenceBolt, :fields => ["word"]
|
||||
end
|
||||
|
||||
configure :word_count do |env|
|
||||
debug true
|
||||
debug false
|
||||
max_task_parallelism 4
|
||||
if env == :cluster
|
||||
num_workers 6
|
||||
max_spout_pending(1000)
|
||||
end
|
||||
num_workers 1
|
||||
max_spout_pending 1000
|
||||
end
|
||||
|
||||
on_submit do |env|
|
||||
|
|
Loading…
Reference in New Issue