From ee297aed6ca890f26aa6e2851276827a1ad118a0 Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Wed, 16 Nov 2011 16:47:37 -0500 Subject: [PATCH] fixed paths and dependencies --- examples/native/cluster_word_count_topology.rb | 8 ++++---- examples/native/local_exclamation_topology.rb | 4 ++-- examples/native/local_exclamation_topology2.rb | 2 +- examples/native/local_redis_word_count_topology.rb | 4 ++-- examples/native/local_word_count_topology.rb | 8 ++++---- examples/simple/exclamation_bolt.rb | 2 ++ examples/simple/exclamation_topology.rb | 1 - examples/simple/exclamation_topology2.rb | 1 - examples/simple/random_sentence_spout.rb | 2 ++ examples/simple/redis_word_count_topology.rb | 2 +- examples/simple/split_sentence_bolt.rb | 2 ++ examples/simple/word_count_bolt.rb | 2 ++ examples/simple/word_count_topology.rb | 1 - 13 files changed, 22 insertions(+), 17 deletions(-) diff --git a/examples/native/cluster_word_count_topology.rb b/examples/native/cluster_word_count_topology.rb index c40ab05..b710ea2 100644 --- a/examples/native/cluster_word_count_topology.rb +++ b/examples/native/cluster_word_count_topology.rb @@ -1,9 +1,9 @@ -require 'examples/random_sentence_spout' -require 'examples/split_sentence_bolt' -require 'examples/word_count_bolt' +require 'examples/native/random_sentence_spout' +require 'examples/native/split_sentence_bolt' +require 'examples/native/word_count_bolt' class ClusterWordCountTopology - def start(base_class_path) + def start(base_class_path, env) builder = TopologyBuilder.new builder.setSpout(1, JRubySpout.new(base_class_path, "RandomSentenceSpout"), 5) builder.setBolt(2, JRubyBolt.new(base_class_path, "SplitSentenceBolt"), 4).shuffleGrouping(1) diff --git a/examples/native/local_exclamation_topology.rb b/examples/native/local_exclamation_topology.rb index 17cda37..0d0361c 100644 --- a/examples/native/local_exclamation_topology.rb +++ b/examples/native/local_exclamation_topology.rb @@ -1,10 +1,10 @@ java_import 'backtype.storm.testing.TestWordSpout' -require 'examples/exclamation_bolt' +require 'examples/native/exclamation_bolt' # this example topology uses the Storm TestWordSpout and our own JRuby ExclamationBolt class LocalExclamationTopology - def start(base_class_path) + def start(base_class_path, env) builder = TopologyBuilder.new builder.setSpout(1, TestWordSpout.new, 10) diff --git a/examples/native/local_exclamation_topology2.rb b/examples/native/local_exclamation_topology2.rb index 8c97b0c..449d09e 100644 --- a/examples/native/local_exclamation_topology2.rb +++ b/examples/native/local_exclamation_topology2.rb @@ -18,7 +18,7 @@ end # this example topology uses the Storm TestWordSpout and our own JRuby ExclamationBolt class LocalExclamationTopology2 - def start(base_class_path) + def start(base_class_path, env) builder = TopologyBuilder.new builder.setSpout(1, TestWordSpout.new, 10) diff --git a/examples/native/local_redis_word_count_topology.rb b/examples/native/local_redis_word_count_topology.rb index 1755393..b83edd0 100644 --- a/examples/native/local_redis_word_count_topology.rb +++ b/examples/native/local_redis_word_count_topology.rb @@ -1,6 +1,6 @@ require 'redis' require 'thread' -require 'examples/word_count_bolt' +require 'examples/native/word_count_bolt' # RedisWordSpout reads the Redis queue "test" on localhost:6379 # and emits each word items pop'ed from the queue. @@ -41,7 +41,7 @@ class RedisWordSpout end class LocalRedisWordCountTopology - def start(base_class_path) + def start(base_class_path, env) builder = TopologyBuilder.new builder.setSpout(1, JRubySpout.new(base_class_path, "RedisWordSpout"), 1) builder.setBolt(2, JRubyBolt.new(base_class_path, "WordCountBolt"), 3).fieldsGrouping(1, Fields.new("word")) diff --git a/examples/native/local_word_count_topology.rb b/examples/native/local_word_count_topology.rb index 65af1c7..c9bdc9e 100644 --- a/examples/native/local_word_count_topology.rb +++ b/examples/native/local_word_count_topology.rb @@ -1,9 +1,9 @@ -require 'examples/random_sentence_spout' -require 'examples/split_sentence_bolt' -require 'examples/word_count_bolt' +require 'examples/native/random_sentence_spout' +require 'examples/native/split_sentence_bolt' +require 'examples/native/word_count_bolt' class LocalWordCountTopology - def start(base_class_path) + def start(base_class_path, env) builder = TopologyBuilder.new builder.setSpout(1, JRubySpout.new(base_class_path, "RandomSentenceSpout"), 5) builder.setBolt(2, JRubyBolt.new(base_class_path, "SplitSentenceBolt"), 8).shuffleGrouping(1) diff --git a/examples/simple/exclamation_bolt.rb b/examples/simple/exclamation_bolt.rb index 36a1093..7299e91 100644 --- a/examples/simple/exclamation_bolt.rb +++ b/examples/simple/exclamation_bolt.rb @@ -1,3 +1,5 @@ +require 'red_storm' + class ExclamationBolt < RedStorm::SimpleBolt output_fields :word on_receive (:ack => true, :anchor => true) {|tuple| tuple.getString(0) + "!!!"} diff --git a/examples/simple/exclamation_topology.rb b/examples/simple/exclamation_topology.rb index 6dc5517..f0202e7 100644 --- a/examples/simple/exclamation_topology.rb +++ b/examples/simple/exclamation_topology.rb @@ -1,6 +1,5 @@ java_import 'backtype.storm.testing.TestWordSpout' -require 'red_storm' require 'examples/simple/exclamation_bolt' # this example topology uses the Storm TestWordSpout and our own JRuby ExclamationBolt diff --git a/examples/simple/exclamation_topology2.rb b/examples/simple/exclamation_topology2.rb index f790e8c..dc4cdf7 100644 --- a/examples/simple/exclamation_topology2.rb +++ b/examples/simple/exclamation_topology2.rb @@ -1,5 +1,4 @@ java_import 'backtype.storm.testing.TestWordSpout' - require 'red_storm' # this example topology uses the Storm TestWordSpout and our own JRuby ExclamationBolt diff --git a/examples/simple/random_sentence_spout.rb b/examples/simple/random_sentence_spout.rb index 9602a1d..a0950ff 100644 --- a/examples/simple/random_sentence_spout.rb +++ b/examples/simple/random_sentence_spout.rb @@ -1,3 +1,5 @@ +require 'red_storm' + class RandomSentenceSpout < RedStorm::SimpleSpout set :is_distributed => true output_fields :word diff --git a/examples/simple/redis_word_count_topology.rb b/examples/simple/redis_word_count_topology.rb index 3203a80..fe086c5 100644 --- a/examples/simple/redis_word_count_topology.rb +++ b/examples/simple/redis_word_count_topology.rb @@ -1,7 +1,7 @@ require 'redis' require 'thread' - require 'red_storm' + require 'examples/simple/word_count_bolt' # RedisWordSpout reads the Redis queue "test" on localhost:6379 diff --git a/examples/simple/split_sentence_bolt.rb b/examples/simple/split_sentence_bolt.rb index d9d4abd..e61670f 100644 --- a/examples/simple/split_sentence_bolt.rb +++ b/examples/simple/split_sentence_bolt.rb @@ -1,3 +1,5 @@ +require 'red_storm' + class SplitSentenceBolt < RedStorm::SimpleBolt output_fields :word diff --git a/examples/simple/word_count_bolt.rb b/examples/simple/word_count_bolt.rb index 44a1d53..94bc2cb 100644 --- a/examples/simple/word_count_bolt.rb +++ b/examples/simple/word_count_bolt.rb @@ -1,3 +1,5 @@ +require 'red_storm' + class WordCountBolt < RedStorm::SimpleBolt output_fields :word, :count on_init {@counts = Hash.new{|h, k| h[k] = 0}} diff --git a/examples/simple/word_count_topology.rb b/examples/simple/word_count_topology.rb index 402c86e..85b85dc 100644 --- a/examples/simple/word_count_topology.rb +++ b/examples/simple/word_count_topology.rb @@ -1,4 +1,3 @@ -require 'red_storm' require 'examples/simple/random_sentence_spout' require 'examples/simple/split_sentence_bolt' require 'examples/simple/word_count_bolt'