redstorm 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +8 -1
- data/README.md +4 -4
- data/Rakefile +3 -2
- data/lib/red_storm/environment.rb +6 -3
- data/lib/red_storm/simple_spout.rb +17 -3
- data/lib/red_storm/topology_launcher.rb +1 -0
- data/lib/red_storm/version.rb +1 -1
- data/lib/tasks/red_storm.rake +4 -2
- metadata +2 -2
data/CHANGELOG.md
CHANGED
@@ -41,7 +41,14 @@
|
|
41
41
|
- issue #30, add redstorm cluster command for remote topology submission
|
42
42
|
- issue #31, added support for localOrShuffleGrouping
|
43
43
|
- issue #33, avoid forking or shelling out on redstorm commands
|
44
|
+
- issue #35, automatically set JRuby 1.8/1.9 mode in remote cluster context
|
44
45
|
- JRuby 1.6.7.2
|
45
46
|
- better handling of JRuby 1.8/1.9 mode
|
46
47
|
- topology gems are now specified using a Bundler group in the project Gemfile
|
47
|
-
- refactored environment/paths handling for local vs cluster context
|
48
|
+
- refactored environment/paths handling for local vs cluster context
|
49
|
+
|
50
|
+
# 0.6.1, 07-07-2012
|
51
|
+
- issue #38, added support for spout reliable emit
|
52
|
+
- gem path is always in target/gems for both local and cluster context
|
53
|
+
- temp fix for slf4j dependencies conflict (issue #36)
|
54
|
+
- Storm 0.7.4
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# RedStorm v0.6.
|
1
|
+
# RedStorm v0.6.1 - 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
|
|
@@ -16,7 +16,7 @@ Chances are new versions of RedStorm will introduce changes that will break comp
|
|
16
16
|
|
17
17
|
## Dependencies
|
18
18
|
|
19
|
-
Tested on OSX 10.6.8 and Linux 10.04 & 11.10 using Storm 0.7.
|
19
|
+
Tested on OSX 10.6.8 and Linux 10.04 & 11.10 using Storm 0.7.4 and JRuby 1.6.7.2
|
20
20
|
|
21
21
|
## Notes about 1.8/1.9 JRuby compatibility
|
22
22
|
|
@@ -58,7 +58,7 @@ $ redstorm local|cluster [--1.8|--1.9] ...
|
|
58
58
|
|
59
59
|
``` ruby
|
60
60
|
source :rubygems
|
61
|
-
gem "redstorm", "~> 0.6.
|
61
|
+
gem "redstorm", "~> 0.6.1"
|
62
62
|
```
|
63
63
|
|
64
64
|
## Usage overview
|
@@ -125,7 +125,7 @@ By defaut, a topology will be executed in the **same mode** as the interpreter r
|
|
125
125
|
|
126
126
|
### Run on production cluster
|
127
127
|
|
128
|
-
1. download and unpack the [Storm 0.7.
|
128
|
+
1. download and unpack the [Storm 0.7.4 distribution](https://github.com/downloads/nathanmarz/storm/storm-0.7.4.zip) locally and **add** the Storm `bin/` directory to your path
|
129
129
|
|
130
130
|
2. generate `target/cluster-topology.jar`. This jar file will include your sources directory plus the required dependencies
|
131
131
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'rspec/core/rake_task'
|
3
2
|
|
4
|
-
load 'lib/tasks/red_storm.rake'
|
5
3
|
|
6
4
|
RSpec::Core::RakeTask.new(:spec) do
|
7
5
|
system("ruby -v")
|
6
|
+
module RedStorm; SPECS_CONTEXT = true; end
|
8
7
|
end
|
9
8
|
|
10
9
|
task :default => :spec
|
10
|
+
|
11
|
+
load 'lib/tasks/red_storm.rake'
|
@@ -7,14 +7,17 @@ module RedStorm
|
|
7
7
|
BASE_PATH = File.expand_path(LAUNCH_PATH + '/..')
|
8
8
|
REDSTORM_HOME = BASE_PATH
|
9
9
|
TARGET_PATH = BASE_PATH
|
10
|
-
|
11
|
-
GEM_PATH = "#{TARGET_PATH}/gems/"
|
12
|
-
ENV["GEM_PATH"] = GEM_PATH
|
13
10
|
else
|
14
11
|
BASE_PATH = Dir.pwd
|
15
12
|
REDSTORM_HOME = File.expand_path(LAUNCH_PATH + '/../..')
|
16
13
|
TARGET_PATH = "#{BASE_PATH}/target"
|
17
14
|
end
|
15
|
+
|
16
|
+
unless defined?(SPECS_CONTEXT)
|
17
|
+
GEM_PATH = "#{TARGET_PATH}/gems/"
|
18
|
+
ENV["GEM_PATH"] = GEM_PATH
|
19
|
+
ENV["GEM_HOME"] = GEM_PATH
|
20
|
+
end
|
18
21
|
|
19
22
|
def current_ruby_mode
|
20
23
|
RUBY_VERSION =~ /(\d+\.\d+)(\.\d+)*/
|
@@ -53,9 +53,14 @@ module RedStorm
|
|
53
53
|
|
54
54
|
# DSL instance methods
|
55
55
|
|
56
|
-
def
|
56
|
+
def reliable_emit(message_id, *values)
|
57
|
+
@collector.emit(Values.new(*values), message_id)
|
58
|
+
end
|
59
|
+
|
60
|
+
def unreliable_emit(*values)
|
57
61
|
@collector.emit(Values.new(*values))
|
58
62
|
end
|
63
|
+
alias_method :emit, :unreliable_emit
|
59
64
|
|
60
65
|
def log
|
61
66
|
self.class.log
|
@@ -68,7 +73,12 @@ module RedStorm
|
|
68
73
|
if self.class.emit?
|
69
74
|
if output
|
70
75
|
values = [output].flatten
|
71
|
-
|
76
|
+
if self.class.reliable?
|
77
|
+
message_id = values.shift
|
78
|
+
reliable_emit(message_id, *values)
|
79
|
+
else
|
80
|
+
unreliable_emit(*values)
|
81
|
+
end
|
72
82
|
else
|
73
83
|
sleep(0.1)
|
74
84
|
end
|
@@ -159,11 +169,15 @@ module RedStorm
|
|
159
169
|
end
|
160
170
|
|
161
171
|
def self.send_options
|
162
|
-
@send_options ||= {:emit => true}
|
172
|
+
@send_options ||= {:emit => true, :reliable => false}
|
163
173
|
end
|
164
174
|
|
165
175
|
def self.emit?
|
166
176
|
!!self.send_options[:emit]
|
167
177
|
end
|
178
|
+
|
179
|
+
def self.reliable?
|
180
|
+
!!self.send_options[:reliable]
|
181
|
+
end
|
168
182
|
end
|
169
183
|
end
|
data/lib/red_storm/version.rb
CHANGED
data/lib/tasks/red_storm.rake
CHANGED
@@ -3,7 +3,7 @@ require 'jruby/jrubyc'
|
|
3
3
|
require 'pompompom'
|
4
4
|
require 'red_storm'
|
5
5
|
|
6
|
-
INSTALL_STORM_VERSION = "0.7.
|
6
|
+
INSTALL_STORM_VERSION = "0.7.4"
|
7
7
|
INSTALL_JRUBY_VERSION = "1.6.7.2"
|
8
8
|
|
9
9
|
CWD = Dir.pwd
|
@@ -141,7 +141,6 @@ task :deps => :setup do
|
|
141
141
|
:repositories => {:clojars => 'http://clojars.org/repo/', :sonatype => "http://oss.sonatype.org/content/groups/public/"},
|
142
142
|
:dependencies => [
|
143
143
|
"storm:storm:#{INSTALL_STORM_VERSION}|type_filter=jar",
|
144
|
-
"org.slf4j:slf4j-api:1.5.8|type_filter=jar",
|
145
144
|
"org.slf4j:slf4j-log4j12:1.5.8|type_filter=jar",
|
146
145
|
"org.jruby:jruby-complete:#{INSTALL_JRUBY_VERSION}|transitive=false,type_filter=jar",
|
147
146
|
],
|
@@ -150,6 +149,9 @@ task :deps => :setup do
|
|
150
149
|
|
151
150
|
installer = PomPomPom::Runner.new(configuration)
|
152
151
|
installer.run
|
152
|
+
|
153
|
+
# tmp hack to clenup a dependency weirdness (issue #36)
|
154
|
+
FileUtils.rm("#{TARGET_DEPENDENCY_DIR}/slf4j-api-1.6.3-jar.jar")
|
153
155
|
end
|
154
156
|
|
155
157
|
task :build => [:setup, :copy_red_storm] do
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: redstorm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.6.
|
5
|
+
version: 0.6.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Colin Surprenant
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|