forked from hilfialkaff/storm-experiments
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtopgen.rb
More file actions
executable file
·34 lines (32 loc) · 928 Bytes
/
topgen.rb
File metadata and controls
executable file
·34 lines (32 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env ruby
require 'yaml'
require 'pp'
config = {
'numWorkers' => 1,
'topologyName' => '',
'elements' => {
# remember, spout first
'spout' => {
'tasks' => 1,
'executeLatency' => 3,
},
'p1' => {
'tasks' => 1,
'executeLatency' => 3,
},
}
}
(1..5).each do |i|
topName = "ExecuteLatency_#{i}"
keys = config['elements'].keys
config['elements'][keys[1]]['executeLatency'] = i
config['topologyName'] = topName
filedir = "./runs/#{config['topologyName']}"
`mkdir -p #{filedir}`
fullpath="#{filedir}/topology.yaml"
File.open(fullpath, 'w') {|f| f.write config.to_yaml }
puts "storm jar target/storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar srg.LinTopology #{fullpath} #{topName}"
`storm jar target/storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar srg.LinTopology #{fullpath} #{topName}`
sleep(60*12)
`storm kill #{topName}`
end