From 12573956d3e61f10a372e122cabe8e560ebfbfab Mon Sep 17 00:00:00 2001 From: Shay Elkin Date: Thu, 10 Jan 2013 11:28:59 +0200 Subject: [PATCH] Fix native examples (missing argument for proxy constructors) --- examples/native/cluster_word_count_topology.rb | 8 ++++---- examples/native/local_exclamation_topology.rb | 14 +++++++------- examples/native/local_exclamation_topology2.rb | 12 ++++++------ examples/native/local_redis_word_count_topology.rb | 10 +++++----- examples/native/local_word_count_topology.rb | 8 ++++---- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/native/cluster_word_count_topology.rb b/examples/native/cluster_word_count_topology.rb index 72b6f49..3fa8a9e 100644 --- a/examples/native/cluster_word_count_topology.rb +++ b/examples/native/cluster_word_count_topology.rb @@ -10,9 +10,9 @@ module RedStorm def start(base_class_path, env) builder = TopologyBuilder.new - builder.setSpout('RandomSentenceSpout', JRubySpout.new(base_class_path, "RedStorm::Examples::RandomSentenceSpout"), 5) - builder.setBolt('SplitSentenceBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::SplitSentenceBolt"), 4).shuffleGrouping('RandomSentenceSpout') - builder.setBolt('WordCountBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::WordCountBolt"), 4).fieldsGrouping('SplitSentenceBolt', Fields.new("word")) + builder.setSpout('RandomSentenceSpout', JRubySpout.new(base_class_path, "RedStorm::Examples::RandomSentenceSpout", []), 5) + builder.setBolt('SplitSentenceBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::SplitSentenceBolt", []), 4).shuffleGrouping('RandomSentenceSpout') + builder.setBolt('WordCountBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::WordCountBolt", []), 4).fieldsGrouping('SplitSentenceBolt', Fields.new("word")) conf = Backtype::Config.new conf.setDebug(true) @@ -22,4 +22,4 @@ module RedStorm end end end -end \ No newline at end of file +end diff --git a/examples/native/local_exclamation_topology.rb b/examples/native/local_exclamation_topology.rb index c03fb0d..ac061ad 100644 --- a/examples/native/local_exclamation_topology.rb +++ b/examples/native/local_exclamation_topology.rb @@ -12,14 +12,14 @@ module RedStorm def start(base_class_path, env) builder = TopologyBuilder.new - - builder.setSpout('TestWordSpout', TestWordSpout.new, 10) - builder.setBolt('ExclamationBolt1', JRubyBolt.new(base_class_path, 'RedStorm::Examples::ExclamationBolt'), 3).shuffleGrouping('TestWordSpout') - builder.setBolt('ExclamationBolt2', JRubyBolt.new(base_class_path, 'RedStorm::Examples::ExclamationBolt'), 3).shuffleGrouping('ExclamationBolt1') - + + builder.setSpout('TestWordSpout', TestWordSpout.new, 10) + builder.setBolt('ExclamationBolt1', JRubyBolt.new(base_class_path, 'RedStorm::Examples::ExclamationBolt', []), 3).shuffleGrouping('TestWordSpout') + builder.setBolt('ExclamationBolt2', JRubyBolt.new(base_class_path, 'RedStorm::Examples::ExclamationBolt', []), 3).shuffleGrouping('ExclamationBolt1') + conf = Backtype::Config.new conf.setDebug(true) - + cluster = LocalCluster.new cluster.submitTopology("exclamation", conf, builder.createTopology) sleep(5) @@ -28,4 +28,4 @@ module RedStorm end end end -end \ No newline at end of file +end diff --git a/examples/native/local_exclamation_topology2.rb b/examples/native/local_exclamation_topology2.rb index fcec4bd..89730b0 100644 --- a/examples/native/local_exclamation_topology2.rb +++ b/examples/native/local_exclamation_topology2.rb @@ -29,14 +29,14 @@ module RedStorm def start(base_class_path, env) builder = TopologyBuilder.new - - builder.setSpout('TestWordSpout', TestWordSpout.new, 10) - builder.setBolt('ExclamationBolt21', JRubyBolt.new(base_class_path, "RedStorm::Examples::ExclamationBolt2"), 3).shuffleGrouping('TestWordSpout') - builder.setBolt('ExclamationBolt22', JRubyBolt.new(base_class_path, "RedStorm::Examples::ExclamationBolt2"), 2).shuffleGrouping('ExclamationBolt21') - + + builder.setSpout('TestWordSpout', TestWordSpout.new, 10) + builder.setBolt('ExclamationBolt21', JRubyBolt.new(base_class_path, "RedStorm::Examples::ExclamationBolt2", []), 3).shuffleGrouping('TestWordSpout') + builder.setBolt('ExclamationBolt22', JRubyBolt.new(base_class_path, "RedStorm::Examples::ExclamationBolt2", []), 2).shuffleGrouping('ExclamationBolt21') + conf = Backtype::Config.new conf.setDebug(true) - + cluster = LocalCluster.new cluster.submitTopology("exclamation", conf, builder.createTopology) sleep(5) diff --git a/examples/native/local_redis_word_count_topology.rb b/examples/native/local_redis_word_count_topology.rb index 07ef452..ce93b85 100644 --- a/examples/native/local_redis_word_count_topology.rb +++ b/examples/native/local_redis_word_count_topology.rb @@ -6,7 +6,7 @@ require 'examples/native/word_count_bolt' module RedStorm module Examples - # RedisWordSpout reads the Redis queue "test" on localhost:6379 + # RedisWordSpout reads the Redis queue "test" on localhost:6379 # and emits each word items pop'ed from the queue. class RedisWordSpout def open(conf, context, collector) @@ -14,7 +14,7 @@ module RedStorm @q = Queue.new @redis_reader = detach_redis_reader end - + def next_tuple # per doc nextTuple should not block, and sleep a bit when there's no data to process. if @q.size > 0 @@ -52,8 +52,8 @@ module RedStorm def start(base_class_path, env) builder = TopologyBuilder.new - builder.setSpout('RedisWordSpout', JRubySpout.new(base_class_path, "RedStorm::Examples::RedisWordSpout"), 1) - builder.setBolt('WordCountBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::WordCountBolt"), 3).fieldsGrouping('RedisWordSpout', Fields.new("word")) + builder.setSpout('RedisWordSpout', JRubySpout.new(base_class_path, "RedStorm::Examples::RedisWordSpout", []), 1) + builder.setBolt('WordCountBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::WordCountBolt", []), 3).fieldsGrouping('RedisWordSpout', Fields.new("word")) conf = Backtype::Config.new conf.setDebug(true) @@ -66,4 +66,4 @@ module RedStorm end end end -end \ No newline at end of file +end diff --git a/examples/native/local_word_count_topology.rb b/examples/native/local_word_count_topology.rb index 86da9c6..46c698f 100644 --- a/examples/native/local_word_count_topology.rb +++ b/examples/native/local_word_count_topology.rb @@ -10,9 +10,9 @@ module Examples def start(base_class_path, env) builder = TopologyBuilder.new - builder.setSpout('RandomSentenceSpout', JRubySpout.new(base_class_path, "RedStorm::Examples::RandomSentenceSpout"), 5) - builder.setBolt('SplitSentenceBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::SplitSentenceBolt"), 8).shuffleGrouping('RandomSentenceSpout') - builder.setBolt('WordCountBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::WordCountBolt"), 12).fieldsGrouping('SplitSentenceBolt', Fields.new("word")) + builder.setSpout('RandomSentenceSpout', JRubySpout.new(base_class_path, "RedStorm::Examples::RandomSentenceSpout", []), 5) + builder.setBolt('SplitSentenceBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::SplitSentenceBolt", []), 8).shuffleGrouping('RandomSentenceSpout') + builder.setBolt('WordCountBolt', JRubyBolt.new(base_class_path, "RedStorm::Examples::WordCountBolt", []), 12).fieldsGrouping('SplitSentenceBolt', Fields.new("word")) conf = Backtype::Config.new conf.setDebug(true) @@ -24,4 +24,4 @@ module Examples cluster.shutdown end end -end \ No newline at end of file +end