redstorm 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +9 -0
- data/README.md +206 -103
- data/examples/native/cluster_word_count_topology.rb +5 -5
- data/examples/native/local_exclamation_topology.rb +8 -8
- data/examples/native/local_exclamation_topology2.rb +7 -7
- data/examples/native/local_redis_word_count_topology.rb +7 -8
- data/examples/native/local_word_count_topology.rb +5 -5
- data/examples/simple/exclamation_topology.rb +7 -11
- data/examples/simple/exclamation_topology2.rb +10 -12
- data/examples/simple/hello_world_topology.rb +22 -0
- data/examples/simple/kafka_topology.rb +2 -1
- data/examples/simple/redis_word_count_topology.rb +3 -5
- data/examples/simple/ruby_version_topology.rb +7 -1
- data/examples/simple/word_count_topology.rb +8 -10
- data/ivy/settings.xml +1 -0
- data/ivy/storm_dependencies.xml +8 -0
- data/ivy/topology_dependencies.xml +7 -0
- data/lib/red_storm.rb +1 -0
- data/lib/red_storm/application.rb +9 -7
- data/lib/red_storm/configurator.rb +1 -1
- data/lib/red_storm/proxy/batch_bolt.rb +63 -0
- data/lib/red_storm/proxy/batch_committer_bolt.rb +52 -0
- data/lib/red_storm/proxy/batch_spout.rb +59 -0
- data/lib/red_storm/proxy/proxy_function.rb +40 -0
- data/lib/red_storm/proxy/transactional_committer_spout.rb +47 -0
- data/lib/red_storm/proxy/transactional_spout.rb +46 -0
- data/lib/red_storm/simple_drpc_topology.rb +87 -0
- data/lib/red_storm/simple_topology.rb +14 -4
- data/lib/red_storm/topology_launcher.rb +22 -3
- data/lib/red_storm/version.rb +1 -1
- data/lib/tasks/red_storm.rake +66 -104
- data/redstorm.gemspec +24 -0
- data/src/main/redstorm/storm/jruby/JRubyBatchBolt.java +90 -0
- data/src/main/redstorm/storm/jruby/JRubyBatchCommitterBolt.java +9 -0
- data/src/main/redstorm/storm/jruby/JRubyBatchSpout.java +88 -0
- data/src/main/redstorm/storm/jruby/JRubyProxyFunction.java +51 -0
- data/src/main/redstorm/storm/jruby/JRubyShellSpout.java +1 -1
- data/src/main/redstorm/storm/jruby/JRubyTransactionalBolt.java +90 -0
- data/src/main/redstorm/storm/jruby/JRubyTransactionalCommitterBolt.java +31 -0
- data/src/main/redstorm/storm/jruby/JRubyTransactionalCommitterSpout.java +44 -0
- data/src/main/redstorm/storm/jruby/JRubyTransactionalSpout.java +89 -0
- metadata +35 -14
- data/examples/native/Gemfile +0 -2
data/CHANGELOG.md
CHANGED
@@ -72,3 +72,12 @@
|
|
72
72
|
- issue #47, Log4j Logger class conflict
|
73
73
|
- issue #48, add support for external Jars
|
74
74
|
- issue #50, update RedStorm to target Storm 0.8
|
75
|
+
|
76
|
+
# 0.6.5, 05-13-2013
|
77
|
+
- Storm 0.8.2 and JRuby 1.7.3
|
78
|
+
- added vagrant/chef configurations for single node Storm cluster test environment
|
79
|
+
- issue #52 - transactional topologies
|
80
|
+
- issue #56 - make topology class configure statement optional
|
81
|
+
- issue #57 - DRPC topologies
|
82
|
+
- issue #73, external jars dependencies Ivy configurations completely externalized and configurable
|
83
|
+
- lots of other [bug fixes and improvements](https://github.com/colinsurprenant/redstorm/issues?milestone=9&page=1&state=closed)
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# RedStorm v0.6.
|
1
|
+
# RedStorm v0.6.5 - JRuby on Storm
|
2
2
|
|
3
3
|
[![build status](https://secure.travis-ci.org/colinsurprenant/redstorm.png)](http://travis-ci.org/colinsurprenant/redstorm)
|
4
4
|
|
@@ -14,38 +14,11 @@ Chances are new versions of RedStorm will introduce changes that will break comp
|
|
14
14
|
- [RedStorm Gem v0.5.0 Documentation](https://github.com/colinsurprenant/redstorm/wiki/RedStorm-Gem-v0.5.0-Documentation)
|
15
15
|
- [RedStorm Gem v0.5.1 Documentation](https://github.com/colinsurprenant/redstorm/wiki/RedStorm-Gem-v0.5.1-Documentation)
|
16
16
|
- [RedStorm Gem v0.6.3 Documentation](https://github.com/colinsurprenant/redstorm/wiki/RedStorm-Gem-v0.6.3-Documentation)
|
17
|
+
- [RedStorm Gem v0.6.4 Documentation](https://github.com/colinsurprenant/redstorm/wiki/RedStorm-Gem-v0.6.4-Documentation)
|
17
18
|
|
18
19
|
## Dependencies
|
19
20
|
|
20
|
-
Tested on **OSX 10.8.
|
21
|
-
|
22
|
-
## Notes about 1.8/1.9 JRuby compatibility
|
23
|
-
|
24
|
-
Up until the upcoming JRuby 1.7, JRuby runs in 1.8 Ruby compatibility mode by default. Unless you have a specific need to run topologies in 1.8 mode, you should use 1.9 mode, which will become the default in JRuby.
|
25
|
-
|
26
|
-
There are two ways to have JRuby 1.6.x run in 1.9 mode by default:
|
27
|
-
- by setting the JRUBY_OPTS env variable
|
28
|
-
|
29
|
-
``` sh
|
30
|
-
$ export JRUBY_OPTS=--1.9
|
31
|
-
```
|
32
|
-
- by installing JRuby using RVM with 1.9 mode by default
|
33
|
-
|
34
|
-
``` sh
|
35
|
-
$ rvm install jruby --1.9
|
36
|
-
```
|
37
|
-
|
38
|
-
Otherwise, to manually choose the JRuby compatibility mode, this JRuby syntax can be used
|
39
|
-
|
40
|
-
``` sh
|
41
|
-
$ jruby --1.9 -S redstorm ...
|
42
|
-
```
|
43
|
-
|
44
|
-
By defaut, a topology will be executed in the **same mode** as the interpreter running the `$ redstorm` command. You can force RedStorm to choose a specific JRuby compatibility mode using the [--1.8|--1.9] parameter for the topology execution in local or remote cluster.
|
45
|
-
|
46
|
-
``` sh
|
47
|
-
$ redstorm local|cluster [--1.8|--1.9] ...
|
48
|
-
```
|
21
|
+
Tested on **OSX 10.8.3** and **Ubuntu Linux 12.10** using **Storm 0.8.2** and **JRuby 1.7.3** and **OpenJDK 7**
|
49
22
|
|
50
23
|
## Installation
|
51
24
|
|
@@ -58,39 +31,72 @@ $ redstorm local|cluster [--1.8|--1.9] ...
|
|
58
31
|
- Bundler
|
59
32
|
|
60
33
|
``` ruby
|
61
|
-
source
|
62
|
-
gem "redstorm", "~> 0.6.
|
34
|
+
source "https://rubygems.org"
|
35
|
+
gem "redstorm", "~> 0.6.5"
|
63
36
|
```
|
64
37
|
|
65
|
-
## Usage
|
38
|
+
## Usage
|
66
39
|
|
67
|
-
|
68
|
-
- install the [RedStorm gem](http://rubygems.org/gems/redstorm).
|
69
|
-
- create a subdirectory for your topology code.
|
70
|
-
- perform the initial setup as described below to build and install dependencies.
|
71
|
-
- run your topology in local mode and/or on a remote cluster as described below.
|
40
|
+
### Overview
|
72
41
|
|
73
|
-
|
42
|
+
- create a project directory
|
43
|
+
- install the [RedStorm gem](http://rubygems.org/gems/redstorm)
|
44
|
+
- create a subdirectory for your topology code
|
45
|
+
- perform the initial setup as to build and install dependencies
|
74
46
|
|
75
|
-
``` sh
|
76
|
-
$ redstorm install
|
77
|
-
```
|
47
|
+
``` sh
|
48
|
+
$ redstorm install
|
49
|
+
```
|
50
|
+
- run your topology in local mode
|
78
51
|
|
79
|
-
|
52
|
+
``` sh
|
53
|
+
$ redstorm local <path/to/topology_class_file_name.rb>
|
54
|
+
```
|
55
|
+
|
56
|
+
### Initial setup
|
80
57
|
|
81
58
|
``` sh
|
82
|
-
$
|
59
|
+
$ redstorm install
|
83
60
|
```
|
84
61
|
|
85
|
-
This will
|
62
|
+
This will install default Java jar dependencies in `target/dependency`, generate & compile the Java bindings in `target/classes`.
|
86
63
|
|
87
64
|
### Create a topology
|
88
65
|
|
89
66
|
Create a subdirectory for your topology code and create your topology class **using this naming convention**: *underscore* topology_class_file_name.rb **MUST** correspond to its *CamelCase* class name.
|
90
67
|
|
68
|
+
Here's an example [hello_world_topology.rb](https://github.com/colinsurprenant/redstorm/tree/master/examples/simple/hello_world_topology.rb)
|
69
|
+
|
70
|
+
``` ruby
|
71
|
+
require 'red_storm'
|
72
|
+
|
73
|
+
class HelloWorldSpout < RedStorm::SimpleSpout
|
74
|
+
on_init {@words = ["hello", "world"]}
|
75
|
+
on_send {@words.shift unless @words.empty?}
|
76
|
+
end
|
77
|
+
|
78
|
+
class HelloWorldBolt < RedStorm::SimpleBolt
|
79
|
+
on_receive :emit => false do |tuple|
|
80
|
+
log.info(tuple.getString(0))
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
class HelloWorldTopology < RedStorm::SimpleTopology
|
85
|
+
spout HelloWorldSpout do
|
86
|
+
output_fields :word
|
87
|
+
end
|
88
|
+
|
89
|
+
bolt HelloWorldBolt do
|
90
|
+
source HelloWorldSpout, :global
|
91
|
+
end
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
91
95
|
### Gems in your topology
|
92
96
|
|
93
|
-
RedStorm requires [Bundler](http://gembundler.com/)
|
97
|
+
RedStorm requires [Bundler](http://gembundler.com/) if gems are needed **in your topology**. Supply a `Gemfile` in the root of your project directory with the gems required in your topology. If you are using Bundler also for other gems than those required in the topology **you should** group the topology gems in a Bunder group of your choice.
|
98
|
+
|
99
|
+
Note that bundler is only used to help package the gems **prior** to running a topology. Your topology code should **not** use Bundler. With `require "red_storm"` in your topology class file, RedStorm will take care of setting the gems path. Do **not** `require 'bundler/setup'` in the topology.
|
94
100
|
|
95
101
|
1. have Bundler install the gems locally
|
96
102
|
|
@@ -98,71 +104,85 @@ RedStorm requires [Bundler](http://gembundler.com/) **if gems are needed** in yo
|
|
98
104
|
$ bundle install
|
99
105
|
```
|
100
106
|
|
101
|
-
|
107
|
+
2. copy the topology gems into the `target/gems` directory
|
102
108
|
|
103
109
|
``` sh
|
104
|
-
$
|
110
|
+
$ redstorm bundle [BUNDLER_GROUP]
|
105
111
|
```
|
106
112
|
|
107
|
-
|
113
|
+
3. make sure your topology class has `require "red_storm"`
|
108
114
|
|
109
|
-
```
|
110
|
-
|
115
|
+
```ruby
|
116
|
+
require 'red_storm'
|
111
117
|
```
|
112
118
|
|
113
|
-
|
119
|
+
The `redstorm bundle` command copy the gems specified in the Gemfile (in a specific group if specified) into the `target/gems` directory. In order for the topology to run in a Storm cluster, the fully *installed* gems must be packaged and self-contained into a single jar file. This has an important consequence: the gems will not be *installed* on the cluster target machines, they are already *installed* in the jar file. This **could lead to problems** if the machine used to *install* the gems is of a different architecture than the cluster target machines **and** some of these gems have **C or FFI** extensions.
|
114
120
|
|
115
|
-
|
121
|
+
### Custom Jar dependencies in your topology (XML Warning! :P)
|
116
122
|
|
117
|
-
|
123
|
+
By defaut, RedStorm installs Storm and JRuby jars dependencies into `target/dependency`. RedStorm uses [Ivy](https://ant.apache.org/ivy/) 2.3 to manage dependencies. You can fully control and customize these dependencies.
|
118
124
|
|
119
|
-
|
125
|
+
There are two distinct sets of dependencies: the `storm` dependencies manages the requirements (Storm jars) for the Storm **local mode** runtime. The `topology` dependencies manages the requirements (JRuby jars) for the **topology** runtime.
|
120
126
|
|
121
|
-
|
122
|
-
{
|
123
|
-
:storm_artifacts => [
|
124
|
-
"storm:storm:0.8.1, transitive=true",
|
125
|
-
],
|
126
|
-
:topology_artifacts => [
|
127
|
-
"org.jruby:jruby-complete:1.6.8, transitive=false",
|
128
|
-
"org.scala-lang:scala-library:2.8.0, transitive=false",
|
129
|
-
"storm:kafka:0.7.0-incubating, transitive=false",
|
130
|
-
"storm:storm-kafka:0.8.0-wip4, transitive=false",
|
131
|
-
],
|
132
|
-
}
|
133
|
-
```
|
127
|
+
You can supply custom `storm` and `topology` dependencies by creating `ivy/storm_dependencies.xml` and `ivy/topology_dependencies.xml` files. Below are the current default content for these files:
|
134
128
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
<
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
129
|
+
- `ivy/storm_dependencies.xml`
|
130
|
+
|
131
|
+
``` xml
|
132
|
+
<?xml version="1.0"?>
|
133
|
+
<ivy-module version="2.0">
|
134
|
+
<info organisation="redstorm" module="storm-deps"/>
|
135
|
+
<dependencies>
|
136
|
+
<dependency org="storm" name="storm" rev="0.8.2" conf="default" transitive="true" />
|
137
|
+
<override org="org.slf4j" module="slf4j-log4j12" rev="1.6.3"/>
|
138
|
+
</dependencies>
|
139
|
+
</ivy-module>
|
140
|
+
```
|
141
|
+
|
142
|
+
- `ivy/topology_dependencies.xml`
|
143
|
+
|
144
|
+
``` xml
|
145
|
+
<?xml version="1.0"?>
|
146
|
+
<ivy-module version="2.0">
|
147
|
+
<info organisation="redstorm" module="topology-deps"/>
|
148
|
+
<dependencies>
|
149
|
+
<dependency org="org.jruby" name="jruby-core" rev="1.7.3" conf="default" transitive="true"/>
|
150
|
+
</dependencies>
|
151
|
+
</ivy-module>
|
152
|
+
```
|
153
|
+
|
154
|
+
The jars repositories can be configured by adding the `ivy/settings.xml` file in the root of your project. For information on the Ivy settings format, see the [Ivy Settings Documentation](http://ant.apache.org/ivy/history/2.3.0/settings.html). Below is the current default:
|
155
|
+
|
156
|
+
- `ivy/settings.xml`
|
157
|
+
|
158
|
+
``` xml
|
159
|
+
<?xml version="1.0"?>
|
160
|
+
<ivysettings>
|
161
|
+
<settings defaultResolver="repositories"/>
|
162
|
+
<resolvers>
|
163
|
+
<chain name="repositories">
|
164
|
+
<ibiblio name="ibiblio" m2compatible="true"/>
|
165
|
+
<ibiblio name="maven2" root="http://repo.maven.apache.org/maven2/" m2compatible="true"/>
|
166
|
+
<ibiblio name="sonatype" root="http://repo.maven.apache.org/maven2/" m2compatible="true"/>
|
167
|
+
<ibiblio name="clojars" root="http://clojars.org/repo/" m2compatible="true"/>
|
168
|
+
</chain>
|
169
|
+
</resolvers>
|
170
|
+
</ivysettings>
|
171
|
+
```
|
152
172
|
|
153
173
|
### Run in local mode
|
154
174
|
|
155
175
|
``` sh
|
156
|
-
$ redstorm local
|
176
|
+
$ redstorm local <path/to/topology_class_file_name.rb>
|
157
177
|
```
|
158
178
|
|
159
|
-
By defaut, a topology will be executed in the **same mode** as the interpreter running the `$ redstorm` command. You can force RedStorm to choose a specific JRuby compatibility mode using the [--1.8|--1.9] parameter for the topology execution in local or remote cluster.
|
160
|
-
|
161
179
|
**See examples below** to run examples in local mode or on a production cluster.
|
162
180
|
|
163
181
|
### Run on production cluster
|
164
182
|
|
165
|
-
|
183
|
+
The Storm distribution is currently required for the cluster topology submission.
|
184
|
+
|
185
|
+
1. download and unpack the [Storm 0.8.2 distribution](https://dl.dropbox.com/u/133901206/storm-0.8.2.zip) locally and **add** the Storm `bin/` directory to your `$PATH`.
|
166
186
|
|
167
187
|
2. generate `target/cluster-topology.jar`. This jar file will include your sources directory plus the required dependencies
|
168
188
|
|
@@ -173,11 +193,9 @@ By defaut, a topology will be executed in the **same mode** as the interpreter r
|
|
173
193
|
3. submit the cluster topology jar file to the cluster
|
174
194
|
|
175
195
|
``` sh
|
176
|
-
$ redstorm cluster
|
196
|
+
$ redstorm cluster <sources_directory/topology_class_file_name.rb>
|
177
197
|
```
|
178
198
|
|
179
|
-
By defaut, a topology will be executed in the **same mode** as the interpreter running the `$ redstorm` command. You can force RedStorm to choose a specific JRuby compatibility mode using the [--1.8|--1.9] parameter for the topology execution in local or remote cluster.
|
180
|
-
|
181
199
|
The [Storm wiki](https://github.com/nathanmarz/storm/wiki) has instructions on [setting up a production cluster](https://github.com/nathanmarz/storm/wiki/Setting-up-a-Storm-cluster). You can also [manually submit your topology](https://github.com/nathanmarz/storm/wiki/Running-topologies-on-a-production-cluster).
|
182
200
|
|
183
201
|
## Examples
|
@@ -188,7 +206,7 @@ Install the [example files](https://github.com/colinsurprenant/redstorm/tree/mas
|
|
188
206
|
$ redstorm examples
|
189
207
|
```
|
190
208
|
|
191
|
-
All examples using the [
|
209
|
+
All examples using the [DSL](https://github.com/colinsurprenant/redstorm/wiki/Ruby-DSL-Documentation) are located in `examples/simple`. Examples using the standard Java interface are in `examples/native`.
|
192
210
|
|
193
211
|
### Local mode
|
194
212
|
|
@@ -207,10 +225,10 @@ For `examples/simple/redis_word_count_topology.rb` the `redis` gem is required a
|
|
207
225
|
1. create a `Gemfile`
|
208
226
|
|
209
227
|
``` ruby
|
210
|
-
source
|
228
|
+
source "https://rubygems.org"
|
211
229
|
|
212
230
|
group :word_count do
|
213
|
-
|
231
|
+
gem "redis"
|
214
232
|
end
|
215
233
|
```
|
216
234
|
|
@@ -231,7 +249,7 @@ Using `redis-cli` push words into the `test` list and watch Storm pick them up
|
|
231
249
|
|
232
250
|
### Remote cluster
|
233
251
|
|
234
|
-
All examples using the [
|
252
|
+
All examples using the [DSL](https://github.com/colinsurprenant/redstorm/wiki/Ruby-DSL-Documentation) can run in both local or on a remote cluster. The only **native** example compatible with a remote cluster is `examples/native/cluster_word_count_topology.rb`.
|
235
253
|
|
236
254
|
|
237
255
|
#### Topologies without gems
|
@@ -258,7 +276,7 @@ For `examples/simple/redis_word_count_topology.rb` the `redis` gem is required a
|
|
258
276
|
1. create a `Gemfile`
|
259
277
|
|
260
278
|
``` ruby
|
261
|
-
source
|
279
|
+
source "https://rubygems.org"
|
262
280
|
|
263
281
|
group :word_count do
|
264
282
|
gem "redis"
|
@@ -311,13 +329,39 @@ end
|
|
311
329
|
|
312
330
|
See the [shell topology example](https://github.com/colinsurprenant/redstorm/tree/master/examples/shell)
|
313
331
|
|
332
|
+
## Transactional and LinearDRPC topologies
|
333
|
+
|
334
|
+
Despite the fact that both transactional and linear DRPC topologies are now [deprecated as of Storm 0.8.1](https://github.com/nathanmarz/storm/blob/master/CHANGELOG.md) work on these has been merged in RedStorm 0.6.5. Lots of the work done on this is required toward Storm Trident topologies. Documentation and examples for transactional and linear DRPC topologies will be added shorty.
|
335
|
+
|
336
|
+
## Known issues
|
337
|
+
|
338
|
+
- SnakeYAML conflict between Storm and JRuby
|
339
|
+
|
340
|
+
See [issue](https://github.com/colinsurprenant/redstorm/issues/78). This is a classic Java world jar conflict. Storm 0.8.2 uses snakeyaml 1.9 and JRuby 1.7.3 uses snakeyaml 1.11. If you try to use YAML serialization in your topology it will crash with an exception. This problem is easy to solve when running topologies in **local** mode, simply override in the storm dependencies with the correct jar version. You can do this be creating a custom storm dependencies:
|
341
|
+
|
342
|
+
- `ivy/storm_dependencies.xml`
|
343
|
+
|
344
|
+
``` xml
|
345
|
+
<?xml version="1.0"?>
|
346
|
+
<ivy-module version="2.0">
|
347
|
+
<info organisation="redstorm" module="storm-deps"/>
|
348
|
+
<dependencies>
|
349
|
+
<dependency org="storm" name="storm" rev="0.8.2" conf="default" transitive="true" />
|
350
|
+
<override org="org.slf4j" module="slf4j-log4j12" rev="1.6.3"/>
|
351
|
+
<override org="org.yaml" module="snakeyaml" rev="1.11"/>
|
352
|
+
</dependencies>
|
353
|
+
</ivy-module>
|
354
|
+
```
|
355
|
+
|
356
|
+
In remote **cluster** mode you will have to update snakeyaml manually or with your favorite deployment/provisioning tool.
|
357
|
+
|
314
358
|
## RedStorm Development
|
315
359
|
|
316
360
|
It is possible to fork the RedStorm project and run local and remote/cluster topologies directly from the project sources without installing the gem. This is a useful setup when contributing to the project.
|
317
361
|
|
318
362
|
### Requirements
|
319
363
|
|
320
|
-
- JRuby 1.
|
364
|
+
- JRuby 1.7.3
|
321
365
|
|
322
366
|
### Workflow
|
323
367
|
|
@@ -332,20 +376,74 @@ It is possible to fork the RedStorm project and run local and remote/cluster top
|
|
332
376
|
- install dependencies in `target/dependencies`
|
333
377
|
|
334
378
|
```sh
|
335
|
-
$
|
379
|
+
$ bundle exec redstorm deps
|
336
380
|
```
|
337
381
|
|
338
382
|
- generate and build Java source into `target/classes`
|
339
383
|
|
340
384
|
```sh
|
341
|
-
$
|
385
|
+
$ bundle exec redstorm build
|
342
386
|
```
|
343
387
|
|
344
388
|
**if you modify any of the RedStorm Ruby code or Java binding code**, you need to run this to refresh code and rebuild the bindings
|
345
389
|
|
346
390
|
- follow the normal usage patterns to run the topology in local or remote cluster.
|
347
391
|
|
348
|
-
|
392
|
+
```sh
|
393
|
+
$ bundle exec redstorm bundle ...
|
394
|
+
$ bundle exec redstorm local ...
|
395
|
+
$ bundle exec redstorm jar ...
|
396
|
+
$ bundle exec redstorm cluster ...
|
397
|
+
```
|
398
|
+
|
399
|
+
### Remote cluster testing
|
400
|
+
|
401
|
+
Vagrant & Chef configuration to create a single node test Storm cluster is available in https://github.com/colinsurprenant/redstorm/tree/master/vagrant/
|
402
|
+
|
403
|
+
## Notes about 1.8/1.9 JRuby compatibility
|
404
|
+
|
405
|
+
Ruby 1.9 is the default runtime mode in JRuby 1.7.x
|
406
|
+
|
407
|
+
If you require Ruby 1.8 support, there are two ways to have JRuby run in 1.8 runtime mode:
|
408
|
+
|
409
|
+
- by setting the JRUBY_OPTS env variable
|
410
|
+
|
411
|
+
``` sh
|
412
|
+
$ export JRUBY_OPTS=--1.8
|
413
|
+
```
|
414
|
+
|
415
|
+
- by using the --1.8 option
|
416
|
+
|
417
|
+
``` sh
|
418
|
+
$ jruby --1.8 -S redstorm ...
|
419
|
+
```
|
420
|
+
|
421
|
+
By defaut, a topology will be executed in the **same mode** as the interpreter running the `$ redstorm` command. You can force RedStorm to choose a specific JRuby compatibility mode using the [--1.8|--1.9] parameter for the topology execution in local or remote cluster.
|
422
|
+
|
423
|
+
``` sh
|
424
|
+
$ redstorm local|cluster [--1.8|--1.9] ...
|
425
|
+
```
|
426
|
+
|
427
|
+
If you are **not using the DSL** and only using the proxy classes (like in `examples/native`) you will need to manually set the JRuby version in the Storm `Backtype::Config` object like this:
|
428
|
+
|
429
|
+
``` ruby
|
430
|
+
class SomeTopology
|
431
|
+
RedStorm::Configuration.topology_class = self
|
432
|
+
|
433
|
+
def start(base_class_path, env)
|
434
|
+
builder = TopologyBuilder.new
|
435
|
+
builder.setSpout ...
|
436
|
+
builder.setBolt ...
|
437
|
+
|
438
|
+
conf = Backtype::Config.new
|
439
|
+
conf.put("topology.worker.childopts", "-Djruby.compat.version=RUBY1_8")
|
440
|
+
|
441
|
+
StormSubmitter.submitTopology("some_topology", conf, builder.createTopology);
|
442
|
+
end
|
443
|
+
end
|
444
|
+
```
|
445
|
+
|
446
|
+
### How to contribute
|
349
447
|
|
350
448
|
Fork the project, create a branch and submit a pull request.
|
351
449
|
|
@@ -366,10 +464,15 @@ If you want to list your RedStorm project here, contact me.
|
|
366
464
|
- [Tweigeist](https://github.com/colinsurprenant/tweitgeist) - realtime computation of the top trending hashtags on Twitter. See [Live Demo](http://tweitgeist.colinsurprenant.com/).
|
367
465
|
|
368
466
|
## Author
|
369
|
-
|
467
|
+
**Colin Surprenant**, http://github.com/colinsurprenant/, [@colinsurprenant](http://twitter.com/colinsurprenant/), colin.surprenant@gmail.com, http://colinsurprenant.com/
|
370
468
|
|
371
469
|
## Contributors
|
372
|
-
Theo Hultberg, https://github.com/iconara
|
470
|
+
- Theo Hultberg, https://github.com/iconara
|
471
|
+
- Paul Bergeron, https://github.com/dinedal
|
472
|
+
- Phil Pirozhkov, https://github.com/pirj
|
473
|
+
- Evan Broderm, https://github.com/ebroder
|
474
|
+
- Shay Elkin, https://github.com/shayel
|
475
|
+
- adsummos, https://github.com/adsummos
|
373
476
|
|
374
477
|
## License
|
375
478
|
Apache License, Version 2.0. See the LICENSE.md file.
|