fixed paths and dependencies
This commit is contained in:
parent
f1b8a8bb42
commit
ee297aed6c
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'red_storm'
|
||||
|
||||
class ExclamationBolt < RedStorm::SimpleBolt
|
||||
output_fields :word
|
||||
on_receive (:ack => true, :anchor => true) {|tuple| tuple.getString(0) + "!!!"}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'red_storm'
|
||||
|
||||
class RandomSentenceSpout < RedStorm::SimpleSpout
|
||||
set :is_distributed => true
|
||||
output_fields :word
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'red_storm'
|
||||
|
||||
class SplitSentenceBolt < RedStorm::SimpleBolt
|
||||
output_fields :word
|
||||
|
||||
|
|
|
@ -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}}
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue