From fecfba95b8ab72d9524419f7ffa95ba2472c52ef Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Mon, 29 Jul 2013 15:07:58 -0400 Subject: [PATCH] cleaned up examples --- examples/dsl/exclamation_topology.rb | 6 ++---- examples/dsl/exclamation_topology2.rb | 9 ++++----- examples/dsl/hello_world_topology.rb | 7 +++++++ examples/dsl/kafka_topology.rb | 6 +++++- examples/dsl/redis_word_count_topology.rb | 14 +++++--------- examples/dsl/ruby_version_topology.rb | 2 ++ examples/dsl/word_count_topology.rb | 9 ++++----- 7 files changed, 29 insertions(+), 24 deletions(-) diff --git a/examples/dsl/exclamation_topology.rb b/examples/dsl/exclamation_topology.rb index 22f637e..9db5170 100644 --- a/examples/dsl/exclamation_topology.rb +++ b/examples/dsl/exclamation_topology.rb @@ -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| diff --git a/examples/dsl/exclamation_topology2.rb b/examples/dsl/exclamation_topology2.rb index 4f23197..08d8e5c 100644 --- a/examples/dsl/exclamation_topology2.rb +++ b/examples/dsl/exclamation_topology2.rb @@ -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| diff --git a/examples/dsl/hello_world_topology.rb b/examples/dsl/hello_world_topology.rb index 9c7ce97..08b5630 100644 --- a/examples/dsl/hello_world_topology.rb +++ b/examples/dsl/hello_world_topology.rb @@ -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 \ No newline at end of file diff --git a/examples/dsl/kafka_topology.rb b/examples/dsl/kafka_topology.rb index 43d6a6e..c2d6a0f 100644 --- a/examples/dsl/kafka_topology.rb +++ b/examples/dsl/kafka_topology.rb @@ -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| diff --git a/examples/dsl/redis_word_count_topology.rb b/examples/dsl/redis_word_count_topology.rb index 0073cc4..d2157a7 100644 --- a/examples/dsl/redis_word_count_topology.rb +++ b/examples/dsl/redis_word_count_topology.rb @@ -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 diff --git a/examples/dsl/ruby_version_topology.rb b/examples/dsl/ruby_version_topology.rb index de7b515..64b587f 100644 --- a/examples/dsl/ruby_version_topology.rb +++ b/examples/dsl/ruby_version_topology.rb @@ -24,6 +24,8 @@ module RedStorm spout VersionSpout configure do |env| + max_task_parallelism 1 + num_workers 1 debug false end diff --git a/examples/dsl/word_count_topology.rb b/examples/dsl/word_count_topology.rb index ff2fef9..1e7e2c1 100644 --- a/examples/dsl/word_count_topology.rb +++ b/examples/dsl/word_count_topology.rb @@ -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|