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