starfish 1.1.3 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/classes/Starfish.html +1 -1
- data/doc/classes/Starfish.src/M000026.html +10 -3
- data/doc/classes/Starfish.src/M000027.html +1 -1
- data/doc/classes/Starfish.src/M000028.html +1 -1
- data/doc/classes/Starfish.src/M000029.html +1 -1
- data/doc/classes/Starfish.src/M000030.html +1 -1
- data/doc/classes/Starfish.src/M000031.html +1 -1
- data/doc/classes/Starfish.src/M000032.html +1 -1
- data/doc/classes/Starfish.src/M000033.html +1 -1
- data/doc/classes/Starfish.src/M000034.html +1 -1
- data/doc/classes/Starfish/RingFinger.src/M000035.html +1 -1
- data/doc/created.rid +1 -1
- data/doc/files/lib/map_reduce/active_record_rb.html +1 -1
- data/doc/files/lib/map_reduce_rb.html +1 -1
- data/doc/files/lib/starfish_rb.html +1 -1
- data/lib/map_reduce/active_record.rb +5 -5
- data/lib/starfish.rb +11 -4
- metadata +2 -2
data/doc/classes/Starfish.html
CHANGED
@@ -130,7 +130,7 @@
|
|
130
130
|
<tr class="top-aligned-row context-row">
|
131
131
|
<td class="context-item-name">VERSION</td>
|
132
132
|
<td>=</td>
|
133
|
-
<td class="context-item-value">"1.
|
133
|
+
<td class="context-item-value">"1.2.0"</td>
|
134
134
|
</tr>
|
135
135
|
<tr class="top-aligned-row context-row">
|
136
136
|
<td class="context-item-name">NULL</td>
|
@@ -45,11 +45,18 @@
|
|
45
45
|
<span class="ruby-identifier">$server_object</span>
|
46
46
|
<span class="ruby-keyword kw">end</span>
|
47
47
|
<span class="ruby-keyword kw">end</span>
|
48
|
-
|
48
|
+
|
49
49
|
<span class="ruby-identifier">map_reduce_client</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
|
50
50
|
<span class="ruby-identifier">t</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
|
51
|
-
<span class="ruby-
|
52
|
-
<span class="ruby-ivar">@@
|
51
|
+
<span class="ruby-keyword kw">begin</span>
|
52
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@options</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span>
|
53
|
+
<span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-ivar">@@options</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">600</span>) <span class="ruby-keyword kw">do</span>
|
54
|
+
<span class="ruby-ivar">@@client</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">object</span>)
|
55
|
+
<span class="ruby-keyword kw">end</span>
|
56
|
+
<span class="ruby-keyword kw">else</span>
|
57
|
+
<span class="ruby-ivar">@@client</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">object</span>)
|
58
|
+
<span class="ruby-keyword kw">end</span>
|
59
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
|
53
60
|
<span class="ruby-keyword kw">end</span>
|
54
61
|
<span class="ruby-ivar">@server_object</span>.<span class="ruby-identifier">add_time_spent_processing_objects</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span><span class="ruby-operator">-</span><span class="ruby-identifier">t</span>)
|
55
62
|
<span class="ruby-keyword kw">end</span>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 155</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
|
15
15
|
<span class="ruby-identifier">negotiate</span>
|
16
16
|
<span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-value">5</span>) { <span class="ruby-ivar">@server_object</span> = <span class="ruby-ivar">@ring_server</span>.<span class="ruby-identifier">read</span>([<span class="ruby-identifier">:name</span>, <span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">intern</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>])[<span class="ruby-value">2</span>] }
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 164</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitize</span>(<span class="ruby-identifier">object</span>)
|
15
15
|
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">DRbUndumped</span>
|
16
16
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 186</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">negotiate</span><span class="ruby-identifier">negotiate</span><span class="ruby-identifier">negotiate</span>
|
15
15
|
<span class="ruby-keyword kw">begin</span>
|
16
16
|
<span class="ruby-ivar">@ring_server</span> = <span class="ruby-constant">RingFinger</span>.<span class="ruby-identifier">primary</span>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 207</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn</span>
|
15
15
|
<span class="ruby-ivar">@started</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">STARFISH_FORK</span>.<span class="ruby-identifier">call</span> { <span class="ruby-identifier">system</span>(<span class="ruby-node">"ruby #{File.dirname(__FILE__)}/../bin/starfish #{@uniq} server > #{NULL}"</span>) }
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 211</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
|
15
15
|
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"stopping the server"</span>
|
16
16
|
<span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-value str">"SIGHUP"</span>, <span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-ivar">@@options</span>[<span class="ruby-identifier">:pid</span>] <span class="ruby-operator">||</span> <span class="ruby-node">"#{Dir.tmpdir}/starfish-#{uniq}.pid"</span>).<span class="ruby-identifier">to_i</span>)
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 220</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server=</span>(<span class="ruby-identifier">server</span>)
|
15
15
|
<span class="ruby-ivar">@@server</span> = <span class="ruby-identifier">server</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 224</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client=</span>(<span class="ruby-identifier">client</span>)
|
15
15
|
<span class="ruby-ivar">@@client</span> = <span class="ruby-identifier">client</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 228</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options=</span>(<span class="ruby-identifier">options</span>={})
|
15
15
|
<span class="ruby-ivar">@@options</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 191</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">RingFinger</span>.<span class="ruby-identifier">finger</span>
|
15
15
|
<span class="ruby-ivar">@@finger</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>
|
16
16
|
<span class="ruby-ivar">@@finger</span>.<span class="ruby-identifier">lookup_ring_any</span>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Wed Sep 20 12:19:08 PDT 2006
|
@@ -67,17 +67,18 @@ private
|
|
67
67
|
|
68
68
|
def set_total
|
69
69
|
@total = type.count(input)
|
70
|
-
|
70
|
+
if @rescan_when_complete
|
71
|
+
@offset = 0
|
72
|
+
else
|
71
73
|
@queue_size ||= @total
|
72
74
|
end
|
73
75
|
end
|
74
76
|
|
75
77
|
def queue
|
76
78
|
if @queue.empty?
|
77
|
-
|
78
|
-
when 0
|
79
|
+
if @offset == 0
|
79
80
|
set_total
|
80
|
-
|
81
|
+
elsif @offset >= @total
|
81
82
|
if @rescan_when_complete || @vigilant
|
82
83
|
set_total
|
83
84
|
else
|
@@ -112,7 +113,6 @@ private
|
|
112
113
|
@num_queues_grabbed += 1
|
113
114
|
|
114
115
|
@offset += @queue.size unless @queue.empty?
|
115
|
-
@offset = 0 if @offset == @total && @rescan_when_complete
|
116
116
|
@lock = false
|
117
117
|
end
|
118
118
|
|
data/lib/starfish.rb
CHANGED
@@ -23,7 +23,7 @@ end
|
|
23
23
|
|
24
24
|
class StarfishError < StandardError; end
|
25
25
|
class Starfish
|
26
|
-
VERSION = "1.
|
26
|
+
VERSION = "1.2.0"
|
27
27
|
NULL = (RUBY_PLATFORM =~ /mswin/) ? 'NUL' : '/dev/null'
|
28
28
|
|
29
29
|
@@server = false
|
@@ -110,11 +110,18 @@ class Starfish
|
|
110
110
|
$server_object
|
111
111
|
end
|
112
112
|
end
|
113
|
-
|
113
|
+
|
114
114
|
map_reduce_client.each do |object|
|
115
115
|
t = Time.now
|
116
|
-
|
117
|
-
@@
|
116
|
+
begin
|
117
|
+
if @@options[:timeout] != false
|
118
|
+
Timeout::timeout(@@options[:timeout] || 600) do
|
119
|
+
@@client.call(object)
|
120
|
+
end
|
121
|
+
else
|
122
|
+
@@client.call(object)
|
123
|
+
end
|
124
|
+
rescue Timeout::Error
|
118
125
|
end
|
119
126
|
@server_object.add_time_spent_processing_objects(Time.now-t)
|
120
127
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: starfish
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.
|
7
|
-
date: 2006-09-
|
6
|
+
version: 1.2.0
|
7
|
+
date: 2006-09-20 00:00:00 -07:00
|
8
8
|
summary: Starfish is a utility to make distributed programming ridiculously easy.
|
9
9
|
require_paths:
|
10
10
|
- lib
|