roma 0.8.2 → 0.8.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANG +326 -0
- data/CHANGELOG +132 -0
- data/{README.rdoc → FETCH_HEAD} +0 -0
- data/{LICENSE.rdoc → LICENSE} +0 -1
- data/README +17 -0
- data/Rakefile +33 -18
- data/ruby/server/bin/chg_redundancy +10 -0
- data/ruby/server/bin/key_access +7 -0
- data/ruby/server/bin/key_list +7 -0
- data/ruby/server/bin/mkconfig +19 -0
- data/{bin → ruby/server/bin}/mkrecent +0 -1
- data/{bin → ruby/server/bin}/mkroute +0 -1
- data/ruby/server/bin/multi_commander +19 -0
- data/ruby/server/bin/recoverlost +10 -0
- data/ruby/server/bin/recoverlost_alist +10 -0
- data/ruby/server/bin/recoverlost_alist_all +10 -0
- data/ruby/server/bin/recoverlost_alist_keys +10 -0
- data/{bin/recoverlost → ruby/server/bin/roma_watcher} +1 -2
- data/ruby/server/bin/romad +36 -0
- data/{bin → ruby/server/bin}/sample_watcher +0 -1
- data/{bin → ruby/server/bin}/sample_watcher2 +0 -1
- data/{bin/simple_bench → ruby/server/bin/sample_watcher3} +1 -2
- data/ruby/server/bin/simple_bench +26 -0
- data/{bin → ruby/server/bin}/ssroute +0 -1
- data/ruby/server/bin/test-scenario +11 -0
- data/{bin → ruby/server/bin}/tribunus +0 -1
- data/{lib → ruby/server/lib}/roma/async_process.rb +67 -15
- data/{lib → ruby/server/lib}/roma/command/bg_command_receiver.rb +1 -1
- data/ruby/server/lib/roma/command/command_definition.rb +422 -0
- data/ruby/server/lib/roma/command/mh_command_receiver.rb +127 -0
- data/ruby/server/lib/roma/command/receiver.rb +64 -0
- data/{lib → ruby/server/lib}/roma/command/rt_command_receiver.rb +6 -1
- data/ruby/server/lib/roma/command/sys_command_receiver.rb +609 -0
- data/{lib → ruby/server/lib}/roma/command/util_command_receiver.rb +15 -5
- data/{lib → ruby/server/lib}/roma/command/vn_command_receiver.rb +12 -4
- data/{lib → ruby/server/lib}/roma/command_plugin.rb +0 -0
- data/ruby/server/lib/roma/config.rb +84 -0
- data/{lib → ruby/server/lib}/roma/event/con_pool.rb +12 -1
- data/ruby/server/lib/roma/event/handler.rb +256 -0
- data/ruby/server/lib/roma/live_patch-20120302-001.rb +107 -0
- data/ruby/server/lib/roma/logging/rlogger.rb +163 -0
- data/ruby/server/lib/roma/messaging/con_pool.rb +92 -0
- data/{lib → ruby/server/lib}/roma/plugin/plugin_alist.rb +118 -240
- data/ruby/server/lib/roma/plugin/plugin_debug.rb +31 -0
- data/ruby/server/lib/roma/plugin/plugin_map.rb +177 -0
- data/ruby/server/lib/roma/plugin/plugin_mapcount.rb +185 -0
- data/{lib/roma/command/st_command_receiver.rb → ruby/server/lib/roma/plugin/plugin_storage.rb} +170 -146
- data/ruby/server/lib/roma/plugin/plugin_stub.rb +283 -0
- data/{lib → ruby/server/lib}/roma/plugin/plugin_test.rb +0 -0
- data/{lib → ruby/server/lib}/roma/romad.rb +221 -94
- data/{lib → ruby/server/lib}/roma/routing/cb_rttable.rb +4 -6
- data/{lib → ruby/server/lib}/roma/routing/merkle_tree.rb +0 -0
- data/ruby/server/lib/roma/routing/routing_data.rb +307 -0
- data/{lib → ruby/server/lib}/roma/routing/rttable.rb +4 -0
- data/{lib → ruby/server/lib}/roma/stats.rb +19 -3
- data/{lib → ruby/server/lib}/roma/storage/basic_storage.rb +25 -26
- data/{lib → ruby/server/lib}/roma/storage/dbm_storage.rb +1 -23
- data/{lib → ruby/server/lib}/roma/storage/dummy_storage.rb +0 -0
- data/{lib → ruby/server/lib}/roma/storage/rh_storage.rb +0 -0
- data/{lib → ruby/server/lib}/roma/storage/sqlite3_storage.rb +0 -0
- data/{lib → ruby/server/lib}/roma/storage/tc_storage.rb +62 -2
- data/ruby/server/lib/roma/tools/chg_redundancy.rb +36 -0
- data/ruby/server/lib/roma/tools/key_access.rb +105 -0
- data/ruby/server/lib/roma/tools/key_list.rb +94 -0
- data/ruby/server/lib/roma/tools/mkconfig.rb +535 -0
- data/{lib → ruby/server/lib}/roma/tools/mkrecent.rb +0 -0
- data/{lib → ruby/server/lib}/roma/tools/mkroute.rb +0 -0
- data/ruby/server/lib/roma/tools/multi_commander.rb +45 -0
- data/{lib → ruby/server/lib}/roma/tools/recoverlost.rb +0 -0
- data/{lib → ruby/server/lib}/roma/tools/recoverlost_alist.rb +0 -0
- data/ruby/server/lib/roma/tools/recoverlost_alist_all.rb +8 -0
- data/ruby/server/lib/roma/tools/recoverlost_alist_keys.rb +16 -0
- data/ruby/server/lib/roma/tools/recoverlost_lib.rb +349 -0
- data/ruby/server/lib/roma/tools/roma_watcher.rb +150 -0
- data/ruby/server/lib/roma/tools/roma_watcher_config.yml.example +20 -0
- data/{lib → ruby/server/lib}/roma/tools/sample_watcher.rb +3 -1
- data/{lib → ruby/server/lib}/roma/tools/sample_watcher2.rb +3 -1
- data/ruby/server/lib/roma/tools/sample_watcher3.rb +49 -0
- data/{lib → ruby/server/lib}/roma/tools/simple_bench.rb +2 -0
- data/ruby/server/lib/roma/tools/simple_bench2.rb +78 -0
- data/{lib → ruby/server/lib}/roma/tools/ssroute.rb +0 -0
- data/ruby/server/lib/roma/tools/test-scenario.rb +327 -0
- data/{lib → ruby/server/lib}/roma/tools/tribunus.rb +0 -0
- data/ruby/server/lib/roma/version.rb +4 -0
- data/{lib → ruby/server/lib}/roma/write_behind.rb +1 -0
- data/ruby/server/test/config4mhash.rb +68 -0
- data/ruby/server/test/config4storage_error.rb +69 -0
- data/{lib/roma/config.rb → ruby/server/test/config4test.rb} +6 -3
- data/{test → ruby/server/test}/rcirb.rb +0 -1
- data/{test → ruby/server/test}/roma-test-utils.rb +21 -8
- data/{test → ruby/server/test}/run-test.rb +3 -2
- data/ruby/server/test/storage_error_storage.rb +37 -0
- data/ruby/server/test/t_command_definition.rb +326 -0
- data/{test → ruby/server/test}/t_cpdata.rb +9 -3
- data/{test → ruby/server/test}/t_listplugin.rb +48 -12
- data/ruby/server/test/t_mapcountplugin.rb +231 -0
- data/ruby/server/test/t_mapplugin.rb +131 -0
- data/ruby/server/test/t_mhash.rb +222 -0
- data/ruby/server/test/t_rclient.rb +199 -0
- data/{test → ruby/server/test}/t_routing_data.rb +56 -0
- data/{test → ruby/server/test}/t_storage.rb +107 -111
- data/ruby/server/test/t_storage_error.rb +61 -0
- data/ruby/server/test/t_writebehind.rb +374 -0
- metadata +150 -82
- data/bin/recoverlost_alist +0 -8
- data/bin/romad +0 -7
- data/lib/roma/command/mh_command_receiver.rb +0 -117
- data/lib/roma/command/receiver.rb +0 -287
- data/lib/roma/event/handler.rb +0 -159
- data/lib/roma/plugin/plugin_debug.rb +0 -19
- data/lib/roma/tools/recoverlost_lib.rb +0 -217
- data/lib/roma/version.rb +0 -4
- data/test/t_rclient.rb +0 -318
- data/test/t_writebehind.rb +0 -200
@@ -0,0 +1,20 @@
|
|
1
|
+
roma:
|
2
|
+
- "localhost:11211"
|
3
|
+
- "localhost:11212"
|
4
|
+
- "localhost:11213"
|
5
|
+
|
6
|
+
log:
|
7
|
+
path: ./log.txt
|
8
|
+
rotate: "daily" # "daily", "weekly", or "monthly"
|
9
|
+
|
10
|
+
timeout: 3
|
11
|
+
|
12
|
+
retry:
|
13
|
+
count: 3
|
14
|
+
period: 0.3
|
15
|
+
|
16
|
+
mail:
|
17
|
+
from: roma@roma.jp
|
18
|
+
to: roma@roma.jp
|
19
|
+
mailer: /usr/bin/sendmail
|
20
|
+
subject_prefix: "ROMA "
|
@@ -0,0 +1,49 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
require 'roma/logging/rlogger'
|
4
|
+
require 'roma/messaging/con_pool'
|
5
|
+
require 'roma/routing/routing_data'
|
6
|
+
require 'roma/client/sender'
|
7
|
+
|
8
|
+
module Roma
|
9
|
+
class Watcher
|
10
|
+
def initialize
|
11
|
+
@sender = Roma::Client::Sender.new
|
12
|
+
end
|
13
|
+
def get_node_list(nid)
|
14
|
+
@sender.send_command(nid, "nodelist").split(' ')
|
15
|
+
end
|
16
|
+
end # class Watcher
|
17
|
+
end # module Roma
|
18
|
+
|
19
|
+
nodes = [
|
20
|
+
'localhost:11211',
|
21
|
+
'localhost:11212',
|
22
|
+
'localhost:11213'
|
23
|
+
]
|
24
|
+
|
25
|
+
puts "#{Time.now} ROMA watcher has started."
|
26
|
+
puts ""
|
27
|
+
|
28
|
+
all_ring = []
|
29
|
+
|
30
|
+
nodes.each{ |nid|
|
31
|
+
puts "=> check a process #{nid} with a nodelist command"
|
32
|
+
begin
|
33
|
+
w = Roma::Watcher.new
|
34
|
+
ring = w.get_node_list(nid)
|
35
|
+
all_ring << ring unless all_ring.include? ring
|
36
|
+
rescue => e
|
37
|
+
STDERR.puts " command error in #{nid}: #{e.inspect}"
|
38
|
+
end
|
39
|
+
}
|
40
|
+
|
41
|
+
puts ""
|
42
|
+
|
43
|
+
all_ring.each { |ring|
|
44
|
+
puts "#{ring}"
|
45
|
+
puts "size: #{ring.size}"
|
46
|
+
}
|
47
|
+
|
48
|
+
puts ""
|
49
|
+
puts "#{Time.now} ROMA watcher has done."
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
require 'date'
|
4
|
+
require 'roma/client/rclient'
|
5
|
+
|
6
|
+
module Roma
|
7
|
+
module Client
|
8
|
+
class Microbench
|
9
|
+
attr :cnt
|
10
|
+
attr :tmax
|
11
|
+
attr :tmin
|
12
|
+
attr :runnable
|
13
|
+
attr :sleep_time_watcher
|
14
|
+
attr :watcher
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
@cnt = 0
|
18
|
+
@tmax = 0
|
19
|
+
@tmin = 100
|
20
|
+
@runnable = true
|
21
|
+
@sleep_time_watcher = 10
|
22
|
+
init_watcher
|
23
|
+
end
|
24
|
+
|
25
|
+
def init_watcher
|
26
|
+
@watcher = Thread.new {
|
27
|
+
while @runnable
|
28
|
+
sleep @sleep_time_watcher
|
29
|
+
printf("qps=%d max=%f min=%f ave=%f\n",@@cnt/sleep_time,@@tmax,@@tmin,sleep_time/@@cnt.to_f)
|
30
|
+
@cnt = 0
|
31
|
+
@tmax = 0
|
32
|
+
@tmin = 100
|
33
|
+
end
|
34
|
+
}
|
35
|
+
end
|
36
|
+
private :init_watcher
|
37
|
+
|
38
|
+
def send_random_requests_loop addr, port
|
39
|
+
end
|
40
|
+
|
41
|
+
def send_read_requests addr, port, count
|
42
|
+
rc = Roma::Client::RomaClient.new("#{addr}:#{port.to_s}")
|
43
|
+
count.times { |c|
|
44
|
+
i = rand count
|
45
|
+
ts = DateTime.now
|
46
|
+
res = rc.get(i.to_s)
|
47
|
+
puts "get k=#{i} #{res}" if res == :error
|
48
|
+
}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def random_rquest_sender(ini_nodes)
|
56
|
+
rc=Roma::Client::RomaClient.new(ini_nodes)
|
57
|
+
|
58
|
+
n=10000
|
59
|
+
loop{
|
60
|
+
i=rand(n)
|
61
|
+
ts = DateTime.now
|
62
|
+
case rand(3)
|
63
|
+
when 0
|
64
|
+
res=rc.set(i.to_s,'hoge'+i.to_s)
|
65
|
+
puts "set k=#{i} #{res}" if res==nil || res.chomp != 'STORED'
|
66
|
+
when 1
|
67
|
+
res=rc.get(i.to_s)
|
68
|
+
puts "get k=#{i} #{res}" if res == :error
|
69
|
+
when 2
|
70
|
+
res=rc.delete(i.to_s)
|
71
|
+
puts "del k=#{i} #{res}" if res != 'DELETED' && res != 'NOT_FOUND'
|
72
|
+
end
|
73
|
+
t=(DateTime.now - ts).to_f * 86400.0
|
74
|
+
@@tmax=t if t > @@tmax
|
75
|
+
@@tmin=t if t < @@tmin
|
76
|
+
@@cnt+=1
|
77
|
+
}
|
78
|
+
end
|
File without changes
|
@@ -0,0 +1,327 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'logger'
|
5
|
+
require 'roma/client/rclient'
|
6
|
+
require 'roma/tools/multi_commander'
|
7
|
+
require 'optparse'
|
8
|
+
|
9
|
+
module Roma
|
10
|
+
module Test
|
11
|
+
class RomaProc
|
12
|
+
attr_accessor :addr
|
13
|
+
attr_accessor :port
|
14
|
+
attr_accessor :pid
|
15
|
+
|
16
|
+
def initialize a, p
|
17
|
+
@addr = a
|
18
|
+
@port = p
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.to_str procs
|
22
|
+
msg = ""
|
23
|
+
procs.each { |proc|
|
24
|
+
msg = msg + proc.addr + "_" + proc.port.to_s + " "
|
25
|
+
}
|
26
|
+
msg
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class Stress
|
31
|
+
attr :cnt
|
32
|
+
attr :tmax
|
33
|
+
attr :tmin
|
34
|
+
attr :num_of_threads
|
35
|
+
attr_accessor :runnable
|
36
|
+
|
37
|
+
def initialize th_num
|
38
|
+
@cnt = 0
|
39
|
+
@tmax = 0
|
40
|
+
@tmin = 100
|
41
|
+
@num_of_threads = th_num
|
42
|
+
@runnable = true
|
43
|
+
end
|
44
|
+
|
45
|
+
def start addr, port
|
46
|
+
Thread.new {
|
47
|
+
sleep_time=10
|
48
|
+
while @runnable
|
49
|
+
sleep sleep_time
|
50
|
+
printf("qps=%d max=%f min=%f ave=%f\n", @cnt / sleep_time, @tmax, @tmin, sleep_time / @cnt.to_f)
|
51
|
+
@@cnt=0
|
52
|
+
@@tmax=0
|
53
|
+
@@tmin=100
|
54
|
+
end
|
55
|
+
}
|
56
|
+
|
57
|
+
working_threads = []
|
58
|
+
@num_of_threads.times {
|
59
|
+
working_threads << Thread.new {
|
60
|
+
send_random_reqs addr, port
|
61
|
+
}
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
def send_random_reqs addr, port
|
66
|
+
rc = Roma::Client::RomaClient.new([ "#{addr}_#{port.to_s}" ])
|
67
|
+
n=1000
|
68
|
+
while @runnable
|
69
|
+
begin
|
70
|
+
i = rand(n)
|
71
|
+
ts = DateTime.now
|
72
|
+
case rand(3)
|
73
|
+
when 0
|
74
|
+
res = rc.set(i.to_s, 'hoge' + i.to_s)
|
75
|
+
puts "set k=#{i} #{res}" if res==nil || res.chomp != 'STORED'
|
76
|
+
when 1
|
77
|
+
res = rc.get(i.to_s)
|
78
|
+
puts "get k=#{i} #{res}" if res == :error
|
79
|
+
when 2
|
80
|
+
res = rc.delete(i.to_s)
|
81
|
+
puts "del k=#{i} #{res}" if res != 'DELETED' && res != 'NOT_FOUND'
|
82
|
+
end
|
83
|
+
t = (DateTime.now - ts).to_f * 86400.0
|
84
|
+
@tmax=t if t > @tmax
|
85
|
+
@tmin=t if t < @tmin
|
86
|
+
@cnt+=1
|
87
|
+
rescue => e
|
88
|
+
p e
|
89
|
+
end
|
90
|
+
end
|
91
|
+
rescue => e
|
92
|
+
p e
|
93
|
+
end
|
94
|
+
private :send_random_reqs
|
95
|
+
end
|
96
|
+
|
97
|
+
class Scenario
|
98
|
+
attr :working_path
|
99
|
+
attr :roma_procs
|
100
|
+
attr :stress
|
101
|
+
attr :log
|
102
|
+
|
103
|
+
def initialize(path, procs)
|
104
|
+
@working_path = path
|
105
|
+
@roma_procs = procs
|
106
|
+
@stress = Stress.new 1
|
107
|
+
@log = Logger.new "./test-scenario.log", "daily"
|
108
|
+
end
|
109
|
+
|
110
|
+
def init_roma
|
111
|
+
@log.debug "begin init_roma"
|
112
|
+
exec "rm -f localhost_1121?.*"
|
113
|
+
exec "bin/mkroute -d 7 #{RomaProc.to_str(@roma_procs)} --enabled_repeathost"
|
114
|
+
@log.debug "end init_roma"
|
115
|
+
end
|
116
|
+
|
117
|
+
def start_roma
|
118
|
+
@log.debug "begin start_roma"
|
119
|
+
@roma_procs.length.times { |i|
|
120
|
+
start_roma_proc i
|
121
|
+
}
|
122
|
+
@log.debug "end start_roma"
|
123
|
+
end
|
124
|
+
|
125
|
+
def start_roma_proc i
|
126
|
+
@log.debug "begin start_roma_proc"
|
127
|
+
str = "bin/romad #{@roma_procs[i].addr} -p #{@roma_procs[i].port.to_s} -d --enabled_repeathost"
|
128
|
+
exec str
|
129
|
+
@roma_procs[i].pid = get_pid(str)
|
130
|
+
@log.debug "end start_roma_proc"
|
131
|
+
end
|
132
|
+
private :start_roma_proc
|
133
|
+
|
134
|
+
def exec cmd
|
135
|
+
`cd #{@working_path}; #{cmd}`
|
136
|
+
end
|
137
|
+
private :exec
|
138
|
+
|
139
|
+
def get_pid reg_str
|
140
|
+
open("| ps -ef | grep romad") { |f|
|
141
|
+
while l = f.gets
|
142
|
+
return $1.to_i if l =~ /(\d+).+ruby\s#{reg_str}/
|
143
|
+
end
|
144
|
+
}
|
145
|
+
nil
|
146
|
+
end
|
147
|
+
private :get_pid
|
148
|
+
|
149
|
+
def stop_roma
|
150
|
+
@log.debug "begin start_roma"
|
151
|
+
@roma_procs.length.times { |i|
|
152
|
+
stop_roma_proc i
|
153
|
+
}
|
154
|
+
@log.debug "end start_roma"
|
155
|
+
end
|
156
|
+
|
157
|
+
def stop_roma_proc i
|
158
|
+
@log.debug "begin start_roma_proc"
|
159
|
+
exec "kill -9 #{@roma_procs[i].pid}"
|
160
|
+
@log.debug "end start_roma_proc"
|
161
|
+
end
|
162
|
+
private :stop_roma_proc
|
163
|
+
|
164
|
+
def start_roma_client addr, port
|
165
|
+
@stress.start addr, port
|
166
|
+
end
|
167
|
+
|
168
|
+
def stop_roma_client
|
169
|
+
@stress.runnable = false
|
170
|
+
end
|
171
|
+
|
172
|
+
def send_recover addr, port
|
173
|
+
commander = Roma::MultiCommander.new "#{addr}_#{port}"
|
174
|
+
res = commander.send_cmd "recover", "#{addr}_#{port}"
|
175
|
+
puts res
|
176
|
+
end
|
177
|
+
|
178
|
+
def send_stats addr, port
|
179
|
+
commander = Roma::MultiCommander.new "#{addr}_#{port}"
|
180
|
+
res = commander.send_cmd "stats run", "#{addr}_#{port}"
|
181
|
+
puts res
|
182
|
+
end
|
183
|
+
|
184
|
+
def send_stats_routing_nodes_length addr, port
|
185
|
+
commander = Roma::MultiCommander.new "#{addr}_#{port}"
|
186
|
+
res = commander.send_cmd "stats routing.nodes.length", "#{addr}_#{port}"
|
187
|
+
splited = res.split(' ')
|
188
|
+
splited.each_with_index { |w, i|
|
189
|
+
if w == "routing.nodes.length"
|
190
|
+
return splited[i + 1].to_i
|
191
|
+
end
|
192
|
+
}
|
193
|
+
raise "not found a specified property: routing.nodes.length"
|
194
|
+
end
|
195
|
+
|
196
|
+
def send_stats_run_acquire_vnodes addr, port
|
197
|
+
commander = Roma::MultiCommander.new "#{addr}_#{port}"
|
198
|
+
res = commander.send_cmd "stats stats.run_acquire_vnodes", "#{addr}_#{port}"
|
199
|
+
splited = res.split(' ')
|
200
|
+
splited.each_with_index { |w, i|
|
201
|
+
if w == "stats.run_acquire_vnodes"
|
202
|
+
return splited[i + 1] == "true"
|
203
|
+
end
|
204
|
+
}
|
205
|
+
raise "not found a specified property: stats.run_acquire_vnodes"
|
206
|
+
end
|
207
|
+
|
208
|
+
def test_kill_join_recover
|
209
|
+
@log.info "begin method test_kill_join_recover"
|
210
|
+
|
211
|
+
# initialize a ROMA
|
212
|
+
init_roma
|
213
|
+
|
214
|
+
# start a ROMA
|
215
|
+
start_roma
|
216
|
+
|
217
|
+
sleep 10
|
218
|
+
|
219
|
+
# stress
|
220
|
+
start_roma_client @roma_procs[0].addr, @roma_procs[0].port
|
221
|
+
|
222
|
+
sleep 2
|
223
|
+
|
224
|
+
nlen = send_stats_routing_nodes_length @roma_procs[0].addr, @roma_procs[0].port
|
225
|
+
if nlen != 3
|
226
|
+
raise "fatal error nlen: #{nlen}"
|
227
|
+
end
|
228
|
+
|
229
|
+
sleep 2
|
230
|
+
|
231
|
+
# stop the specified roma process
|
232
|
+
stop_roma_proc 2
|
233
|
+
|
234
|
+
sleep 10
|
235
|
+
|
236
|
+
nlen = send_stats_routing_nodes_length @roma_procs[0].addr, @roma_procs[0].port
|
237
|
+
if nlen != 2
|
238
|
+
raise "fatal error nlen: #{nlen}"
|
239
|
+
end
|
240
|
+
|
241
|
+
#ret = send_stats_run_acquire_vnodes @roma_procs[0].addr, @roma_procs[0].port
|
242
|
+
#puts "$$ #{ret}"
|
243
|
+
#send_stats @roma_procs[0].addr, @roma_procs[0].port
|
244
|
+
#puts "$$"
|
245
|
+
#ret = send_stats_run_acquire_vnodes @roma_procs[0].addr, @roma_procs[0].port
|
246
|
+
#puts "$$ #{ret}"
|
247
|
+
#send_stats @roma_procs[0].addr, @roma_procs[0].port
|
248
|
+
#send_recover @roma_procs[0].addr, @roma_procs[0].port
|
249
|
+
|
250
|
+
|
251
|
+
sleep 2
|
252
|
+
|
253
|
+
stop_roma_client
|
254
|
+
|
255
|
+
#stop_roma
|
256
|
+
stop_roma_proc 0
|
257
|
+
stop_roma_proc 1
|
258
|
+
|
259
|
+
@log.info "end method test_kill_join_recover"
|
260
|
+
end
|
261
|
+
|
262
|
+
def test_suite
|
263
|
+
test_kill_join_recover
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
class Config
|
268
|
+
attr_reader :number_of_nodes
|
269
|
+
attr_reader :port
|
270
|
+
attr_reader :hostname
|
271
|
+
attr_reader :working_path
|
272
|
+
|
273
|
+
def initialize(argv)
|
274
|
+
opts = OptionParser.new
|
275
|
+
opts.banner="usage:#{File.basename($0)} [options]"
|
276
|
+
|
277
|
+
opts.on_tail("-h", "--help", "show this message") {
|
278
|
+
puts opts; exit
|
279
|
+
}
|
280
|
+
@number_of_nodes = 3
|
281
|
+
opts.on("-n N", "number of nodes[default: 3]", Integer) { |v|
|
282
|
+
@number_of_nodes = v
|
283
|
+
}
|
284
|
+
|
285
|
+
@working_path = '.'
|
286
|
+
opts.on("-p PATH", "working path[default: .]", String) { |v|
|
287
|
+
@working_path = v
|
288
|
+
}
|
289
|
+
|
290
|
+
@hostname = 'localhost'
|
291
|
+
opts.on("--hname HOSTNAME", "hostname[default: localhost]", String) { |v|
|
292
|
+
@hostname = v
|
293
|
+
}
|
294
|
+
|
295
|
+
@port = 11211
|
296
|
+
opts.on("--port PORT_NUMBER", "port number[default: 11211]", Integer) { |v|
|
297
|
+
@port = v
|
298
|
+
}
|
299
|
+
|
300
|
+
opts.parse!(argv)
|
301
|
+
rescue OptionParser::ParseError => e
|
302
|
+
$stderr.puts e.message
|
303
|
+
$stderr.puts opts.help
|
304
|
+
exit 1
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
cnf = Roma::Test::Config.new(ARGV)
|
312
|
+
|
313
|
+
# check for a working path
|
314
|
+
unless File::exist?("#{cnf.working_path}/bin/romad")
|
315
|
+
# in invalid path
|
316
|
+
$stderr.puts "#{cnf.working_path}/bin/romad dose't found"
|
317
|
+
$stderr.puts "You should set to a working path option(-p)."
|
318
|
+
exit 1
|
319
|
+
end
|
320
|
+
|
321
|
+
procs = []
|
322
|
+
cnf.number_of_nodes.times{ |i|
|
323
|
+
procs << Roma::Test::RomaProc.new(cnf.hostname, cnf.port + i)
|
324
|
+
}
|
325
|
+
|
326
|
+
s = Roma::Test::Scenario.new(cnf.working_path, procs)
|
327
|
+
s.test_suite
|