redstorm 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/README.md +88 -8
- data/TODO.md +4 -0
- data/examples/simple/redis_word_count_topology.rb +1 -0
- data/lib/red_storm/version.rb +1 -1
- data/lib/tasks/red_storm.rake +4 -3
- data/pom.xml +1 -1
- metadata +3 -2
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
# RedStorm v0.2.
|
1
|
+
# RedStorm v0.2.1 - JRuby on Storm
|
2
2
|
|
3
3
|
RedStorm provides the JRuby integration for the [Storm][storm] distributed realtime computation system.
|
4
4
|
|
5
5
|
## Changes from 0.1.x
|
6
6
|
|
7
|
-
-
|
8
|
-
-
|
9
|
-
-
|
7
|
+
- this release introduces the *simple* DSL. Topology, Spout and Bolt classes can inherit from the SimpleTopology, SimpleSpout and SimpleBolt classes which provides a very clean and consise DSL. See [examples/simple](https://github.com/colinsurprenant/redstorm/tree/master/examples/simple).
|
8
|
+
- use the same SimpleTopology class for local development cluster or remote production cluster.
|
9
|
+
- the `redstorm` command has a new syntax.
|
10
|
+
- gems support in production cluster
|
10
11
|
|
11
12
|
## Dependencies
|
12
13
|
|
@@ -27,7 +28,7 @@ $ gem install redstorm
|
|
27
28
|
|
28
29
|
### Initial setup
|
29
30
|
|
30
|
-
|
31
|
+
- install RedStom dependencies; from your project root directory execute:
|
31
32
|
|
32
33
|
``` sh
|
33
34
|
$ redstorm install
|
@@ -37,9 +38,21 @@ The `install` command will install all Java jars dependencies using [ruby-maven]
|
|
37
38
|
|
38
39
|
***DON'T PANIC*** it's Maven. The first time you run `$ redstorm install` Maven will take a few minutes resolving dependencies and in the end will download and install the dependency jar files.
|
39
40
|
|
40
|
-
|
41
|
+
- create a topology class. The *underscore* topology_class_file_name.rb **MUST** correspond to its *CamelCase* class name.
|
42
|
+
|
43
|
+
### Gems
|
44
|
+
|
45
|
+
Until this is better integrated, you can use **gems** in local mode and on a production cluster:
|
46
|
+
|
47
|
+
- **local mode**: simply install your gems the usual way, they will be picked up when run in local mode.
|
48
|
+
|
49
|
+
- **production cluster**: install your gem in the `target/gems` folder using:
|
41
50
|
|
42
|
-
|
51
|
+
```sh
|
52
|
+
gem install <the gem> --install-dir target/gems/ --no-ri --no-rdoc
|
53
|
+
```
|
54
|
+
|
55
|
+
### Run in local mode
|
43
56
|
|
44
57
|
``` sh
|
45
58
|
$ redstorm local <path/to/topology_class_file_name.rb>
|
@@ -81,7 +94,7 @@ $ redstorm local examples/simple/exclamation_topology2.rb
|
|
81
94
|
$ redstorm local examples/simple/word_count_topology.rb
|
82
95
|
```
|
83
96
|
|
84
|
-
This next example requires the use of the [Redis Gem](https://github.com/ezmobius/redis-rb) and a [Redis][redis] server
|
97
|
+
This next example requires the use of the [Redis Gem](https://github.com/ezmobius/redis-rb) and a [Redis][redis] server running on `localhost:6379`
|
85
98
|
|
86
99
|
``` sh
|
87
100
|
$ redstorm local examples/simple/redis_word_count_topology.rb
|
@@ -105,6 +118,22 @@ $ redstorm jar examples
|
|
105
118
|
$ storm jar ./target/cluster-topology.jar redstorm.TopologyLauncher cluster examples/simple/word_count_topology.rb
|
106
119
|
```
|
107
120
|
|
121
|
+
- to run `examples/simple/redis_word_count_topology.rb` you need a [Redis][redis] server running on `localhost:6379` and the Redis gem in `target/gems` using:
|
122
|
+
|
123
|
+
```sh
|
124
|
+
gem install redis --install-dir target/gems/ --no-ri --no-rdoc
|
125
|
+
```
|
126
|
+
|
127
|
+
- generate jar and submit:
|
128
|
+
|
129
|
+
``` sh
|
130
|
+
$ redstorm jar examples
|
131
|
+
$ storm jar ./target/cluster-topology.jar redstorm.TopologyLauncher cluster examples/simple/redis_word_count_topology.rb
|
132
|
+
```
|
133
|
+
|
134
|
+
- using `redis-cli`, push words into the `test` list and watch Storm pick them up
|
135
|
+
|
136
|
+
|
108
137
|
Basically you must follow the [Storm instructions](https://github.com/nathanmarz/storm/wiki) to [setup a production cluster](https://github.com/nathanmarz/storm/wiki/Setting-up-a-Storm-cluster) and [submit your topology to the cluster](https://github.com/nathanmarz/storm/wiki/Running-topologies-on-a-production-cluster).
|
109
138
|
|
110
139
|
## DSL usage
|
@@ -430,6 +459,57 @@ end
|
|
430
459
|
- [SplitSentenceBolt](https://github.com/colinsurprenant/redstorm/tree/master/examples/simple/split_sentence_bolt.rb)
|
431
460
|
- [WordCountBolt](https://github.com/colinsurprenant/redstorm/tree/master/examples/simple/word_count_bolt.rb)
|
432
461
|
|
462
|
+
## Development
|
463
|
+
|
464
|
+
### Requirements
|
465
|
+
|
466
|
+
- JRuby 1.6.5
|
467
|
+
- rake gem
|
468
|
+
- ruby-maven gem
|
469
|
+
- rspec gem
|
470
|
+
|
471
|
+
### Contribute
|
472
|
+
|
473
|
+
Fork the project, create a branch and submit a pull request.
|
474
|
+
|
475
|
+
Some ways you can contribute:
|
476
|
+
|
477
|
+
- by reporting bugs using the issue tracker
|
478
|
+
- by suggesting new features using the issue tracker
|
479
|
+
- by writing or editing documentation
|
480
|
+
- by writing specs
|
481
|
+
- by writing code
|
482
|
+
- by refactoring code
|
483
|
+
- ...
|
484
|
+
|
485
|
+
### Workflow
|
486
|
+
|
487
|
+
- fork project
|
488
|
+
- create branch
|
489
|
+
- install dependencies in `target/dependencies`
|
490
|
+
|
491
|
+
```sh
|
492
|
+
$ rake deps
|
493
|
+
```
|
494
|
+
|
495
|
+
- generate and build Java source into `target/classes`
|
496
|
+
|
497
|
+
```sh
|
498
|
+
$ rake build
|
499
|
+
```
|
500
|
+
|
501
|
+
- run topology in local dev cluster
|
502
|
+
|
503
|
+
```sh
|
504
|
+
$ bin/redstorm local path/to/topology_class.rb
|
505
|
+
```
|
506
|
+
|
507
|
+
- generate remote cluster topology jar into `target/cluster-topology.jar`, including the `examples/` directory.
|
508
|
+
|
509
|
+
```sh
|
510
|
+
$ rake jar['examples']
|
511
|
+
```
|
512
|
+
|
433
513
|
## Author
|
434
514
|
Colin Surprenant, [@colinsurprenant][twitter], [colin.surprenant@needium.com][needium], [colin.surprenant@gmail.com][gmail], [http://github.com/colinsurprenant][github]
|
435
515
|
|
data/TODO.md
ADDED
data/lib/red_storm/version.rb
CHANGED
data/lib/tasks/red_storm.rake
CHANGED
@@ -15,6 +15,7 @@ TARGET_SRC_DIR = "#{TARGET_DIR}/src"
|
|
15
15
|
TARGET_CLASSES_DIR = "#{TARGET_DIR}/classes"
|
16
16
|
TARGET_DEPENDENCY_DIR = "#{TARGET_DIR}/dependency"
|
17
17
|
TARGET_DEPENDENCY_UNPACKED_DIR = "#{TARGET_DIR}/dependency-unpacked"
|
18
|
+
TARGET_GEMS_DIR = "#{TARGET_DIR}/gems"
|
18
19
|
TARGET_CLUSTER_JAR = "#{TARGET_DIR}/cluster-topology.jar"
|
19
20
|
|
20
21
|
JAVA_SRC_DIR = "#{RedStorm::REDSTORM_HOME}/src/main"
|
@@ -42,6 +43,7 @@ task :setup do
|
|
42
43
|
ant.mkdir :dir => TARGET_DIR
|
43
44
|
ant.mkdir :dir => TARGET_CLASSES_DIR
|
44
45
|
ant.mkdir :dir => TARGET_SRC_DIR
|
46
|
+
ant.mkdir :dir => TARGET_GEMS_DIR
|
45
47
|
ant.path :id => 'classpath' do
|
46
48
|
fileset :dir => TARGET_DEPENDENCY_DIR
|
47
49
|
fileset :dir => TARGET_CLASSES_DIR
|
@@ -60,6 +62,7 @@ task :devjar => [:unpack, :clean_jar] do
|
|
60
62
|
ant.jar :destfile => TARGET_CLUSTER_JAR do
|
61
63
|
fileset :dir => TARGET_CLASSES_DIR
|
62
64
|
fileset :dir => TARGET_DEPENDENCY_UNPACKED_DIR
|
65
|
+
fileset :dir => TARGET_GEMS_DIR
|
63
66
|
fileset :dir => RedStorm::REDSTORM_HOME do
|
64
67
|
include :name => "examples/**/*"
|
65
68
|
end
|
@@ -77,9 +80,7 @@ task :jar, [:dir] => [:unpack, :clean_jar] do |t, args|
|
|
77
80
|
ant.jar :destfile => TARGET_CLUSTER_JAR do
|
78
81
|
fileset :dir => TARGET_CLASSES_DIR
|
79
82
|
fileset :dir => TARGET_DEPENDENCY_UNPACKED_DIR
|
80
|
-
fileset :dir =>
|
81
|
-
include :name => "examples/**/*"
|
82
|
-
end
|
83
|
+
fileset :dir => TARGET_GEMS_DIR
|
83
84
|
fileset :dir => JRUBY_SRC_DIR do
|
84
85
|
exclude :name => "tasks/**"
|
85
86
|
end
|
data/pom.xml
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: redstorm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Colin Surprenant
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-11-
|
13
|
+
date: 2011-11-23 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubyforge
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- README.md
|
91
91
|
- CHANGELOG.md
|
92
92
|
- LICENSE.md
|
93
|
+
- TODO.md
|
93
94
|
homepage: https://github.com/colinsurprenant/redstorm
|
94
95
|
licenses: []
|
95
96
|
|