From f470d776485caddfa23a32d40c5720623d710cee Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Tue, 23 Jul 2013 23:20:51 -0400 Subject: [PATCH] updated example Kafka topology dependencies --- CHANGELOG.md | 7 +++++-- examples/dsl/kafka_topology.rb | 34 +++++++++++++++++++++------------- ivy/settings.xml | 6 +++--- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c27903..b006bc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,7 +91,10 @@ - improved DSL performance by refactoring closures invocation, see [redstorm-benchmark](https://github.com/colinsurprenant/redstorm-benchmark/) - fixed FFI support - exposed topology builder for specs -- [issue #11](https://github.com/colinsurprenant/redstorm/issues/11), [#17](https://github.com/colinsurprenant/redstorm/issues/17) - example specs using the Storm testing API see [redstorm-starter](https://github.com/colinsurprenant/redstorm-starter/) +- [issue #11](https://github.com/colinsurprenant/redstorm/issues/11), [#17](https://github.com/colinsurprenant/redstorm/issues/17) - example specs using the Storm testing API see [redstorm-starter](https://github.com/colinsurprenant/redsto rm-starter/) # 0.6.6.beta2, 07-20-2013 -- [issue #76](https://github.com/colinsurprenant/redstorm/issues/76) - avoid shelling out to storm jar command for cluster submission \ No newline at end of file +- [issue #76](https://github.com/colinsurprenant/redstorm/issues/76) - avoid shelling out to storm jar command for cluster submission + +# 0.6.6 WIP +- updated examples Kafka topology for new dependencies for Storm KafkaSpout \ No newline at end of file diff --git a/examples/dsl/kafka_topology.rb b/examples/dsl/kafka_topology.rb index 3eb1d00..43d6a6e 100644 --- a/examples/dsl/kafka_topology.rb +++ b/examples/dsl/kafka_topology.rb @@ -1,7 +1,6 @@ -java_import 'storm.kafka.KafkaConfig' java_import 'storm.kafka.SpoutConfig' -java_import 'storm.kafka.StringScheme' java_import 'storm.kafka.KafkaSpout' +java_import 'storm.kafka.KafkaConfig' require 'red_storm' @@ -12,28 +11,37 @@ require 'red_storm' # dependencies in the "ivy/topology_dependencies.xml" file in the root of your RedStorm project: # # -# +# # # # -# -# -# + +# +# +# + +# +# +# +# +# +# + # # +class SplitStringBolt < RedStorm::DSL::Bolt + on_receive {|tuple| tuple[0].split.map{|w| [w]}} +end + class KafkaTopology < RedStorm::DSL::Topology + spout_config = SpoutConfig.new( KafkaConfig::ZkHosts.new("localhost:2181", "/brokers"), "words", # topic to read from - "/kafkastorm", # Zookeeper root path to store the consumer offsets - "discovery" # Zookeeper consumer id to store the consumer offsets + "/kafkaspout", # Zookeeper root path to store the consumer offsets + "someid" # Zookeeper consumer id to store the consumer offsets ) - spout_config.scheme = StringScheme.new - - class SplitStringBolt < RedStorm::DSL::Bolt - on_receive {|tuple| tuple[0].split.map{|w| [w]}} - end spout KafkaSpout, [spout_config] diff --git a/ivy/settings.xml b/ivy/settings.xml index 32f82be..c75d9a4 100644 --- a/ivy/settings.xml +++ b/ivy/settings.xml @@ -4,9 +4,9 @@ - - - + + + \ No newline at end of file