roma 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/LICENSE.rdoc +675 -0
  2. data/README.rdoc +0 -0
  3. data/Rakefile +70 -0
  4. data/bin/mkrecent +7 -0
  5. data/bin/mkroute +7 -0
  6. data/bin/recoverlost +8 -0
  7. data/bin/recoverlost_alist +8 -0
  8. data/bin/romad +7 -0
  9. data/bin/sample_watcher +8 -0
  10. data/bin/sample_watcher2 +8 -0
  11. data/bin/simple_bench +8 -0
  12. data/bin/ssroute +7 -0
  13. data/bin/tribunus +7 -0
  14. data/lib/roma/async_process.rb +696 -0
  15. data/lib/roma/command/bg_command_receiver.rb +188 -0
  16. data/lib/roma/command/mh_command_receiver.rb +117 -0
  17. data/lib/roma/command/receiver.rb +287 -0
  18. data/lib/roma/command/rt_command_receiver.rb +147 -0
  19. data/lib/roma/command/st_command_receiver.rb +564 -0
  20. data/lib/roma/command/util_command_receiver.rb +67 -0
  21. data/lib/roma/command/vn_command_receiver.rb +143 -0
  22. data/lib/roma/command_plugin.rb +11 -0
  23. data/lib/roma/config.rb +64 -0
  24. data/lib/roma/event/con_pool.rb +140 -0
  25. data/lib/roma/event/handler.rb +159 -0
  26. data/lib/roma/plugin/plugin_alist.rb +1572 -0
  27. data/lib/roma/plugin/plugin_debug.rb +19 -0
  28. data/lib/roma/plugin/plugin_test.rb +14 -0
  29. data/lib/roma/romad.rb +582 -0
  30. data/lib/roma/routing/cb_rttable.rb +326 -0
  31. data/lib/roma/routing/merkle_tree.rb +54 -0
  32. data/lib/roma/routing/rttable.rb +148 -0
  33. data/lib/roma/stats.rb +112 -0
  34. data/lib/roma/storage/basic_storage.rb +510 -0
  35. data/lib/roma/storage/dbm_storage.rb +80 -0
  36. data/lib/roma/storage/dummy_storage.rb +44 -0
  37. data/lib/roma/storage/rh_storage.rb +35 -0
  38. data/lib/roma/storage/sqlite3_storage.rb +73 -0
  39. data/lib/roma/storage/tc_storage.rb +133 -0
  40. data/lib/roma/tools/mkrecent.rb +138 -0
  41. data/lib/roma/tools/mkroute.rb +52 -0
  42. data/lib/roma/tools/recoverlost.rb +9 -0
  43. data/lib/roma/tools/recoverlost_alist.rb +9 -0
  44. data/lib/roma/tools/recoverlost_lib.rb +217 -0
  45. data/lib/roma/tools/sample_watcher.rb +38 -0
  46. data/lib/roma/tools/sample_watcher2.rb +38 -0
  47. data/lib/roma/tools/simple_bench.rb +57 -0
  48. data/lib/roma/tools/ssroute.rb +23 -0
  49. data/lib/roma/tools/tribunus.rb +299 -0
  50. data/lib/roma/version.rb +4 -0
  51. data/lib/roma/write_behind.rb +179 -0
  52. data/test/rcirb.rb +16 -0
  53. data/test/roma-test-utils.rb +65 -0
  54. data/test/run-test.rb +16 -0
  55. data/test/t_cpdata.rb +277 -0
  56. data/test/t_listplugin.rb +592 -0
  57. data/test/t_rclient.rb +318 -0
  58. data/test/t_routing_data.rb +100 -0
  59. data/test/t_storage.rb +644 -0
  60. data/test/t_writebehind.rb +200 -0
  61. metadata +134 -0
data/Rakefile ADDED
@@ -0,0 +1,70 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'rubygems'
3
+ require 'rake'
4
+ require 'rake/gempackagetask'
5
+ require 'rake/rdoctask'
6
+
7
+ RDOC_OPTIONS = [
8
+ '--line-numbers',
9
+ '--inline-source',
10
+ "--main", "README.rdoc",
11
+ "-c UTF-8",
12
+ ]
13
+
14
+ # gem tasks
15
+ PKG_FILES = FileList[
16
+ '[A-Z]*',
17
+ 'bin/**/*',
18
+ 'lib/**/*.rb',
19
+ 'test/**/*.rb',
20
+ 'spec/**/*.rb',
21
+ 'doc/**/*',
22
+ 'examples/**/*',
23
+ ]
24
+
25
+ EXEC_TABLE = Dir.entries('bin').reject{ |d| d =~ /^\.+$/ || d =~ /^sample_/ }
26
+
27
+
28
+ VER_NUM = `ruby -Ilib -e 'require "roma/version"; puts Roma::VERSION'`
29
+
30
+ if VER_NUM =~ /([0-9.]+)$/
31
+ CURRENT_VERSION = $1
32
+ else
33
+ CURRENT_VERSION = "0.0.0"
34
+ end
35
+
36
+ SPEC = Gem::Specification.new do |s|
37
+ s.name = "roma"
38
+ s.version = CURRENT_VERSION
39
+ s.summary = "ROMA server"
40
+ s.description = <<-EOF
41
+ ROMA server
42
+ EOF
43
+ s.files = PKG_FILES.to_a
44
+
45
+ # Use these for libraries.
46
+ s.require_path = 'lib'
47
+
48
+ # Use these for applications.
49
+ s.bindir = "bin"
50
+ s.executables = EXEC_TABLE
51
+ s.default_executable = "romad"
52
+
53
+ s.has_rdoc = true
54
+ s.rdoc_options.concat RDOC_OPTIONS
55
+ s.extra_rdoc_files = ["README.rdoc"]
56
+
57
+ s.add_dependency('roma-commons')
58
+ end
59
+
60
+ package_task = Rake::GemPackageTask.new(SPEC) do |pkg|
61
+ end
62
+
63
+
64
+ Rake::RDocTask.new("doc") { |rdoc|
65
+ rdoc.rdoc_dir = 'doc'
66
+ rdoc.title = "ROMA documents"
67
+ rdoc.options.concat RDOC_OPTIONS
68
+ rdoc.rdoc_files.include('lib/**/*.rb')
69
+ rdoc.rdoc_files.include("README.rdoc")
70
+ }
data/bin/mkrecent ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+
7
+ require 'roma/tools/mkrecent'
data/bin/mkroute ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+
7
+ require 'roma/tools/mkroute'
data/bin/recoverlost ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+ $LOAD_PATH << path + "/../../client/lib"
7
+
8
+ require 'roma/tools/recoverlost'
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+ $LOAD_PATH << path + "/../../client/lib"
7
+
8
+ require 'roma/tools/recoverlost_alist'
data/bin/romad ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+
7
+ require 'roma/romad'
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+ $LOAD_PATH << path + "/../../client/lib"
7
+
8
+ require 'roma/tools/sample_watcher'
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+ $LOAD_PATH << path + "/../../client/lib"
7
+
8
+ require 'roma/tools/sample_watcher2'
data/bin/simple_bench ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+ $LOAD_PATH << path + "/../../client/lib"
7
+
8
+ require 'roma/tools/simple_bench'
data/bin/ssroute ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+
7
+ require 'roma/tools/ssroute'
data/bin/tribunus ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = File.dirname(File.expand_path($PROGRAM_NAME))
4
+ $LOAD_PATH << path + "/../lib"
5
+ $LOAD_PATH << path + "/../../commons/lib"
6
+
7
+ require 'roma/tools/tribunus'