roma 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +42 -2
  3. data/Gemfile +1 -15
  4. data/LICENSE +1 -1
  5. data/README.md +78 -0
  6. data/Rakefile +1 -62
  7. data/bin/chg_redundancy +10 -0
  8. data/bin/cpdb +7 -0
  9. data/bin/key_access +7 -0
  10. data/bin/key_list +7 -0
  11. data/bin/log_merger +7 -0
  12. data/{ruby/server/bin → bin}/mkconfig +3 -1
  13. data/bin/mkrecent +7 -0
  14. data/bin/mkroute +7 -0
  15. data/{ruby/server/bin → bin}/multi_commander +4 -3
  16. data/bin/recoverlost +11 -0
  17. data/bin/recoverlost_alist +10 -0
  18. data/bin/recoverlost_alist_all +10 -0
  19. data/bin/recoverlost_alist_keys +10 -0
  20. data/bin/roma_watcher +10 -0
  21. data/{ruby/server/bin → bin}/romad +3 -2
  22. data/bin/safecopy_integration_test +10 -0
  23. data/bin/safecopy_test +10 -0
  24. data/bin/sample_watcher +10 -0
  25. data/bin/sample_watcher2 +10 -0
  26. data/bin/sample_watcher3 +10 -0
  27. data/bin/simple_bench +11 -0
  28. data/bin/ssroute +10 -0
  29. data/bin/tc_data_restore.rb +123 -0
  30. data/bin/test-scenario +11 -0
  31. data/bin/tribunus +7 -0
  32. data/{ruby/server/lib → lib}/roma/async_process.rb +105 -26
  33. data/{ruby/server/lib → lib}/roma/command/bg_command_receiver.rb +0 -0
  34. data/{ruby/server/lib → lib}/roma/command/command_definition.rb +12 -12
  35. data/{ruby/server/lib → lib}/roma/command/mh_command_receiver.rb +4 -4
  36. data/{ruby/server/lib → lib}/roma/command/receiver.rb +0 -0
  37. data/{ruby/server/lib → lib}/roma/command/rt_command_receiver.rb +7 -0
  38. data/{ruby/server/lib → lib}/roma/command/sys_command_receiver.rb +68 -3
  39. data/{ruby/server/lib → lib}/roma/command/util_command_receiver.rb +0 -0
  40. data/{ruby/server/lib → lib}/roma/command/vn_command_receiver.rb +0 -0
  41. data/{ruby/server/lib → lib}/roma/command_plugin.rb +0 -0
  42. data/{ruby/server/lib → lib}/roma/config.rb +4 -1
  43. data/{ruby/server/lib → lib}/roma/dns_cache.rb +0 -0
  44. data/{ruby/server/lib → lib}/roma/event/con_pool.rb +0 -0
  45. data/{ruby/server/lib → lib}/roma/event/handler.rb +0 -0
  46. data/{ruby/server/lib → lib}/roma/logging/rlogger.rb +61 -2
  47. data/{ruby/server/lib → lib}/roma/messaging/con_pool.rb +14 -0
  48. data/{ruby/server/lib → lib}/roma/plugin/plugin_alist.rb +0 -0
  49. data/{ruby/server/lib → lib}/roma/plugin/plugin_cmd_aliases.rb +0 -0
  50. data/{ruby/server/lib → lib}/roma/plugin/plugin_debug.rb +0 -0
  51. data/{ruby/server/lib → lib}/roma/plugin/plugin_gui.rb +12 -13
  52. data/{ruby/server/lib → lib}/roma/plugin/plugin_map.rb +0 -0
  53. data/{ruby/server/lib → lib}/roma/plugin/plugin_mapcount.rb +0 -0
  54. data/{ruby/server/lib → lib}/roma/plugin/plugin_storage.rb +11 -11
  55. data/{ruby/server/lib → lib}/roma/plugin/plugin_test.rb +0 -0
  56. data/{ruby/server/lib → lib}/roma/romad.rb +25 -1
  57. data/{ruby/server/lib → lib}/roma/routing/cb_rttable.rb +0 -0
  58. data/{ruby/server/lib → lib}/roma/routing/merkle_tree.rb +0 -0
  59. data/{ruby/server/lib → lib}/roma/routing/random_balancer.rb +0 -0
  60. data/{ruby/server/lib → lib}/roma/routing/random_partitioner.rb +0 -0
  61. data/{ruby/server/lib → lib}/roma/routing/routing_data.rb +0 -0
  62. data/{ruby/server/lib → lib}/roma/routing/rttable.rb +0 -0
  63. data/{ruby/server/lib → lib}/roma/stats.rb +11 -0
  64. data/{ruby/server/lib → lib}/roma/storage/basic_storage.rb +3 -0
  65. data/{ruby/server/lib → lib}/roma/storage/dbm_storage.rb +0 -0
  66. data/{ruby/server/lib → lib}/roma/storage/dummy_storage.rb +0 -0
  67. data/lib/roma/storage/groonga_storage.rb +101 -0
  68. data/{ruby/server/lib → lib}/roma/storage/rh_storage.rb +0 -0
  69. data/{ruby/server/lib → lib}/roma/storage/sqlite3_storage.rb +0 -0
  70. data/{ruby/server/lib → lib}/roma/storage/tc_storage.rb +0 -0
  71. data/{ruby/server/lib → lib}/roma/tools/chg_redundancy.rb +0 -0
  72. data/{ruby/server/lib → lib}/roma/tools/cpdb.rb +13 -2
  73. data/{ruby/server/lib → lib}/roma/tools/key_access.rb +1 -1
  74. data/{ruby/server/lib → lib}/roma/tools/key_list.rb +1 -1
  75. data/{ruby/server/lib → lib}/roma/tools/log_merger.rb +0 -0
  76. data/{ruby/server/lib → lib}/roma/tools/mkconfig.rb +1 -1
  77. data/{ruby/server/lib → lib}/roma/tools/mkrecent.rb +1 -1
  78. data/{ruby/server/lib → lib}/roma/tools/mkroute.rb +5 -1
  79. data/{ruby/server/lib → lib}/roma/tools/multi_commander.rb +0 -0
  80. data/{ruby/server/lib → lib}/roma/tools/recoverlost.rb +0 -0
  81. data/{ruby/server/lib → lib}/roma/tools/recoverlost_alist.rb +0 -0
  82. data/{ruby/server/lib → lib}/roma/tools/recoverlost_alist_all.rb +0 -0
  83. data/{ruby/server/lib → lib}/roma/tools/recoverlost_alist_keys.rb +0 -0
  84. data/{ruby/server/lib → lib}/roma/tools/recoverlost_lib.rb +1 -1
  85. data/{ruby/server/lib → lib}/roma/tools/roma_watcher.rb +0 -0
  86. data/{ruby/server/lib → lib}/roma/tools/roma_watcher_config.yml.example +0 -0
  87. data/{ruby/server/lib → lib}/roma/tools/safecopy_integration_test.rb +0 -0
  88. data/{ruby/server/lib → lib}/roma/tools/safecopy_test.rb +0 -0
  89. data/{ruby/server/lib → lib}/roma/tools/sample_watcher.rb +0 -0
  90. data/{ruby/server/lib → lib}/roma/tools/sample_watcher2.rb +0 -0
  91. data/{ruby/server/lib → lib}/roma/tools/sample_watcher3.rb +0 -0
  92. data/{ruby/server/lib → lib}/roma/tools/simple_bench.rb +0 -0
  93. data/{ruby/server/lib → lib}/roma/tools/simple_bench2.rb +0 -0
  94. data/{ruby/server/lib → lib}/roma/tools/ssroute.rb +1 -1
  95. data/{ruby/server/lib → lib}/roma/tools/test-scenario.rb +3 -3
  96. data/{ruby/server/lib → lib}/roma/tools/tribunus.rb +1 -1
  97. data/lib/roma/version.rb +4 -0
  98. data/{ruby/server/lib → lib}/roma/write_behind.rb +0 -0
  99. data/{ruby/server/test → test}/config4mhash.rb +0 -0
  100. data/{ruby/server/test → test}/config4storage_error.rb +0 -0
  101. data/{ruby/server/test → test}/config4test.rb +0 -0
  102. data/{ruby/server/test → test}/rcirb.rb +0 -0
  103. data/{ruby/server/test → test}/roma-test-utils.rb +10 -14
  104. data/test/run-test.rb +20 -0
  105. data/{ruby/server/test → test}/storage_error_storage.rb +0 -0
  106. data/{ruby/server/test → test}/t_command_definition.rb +10 -10
  107. data/{ruby/server/test → test}/t_cpdata.rb +0 -0
  108. data/{ruby/server/test → test}/t_eventmachine.rb +0 -0
  109. data/{ruby/server/test → test}/t_listplugin.rb +9 -3
  110. data/{ruby/server/test → test}/t_mapcountplugin.rb +0 -0
  111. data/{ruby/server/test → test}/t_mapplugin.rb +9 -3
  112. data/{ruby/server/test → test}/t_mhash.rb +7 -7
  113. data/{ruby/server/test → test}/t_protocol.rb +0 -0
  114. data/{ruby/server/test → test}/t_rclient.rb +8 -2
  115. data/{ruby/server/test → test}/t_routing_data.rb +0 -0
  116. data/{ruby/server/test → test}/t_storage.rb +58 -26
  117. data/{ruby/server/test → test}/t_storage_error.rb +5 -3
  118. data/{ruby/server/test → test}/t_writebehind.rb +17 -17
  119. metadata +225 -122
  120. data/README +0 -17
  121. data/ruby/server/bin/chg_redundancy +0 -10
  122. data/ruby/server/bin/cpdb +0 -6
  123. data/ruby/server/bin/key_access +0 -7
  124. data/ruby/server/bin/key_list +0 -7
  125. data/ruby/server/bin/log_merger +0 -6
  126. data/ruby/server/bin/mkrecent +0 -6
  127. data/ruby/server/bin/mkroute +0 -6
  128. data/ruby/server/bin/recoverlost +0 -10
  129. data/ruby/server/bin/recoverlost_alist +0 -10
  130. data/ruby/server/bin/recoverlost_alist_all +0 -10
  131. data/ruby/server/bin/recoverlost_alist_keys +0 -10
  132. data/ruby/server/bin/roma_watcher +0 -7
  133. data/ruby/server/bin/safecopy_integration_test +0 -10
  134. data/ruby/server/bin/safecopy_test +0 -10
  135. data/ruby/server/bin/sample_watcher +0 -7
  136. data/ruby/server/bin/sample_watcher2 +0 -7
  137. data/ruby/server/bin/sample_watcher3 +0 -7
  138. data/ruby/server/bin/simple_bench +0 -11
  139. data/ruby/server/bin/ssroute +0 -6
  140. data/ruby/server/bin/test-scenario +0 -11
  141. data/ruby/server/bin/tribunus +0 -6
  142. data/ruby/server/lib/roma/version.rb +0 -4
  143. data/ruby/server/test/run-test.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 463ee73649102c0de8e1b6a7fa8e42f5130f2332
4
- data.tar.gz: d8f360a9690da7729b3b939486ac9c12a3eb32bf
3
+ metadata.gz: 4c0c8e4fac7121c2eded725b92fdd79bbc38ee9a
4
+ data.tar.gz: e1e9185743aa59abccd0ca9d16170806a91868e1
5
5
  SHA512:
6
- metadata.gz: ec235f905b6bf987aaa157b2c360dfe0b8adf683597cff10fb1149a27aff25a1e9d976a842b7c91907d78e4a2b0dafa281f5af97ce21d408571bbbad99911178
7
- data.tar.gz: 6e9eda8b8885efc140708c2adc549b633263ed29e9bac65ccd5492f3d002c3bf0a8cc3556fc72220bca1ccbeda3111c0dc1c67365136a910a974b51530486742
6
+ metadata.gz: f9e18113c7d99b224a9fd045fb52892f130d75c6e989b20e2e28cf168a13c7f3f1c8352fa72c7eec23c00c0490b28277e8acbc0d0a9166f10cef66d382a0c6cf
7
+ data.tar.gz: d6a9693f346d9e536489ea591734f73b3879933b4f0ca1bb86a8d4904aa60afc7fb709df0fa3d23cfc01e2932ecdd69919a2cec3c7a21cd93f091b90d9782ae0
data/CHANGELOG CHANGED
@@ -1,3 +1,43 @@
1
+ *1.1.0 (Mar 30 2015)*
2
+
3
+ * I improved connection performance during booting [Takahiro Tokunaga] ee411f0
4
+ * change support ruby version [hiroaki-iwase] 69c9cab
5
+ * Update gemspec. [Hiroki Matsue] b2301de
6
+ * remove booting error in the log [Takahiro Tokunaga] c0cfd68
7
+ * Modify routing files checking condition. [Hiroki Matsue] c7bd4ab
8
+ * Remove 'Support' area and modify some commands. [Satoko Kurobe] 0146afe
9
+ * add new commands (set_log_shift_size, set_log_shift_age) [Masami Tazuke] 5d03bee
10
+ * Fix redirect loop of GUI. [Hiroki Matsue] 53a2841
11
+ * Improve Log Gathering logic [Hiroaki Iwase] dfcaa8e
12
+ * add hilatecy check [hiroaki-iwase] 78b0d24
13
+ * add LOG_STREAM_SHOW_WAIT_PARAM when show_logs cmd display logs [hiroaki-iwase] c8f237b
14
+ * change to recursive algorithm [hiroaki-iwase] 6009e53
15
+ * add gathered date for expiration in clean_up process [hiroaki-iwase] d26bb58
16
+ * support outrange direction [hiroaki-iwase] 420c1f8
17
+ * enable to point out start-date and end-date of gathering target [hiroaki-iwase] e1c60dd
18
+ * Correct some URLs. [Satoko Kurobe] d941dc9
19
+ * Remove README and add README.md [Satoko Kurobe] a9a9afc
20
+ * allow node name to only ascii without empty string. [hiroaki-iwase] f05600d
21
+ * add check argument in setroute [hiroaki-iwase] 6b60675
22
+ * remove github issue url [Takahiro Tokunaga] 94feeed
23
+ * add replication_in_host option [Takahiro Tokunaga] 2284a53
24
+ * Define rome.gemspec [Tatsuya Sato] e4c4a89
25
+
26
+ *1.1.0RC2 (Jan 19 2015)*
27
+
28
+ * modify merge prob(delete ruby/server dir, mv groonga relating file) [hiroaki-iwase] 699e0b7
29
+
30
+ *1.1.0RC1 (Jan 7 2015)*
31
+
32
+ * allow cpdb in just case of RubyHashStorage & TCStorage [hiroaki-iwase] 42ef43b
33
+ * add storage type checking to cpdb [hiroaki-iwase] 47c4e56
34
+ * delete server directory [Takahiro Tokunaga] 75ee999
35
+ * Abolish ruby server dir [satoryu] bfe2339
36
+ * Declare the license of ROMA in gemspec file [satoryu] c644f93
37
+ * Add Groonga based storage backend [Kouhei Sutou] fd993d3
38
+ * Use auto test runner [Kouhei Sutou] 2e8367f
39
+ * Use test-unit gem [Kouhei Sutou] 81677d1
40
+
1
41
  *1.0.0 (Sep 30 2014)*
2
42
 
3
43
  * Add new function to get vnodes information of each data [hiroaki-iwase] ad25c6e
@@ -177,7 +217,7 @@
177
217
  * add mail subject prefix feature [byplayer] afcaf48
178
218
  * add mailer path option to roma watch configuration file . [byplayer] ee997e1
179
219
  * add the program for watching a ROMA [Muga Nishizawa] ee916a8
180
- * bugfix:after the first node dose join, lost vnodes cannot be detected. [junji torii] 2a5b3b2
220
+ * bugfix:after the first node does join, lost vnodes cannot be detected. [junji torii] 2a5b3b2
181
221
  * refactor:exclusive operation for iteration in the storage. [junji torii] 7f7d27c
182
222
  * bugfix:stop by irregular data in storage_clean_up_process [junji torii] 40ba9bb
183
223
  * add sample_watcher3, which is a checker for split brain [muga] 749f444
@@ -196,7 +236,7 @@
196
236
  * fixed bug for a recover command option. [junji torii] b847b4d
197
237
  * the forward operation was corrected in the get command. [junji torii] e18019a
198
238
  * improved a vnode balance parameter. [junji torii] 40c762c
199
- * Bug was fixed that auto-termination logic when my node dosen't exist in the routing-table. [junji torii] 4300767
239
+ * Bug was fixed that auto-termination logic when my node doesn't exist in the routing-table. [junji torii] 4300767
200
240
 
201
241
  *0.8.2 (Jan 6 2010)*
202
242
 
data/Gemfile CHANGED
@@ -1,17 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'eventmachine'
4
-
5
- # Back-end storages
6
- group :tokyocabinet do
7
- gem 'tokyocabinet', :git => 'https://github.com/roma/tokyocabinet-ruby.git'
8
- end
9
-
10
- group :gdbm do
11
- gem 'ffi'
12
- gem 'gdbm'
13
- end
14
-
15
- group :sqlite3 do
16
- gem 'sqlite3'
17
- end
3
+ gemspec
data/LICENSE CHANGED
@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
671
671
  may consider it more useful to permit linking proprietary applications with
672
672
  the library. If this is what you want to do, use the GNU Lesser General
673
673
  Public License instead of this License. But first, please read
674
- <http://www.gnu.org/philosophy/why-not-lgpl.html>.
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
data/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # ROMA - A Distributed Key-Value Store in Ruby
2
+
3
+ ROMA is one of the data storing systems for distributed key-value stores.
4
+ It is a completely decentralized distributed system that consists of multiple
5
+ processes, called nodes, on several machines. It is based on pure P2P architecture
6
+ like a distributed hash table, thus it provides high availability and scalability.
7
+
8
+ ROMA is written in Ruby. However, following choices are available to
9
+ access to ROMA.
10
+
11
+ * Client libraries of Ruby and Java are available.
12
+ * ROMA protocol is compatible with memcached text-based one so that
13
+ any memcached client libraries allows users to interact with ROMA.
14
+
15
+ More information is [here](http://roma-kvs.org/ "ROMA").
16
+
17
+ ## Documentation
18
+
19
+ * Refer to [ROMA documentations](http://roma-kvs.org/ "ROMA")
20
+
21
+ ## Requirements
22
+ * Ruby >= 2.1.0
23
+
24
+
25
+
26
+ ## Installation
27
+ ### Install ROMA
28
+ You can simply install ROMA and dependency libralies by using a "gems" command of Ruby as follows.
29
+
30
+ ```
31
+ $ gem install roma
32
+ ```
33
+
34
+ ### Make routing files
35
+
36
+ ROMA is required to make the routing files before starting up.
37
+ The routing file is stored the routing information of each processes.
38
+
39
+ ```
40
+ $ mkroute localhost_10001 localhost_10002 --replication_in_host
41
+ ```
42
+
43
+ If succeeded, two new files which named localhost_10001.route and localhost_10002.route created in the current directory.
44
+ Refer to [Commands](http://roma-kvs.org/commands.html "Commands") for more detail information about Shell Commands.
45
+
46
+ ### Start up ROMA
47
+ Run two processes by using a romad.rb program as follows:
48
+
49
+ ```
50
+ $ romad localhost -p 10001 -d --replication_in_host
51
+ $ romad localhost -p 10002 -d --replication_in_host
52
+ ```
53
+
54
+ Refer to [Commands](http://roma-kvs.org/commands.html "Commands") for more detail information about Shell Commands.
55
+
56
+ ## Usage
57
+ Like memcached, you can connect to ROMA with telnet. Connect to the ROMA process that you ran above.
58
+
59
+ ```
60
+ $ telnet localhost 10001
61
+ ```
62
+
63
+ You can interact with ROMA in the same way of memcached commands.
64
+
65
+ ```
66
+ set foo 0 0 3 <return>
67
+ bar <return>
68
+ STORED
69
+ get foo <return>
70
+ VALUE foo 0 3
71
+ bar
72
+ END
73
+ ```
74
+
75
+ Refer to [Commands](http://roma-kvs.org/commands.html "Commands") for more detail information about ROMA Commands.
76
+
77
+ ## Promoters
78
+ Roma is promoted by [Rakuten, Inc.](http://global.rakuten.com/corp/) and [Rakuten Institute of Technology](http://rit.rakuten.co.jp/).
data/Rakefile CHANGED
@@ -1,14 +1,6 @@
1
- require 'rubygems'
1
+ require 'bundler/gem_tasks'
2
2
  require 'rake'
3
3
 
4
- begin
5
- require 'rubygems/package_task'
6
- PackageTask = Gem::PackageTask
7
- rescue LoadError
8
- require 'rake/gempackagetask'
9
- PackageTask = Rake::GemPackageTask
10
- end
11
-
12
4
  begin
13
5
  require 'rdoc/task'
14
6
  rescue LoadError
@@ -22,59 +14,6 @@ RDOC_OPTIONS = [
22
14
  "-c UTF-8",
23
15
  ]
24
16
 
25
- # gem tasks
26
- base = 'ruby/server/'
27
- PKG_FILES = FileList[
28
- '[A-Z]*',
29
- base + 'bin/**/*',
30
- base + 'lib/**/*',
31
- base + 'test/**/*.rb',
32
- base + 'spec/**/*.rb',
33
- base + 'doc/**/*',
34
- base + 'examples/**/*',
35
- ]
36
-
37
- EXEC_TABLE = Dir.entries(base + 'bin').reject{ |d| d =~ /^\.+$/ || d =~ /^sample_/ }
38
-
39
- require File.expand_path(File.join('ruby', 'server', 'lib', 'roma', 'version'), File.dirname(__FILE__))
40
- VER_NUM = Roma::VERSION
41
-
42
- if VER_NUM =~ /([0-9.p-]+)$/
43
- CURRENT_VERSION = $1.delete("-")
44
- else
45
- CURRENT_VERSION = "0.0.0"
46
- end
47
-
48
- SPEC = Gem::Specification.new do |s|
49
- s.authors = ["Junji Torii", "Hiroki Matsue"]
50
- s.homepage = 'http://code.google.com/p/roma-prj/'
51
- s.name = "roma"
52
- s.version = CURRENT_VERSION
53
- s.summary = "ROMA server"
54
- s.description = <<-EOF
55
- ROMA server
56
- EOF
57
- s.files = PKG_FILES.to_a
58
-
59
- # Use these for libraries.
60
- s.require_path = base + 'lib'
61
-
62
- # Use these for applications.
63
- s.bindir = base + "bin"
64
- s.executables = EXEC_TABLE
65
- s.default_executable = "romad"
66
-
67
- s.has_rdoc = true
68
- s.rdoc_options.concat RDOC_OPTIONS
69
- s.extra_rdoc_files = ["README", "CHANGELOG"]
70
-
71
- s.add_dependency('eventmachine')
72
- end
73
-
74
- package_task = PackageTask.new(SPEC) do |pkg|
75
- end
76
-
77
-
78
17
  Rake::RDocTask.new("doc") { |rdoc|
79
18
  rdoc.rdoc_dir = 'doc'
80
19
  rdoc.title = "ROMA documents"
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/chg_redundancy'
data/bin/cpdb ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ require 'roma/tools/cpdb'
data/bin/key_access ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ require 'roma/tools/key_access'
data/bin/key_list ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ require 'roma/tools/key_list'
data/bin/log_merger ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ require 'roma/tools/log_merger'
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ require 'pathname'
2
3
 
3
- $:.unshift(File.expand_path(File.join('..', 'lib'), File.dirname(__FILE__)))
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
4
6
 
5
7
  require 'optparse'
6
8
  require 'roma/tools/mkconfig'
data/bin/mkrecent ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ require 'roma/tools/mkrecent'
data/bin/mkroute ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ require 'roma/tools/mkroute'
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'pathname'
3
3
 
4
- base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
5
- $LOAD_PATH.unshift("#{base_path}/server/lib")
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
6
 
7
- client_base_path = Pathname(__FILE__).dirname.parent.parent.parent.parent.expand_path
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
8
  $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
9
 
10
+
10
11
  require 'roma/tools/multi_commander'
11
12
 
12
13
  if ARGV.length < 2
data/bin/recoverlost ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+
11
+ require 'roma/tools/recoverlost'
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/recoverlost_alist'
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/recoverlost_alist_all'
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/recoverlost_alist_keys'
data/bin/roma_watcher ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/roma_watcher'
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ require 'pathname'
2
3
 
3
- path = File.dirname(File.expand_path($PROGRAM_NAME))
4
- $LOAD_PATH << path + "/../lib"
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
5
6
 
6
7
  require 'roma/romad'
7
8
 
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/safecopy_integration_test'
data/bin/safecopy_test ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/safecopy_test'
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/sample_watcher'
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/sample_watcher2'
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/sample_watcher3'
data/bin/simple_bench ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/simple_bench'
11
+
data/bin/ssroute ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/ssroute'
@@ -0,0 +1,123 @@
1
+ require 'optparse'
2
+ require 'tokyocabinet'
3
+ require 'roma-client'
4
+ #require 'roma/client/rclient'
5
+
6
+ class TCRecover
7
+ include TokyoCabinet
8
+
9
+ def initialize(argv)
10
+ @timeout = 5
11
+ @data_path = nil
12
+ @division_num = 10
13
+ @wait_param = 0.001
14
+
15
+ opts = OptionParser.new
16
+ opts.banner = "usage:#{File.basename($0)} [options] address:port storage_path ..."
17
+ opts.on("-n","--division [num]","(default=10)"){|v| @division_num = v.to_i }
18
+ opts.on("-w","--wait [num]","(default=0.001)"){|v| @wait_param = v.to_i }
19
+ opts.parse!(argv)
20
+
21
+ if argv.length < 2
22
+ STDERR.puts opts.help
23
+ exit!
24
+ end
25
+
26
+ node = argv[0].sub(':','_')
27
+
28
+ @rc = Roma::Client::RomaClient.new([node])
29
+ @rttable = @rc.rttable
30
+
31
+ @data_paths = argv[1..-1]
32
+
33
+ @data_paths.each do |path|
34
+ each_storage(path) do |tc|
35
+ #p tc
36
+ hdb = open_db(tc)
37
+ start_recover(hdb)
38
+ close_db(hdb)
39
+ end
40
+ end
41
+ end
42
+
43
+ def open_db(fname)
44
+ hdb = HDB::new
45
+ if !hdb.open(fname, HDB::OREADER | HDB::ONOLCK)
46
+ ecode = hdb.ecode
47
+ raise RuntimeError.new("tcdb open error #{hdb.errmsg(ecode)}")
48
+ end
49
+ hdb
50
+ end
51
+
52
+ def close_db(hdb)
53
+ if !hdb.close
54
+ ecode = hdb.ecode
55
+ raise RuntimeError.new("tcdb close error #{hdb.errmsg(ecode)}")
56
+ end
57
+ end
58
+
59
+ # [ 0.. 3] vn
60
+ # [ 4.. 7] physical clock (unix time)
61
+ # [ 8..11] logical clock
62
+ # [12..15] exptime(unix time)
63
+ # [16.. ] value data
64
+ PACK_HEADER_TEMPLATE='NNNN'
65
+ PACK_TEMPLATE=PACK_HEADER_TEMPLATE+'a*'
66
+ def unpack_header(str)
67
+ str.unpack(PACK_HEADER_TEMPLATE)
68
+ end
69
+ def unpack_data(str)
70
+ str.unpack(PACK_TEMPLATE)
71
+ end
72
+
73
+ def get_raw(key)
74
+ nid, d = @rttable.search_node(key)
75
+ cmd = "eval @storages[\"roma\"].get_raw2(\"#{key}\")"
76
+ timeout(@timeout){
77
+ sender = @rc.instance_variable_get(:@sender)
78
+ return sender.send_command(nid, cmd)
79
+ }
80
+ end
81
+
82
+ def each_storage(path)
83
+ Dir::glob("#{path}/*").each{|file|
84
+ yield file if file =~ /\.tc/
85
+ }
86
+ end
87
+
88
+ def cmp_clk(clk1, clk2)
89
+ if (clk1-clk2).abs < 0x80000000 # 1<<31
90
+ clk1 <=> clk2
91
+ else
92
+ clk2 <=> clk1
93
+ end
94
+ end
95
+
96
+ def start_recover(hdb)
97
+ hdb.each do |k, v|
98
+ p k
99
+ p v
100
+ #p @rc.methods
101
+
102
+ rv = @rc[k]
103
+ p "#{k} : #{rv}"
104
+ next if rv
105
+
106
+ roma_raw_data = eval(get_raw(k))
107
+ b_vn, b_t, b_clk, b_expt, b_v = unpack_data(v)
108
+
109
+ if roma_raw_data
110
+ r_vn, r_t, r_clk, r_expt, r_v = roma_raw_data
111
+ if cmp_clk(r_clk, b_clk) <= 0
112
+ @rc[k] = Marshal.load(b_v)
113
+ print "."
114
+ end
115
+ else
116
+ @rc[k] = Marshal.load(b_v)
117
+ print "."
118
+ end
119
+ end
120
+ end
121
+ end
122
+
123
+ tc_recover = TCRecover.new(ARGV)
data/bin/test-scenario ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ client_base_path = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ $LOAD_PATH.unshift("#{client_base_path}/roma-ruby-client/lib")
9
+
10
+ require 'roma/tools/test-scenario'
11
+
data/bin/tribunus ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ base_path = Pathname(__FILE__).dirname.parent.expand_path
5
+ $LOAD_PATH.unshift("#{base_path}/lib")
6
+
7
+ require 'roma/tools/tribunus'