diff --git a/examples/native/Gemfile b/examples/native/Gemfile new file mode 100644 index 0000000..c646e60 --- /dev/null +++ b/examples/native/Gemfile @@ -0,0 +1,2 @@ +source :rubygems +gem 'redis' \ No newline at end of file diff --git a/examples/native/cluster_word_count_topology.rb b/examples/native/cluster_word_count_topology.rb index 16daff7..72b6f49 100644 --- a/examples/native/cluster_word_count_topology.rb +++ b/examples/native/cluster_word_count_topology.rb @@ -14,7 +14,7 @@ module RedStorm 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 = Config.new + conf = Backtype::Config.new conf.setDebug(true) conf.setNumWorkers(20); conf.setMaxSpoutPending(1000); diff --git a/examples/native/exclamation_bolt.rb b/examples/native/exclamation_bolt.rb index bb81213..f3f1532 100644 --- a/examples/native/exclamation_bolt.rb +++ b/examples/native/exclamation_bolt.rb @@ -10,6 +10,9 @@ module RedStorm @collector.ack(tuple) end + def get_component_configuration + end + def declare_output_fields(declarer) declarer.declare(Fields.new("word")) end diff --git a/examples/native/local_exclamation_topology.rb b/examples/native/local_exclamation_topology.rb index 065237d..c03fb0d 100644 --- a/examples/native/local_exclamation_topology.rb +++ b/examples/native/local_exclamation_topology.rb @@ -17,7 +17,7 @@ module RedStorm 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 = Config.new + conf = Backtype::Config.new conf.setDebug(true) cluster = LocalCluster.new diff --git a/examples/native/local_exclamation_topology2.rb b/examples/native/local_exclamation_topology2.rb index 9f14795..fcec4bd 100644 --- a/examples/native/local_exclamation_topology2.rb +++ b/examples/native/local_exclamation_topology2.rb @@ -14,6 +14,9 @@ module RedStorm @collector.ack(tuple) end + def get_component_configuration + end + def declare_output_fields(declarer) declarer.declare(Fields.new("word")) end @@ -31,7 +34,7 @@ module RedStorm 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 = Config.new + conf = Backtype::Config.new conf.setDebug(true) cluster = LocalCluster.new diff --git a/examples/native/local_redis_word_count_topology.rb b/examples/native/local_redis_word_count_topology.rb index cc89480..07ef452 100644 --- a/examples/native/local_redis_word_count_topology.rb +++ b/examples/native/local_redis_word_count_topology.rb @@ -1,3 +1,4 @@ +require 'bundler/setup' require 'redis' require 'thread' require 'lib/red_storm' @@ -23,6 +24,9 @@ module RedStorm end end + def get_component_configuration + end + def declare_output_fields(declarer) declarer.declare(Fields.new("word")) end @@ -51,7 +55,7 @@ module RedStorm 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 = Config.new + conf = Backtype::Config.new conf.setDebug(true) conf.setMaxTaskParallelism(3) diff --git a/examples/native/local_word_count_topology.rb b/examples/native/local_word_count_topology.rb index 9631df7..86da9c6 100644 --- a/examples/native/local_word_count_topology.rb +++ b/examples/native/local_word_count_topology.rb @@ -14,7 +14,7 @@ module Examples 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 = Config.new + conf = Backtype::Config.new conf.setDebug(true) conf.setMaxTaskParallelism(3) diff --git a/examples/native/random_sentence_spout.rb b/examples/native/random_sentence_spout.rb index bd8c69a..0e31c1b 100644 --- a/examples/native/random_sentence_spout.rb +++ b/examples/native/random_sentence_spout.rb @@ -1,10 +1,7 @@ module RedStorm module Examples class RandomSentenceSpout - attr_reader :is_distributed - def initialize - @is_distributed = true @sentences = [ "the cow jumped over the moon", "an apple a day keeps the doctor away", @@ -22,6 +19,9 @@ module RedStorm @collector.emit(Values.new(@sentences[rand(@sentences.length)])) end + def get_component_configuration + end + def declare_output_fields(declarer) declarer.declare(Fields.new("word")) end diff --git a/examples/native/split_sentence_bolt.rb b/examples/native/split_sentence_bolt.rb index e4699ce..da24e3f 100644 --- a/examples/native/split_sentence_bolt.rb +++ b/examples/native/split_sentence_bolt.rb @@ -9,6 +9,9 @@ module RedStorm tuple.getString(0).split(" ").each {|w| @collector.emit(Values.new(w)) } end + def get_component_configuration + end + def declare_output_fields(declarer) declarer.declare(Fields.new("word")) end diff --git a/examples/native/word_count_bolt.rb b/examples/native/word_count_bolt.rb index d3436ba..f9b5ee8 100644 --- a/examples/native/word_count_bolt.rb +++ b/examples/native/word_count_bolt.rb @@ -15,6 +15,9 @@ module RedStorm @collector.emit(Values.new(word, @counts[word])) end + def get_component_configuration + end + def declare_output_fields(declarer) declarer.declare(Fields.new("word", "count")) end