updated example Kafka topology dependencies

This commit is contained in:
Colin Surprenant 2013-07-23 23:20:51 -04:00
parent 12e88ea36b
commit f470d77648
3 changed files with 29 additions and 18 deletions

View File

@ -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
- [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

View File

@ -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:
#
# <?xml version="1.0"?>
# <ivy-module version="2.0">
# <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
# <info organisation="redstorm" module="topology-deps"/>
# <dependencies>
# <dependency org="org.jruby" name="jruby-core" rev="1.7.4" conf="default" transitive="true"/>
# <dependency org="org.scala-lang" name="scala-library" rev="2.8.0" conf="default" transitive="false"/>
# <dependency org="storm" name="kafka" rev="0.7.0-incubating" conf="default" transitive="false"/>
# <dependency org="storm" name="storm-kafka" rev="0.8.0-wip4" conf="default" transitive="false"/>
# <dependency org="org.scala-lang" name="scala-library" rev="2.9.2" conf="default" transitive="false"/>
# <dependency org="com.twitter" name="kafka_2.9.2" rev="0.7.0" conf="default" transitive="false"/>
# <dependency org="storm" name="storm-kafka" rev="0.9.0-wip16a-scala292" conf="default" transitive="true"/>
# <!-- explicitely specify jffi to also fetch the native jar. make sure to update jffi version matching jruby-core version -->
# <!-- this is the only way I found using Ivy to fetch the native jar -->
# <dependency org="com.github.jnr" name="jffi" rev="1.2.5" conf="default" transitive="true">
# <artifact name="jffi" type="jar" />
# <artifact name="jffi" type="jar" m:classifier="native"/>
# </dependency>
# </dependencies>
# </ivy-module>
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]

View File

@ -4,9 +4,9 @@
<resolvers>
<chain name="repositories">
<ibiblio name="ibiblio" m2compatible="true"/>
<ibiblio name="maven2" root="http://repo.maven.apache.org/maven2/" m2compatible="true"/>
<ibiblio name="sonatype" root="http://repo.maven.apache.org/maven2/" m2compatible="true"/>
<ibiblio name="clojars" root="http://clojars.org/repo/" m2compatible="true"/>
<ibiblio name="sonatype" root="http://repo.maven.apache.org/maven2/" m2compatible="true"/>
<ibiblio name="clojars" root="http://clojars.org/repo/" m2compatible="true"/>
<ibiblio name="conjars" root="http://conjars.org/repo/" m2compatible="true"/>
</chain>
</resolvers>
</ivysettings>