tem_mr_search 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/lib/tem_mr_search/map_reduce_executor.rb +8 -13
- data/tem_mr_search.gemspec +1 -1
- data/test/test_map_reduce_executor.rb +6 -5
- metadata +1 -1
data/CHANGELOG
CHANGED
@@ -47,9 +47,9 @@ class MapReduceExecutor
|
|
47
47
|
@outputs = {}
|
48
48
|
|
49
49
|
# Protected by @lock
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
tasks = { :map => 0.0, :reduce => 0.0, :finalize => 0.0,
|
51
|
+
:migrate => 0.0, :tem_ids => 0.0 }
|
52
|
+
@timings = { :tems => Array.new(@tems.length) { tasks.dup } }
|
53
53
|
|
54
54
|
# Thread-safe.
|
55
55
|
@thread_queues = tems.map { |tem| Queue.new }
|
@@ -92,8 +92,7 @@ class MapReduceExecutor
|
|
92
92
|
time_delta = Time.now - t0
|
93
93
|
@lock.synchronize do
|
94
94
|
@tem_certs[index] = ecert
|
95
|
-
@timings[:
|
96
|
-
@timings[:tems][index] += time_delta
|
95
|
+
@timings[:tems][index][:tem_ids] += time_delta
|
97
96
|
end
|
98
97
|
end
|
99
98
|
end
|
@@ -128,8 +127,7 @@ class MapReduceExecutor
|
|
128
127
|
|
129
128
|
@lock.synchronize do
|
130
129
|
@tem_parts[action[:secpack]][action[:to]] = out_part
|
131
|
-
@timings[:tems][tem_index] += time_delta
|
132
|
-
@timings[:tasks][:migrate] += time_delta
|
130
|
+
@timings[:tems][tem_index][:migrate] += time_delta
|
133
131
|
end
|
134
132
|
|
135
133
|
when :map
|
@@ -145,8 +143,7 @@ class MapReduceExecutor
|
|
145
143
|
|
146
144
|
@lock.synchronize do
|
147
145
|
@outputs[action[:output_id]] = output
|
148
|
-
@timings[:tems][tem_index] += time_delta
|
149
|
-
@timings[:tasks][:map] += time_delta
|
146
|
+
@timings[:tems][tem_index][:map] += time_delta
|
150
147
|
end
|
151
148
|
|
152
149
|
when :reduce
|
@@ -163,8 +160,7 @@ class MapReduceExecutor
|
|
163
160
|
|
164
161
|
@lock.synchronize do
|
165
162
|
@outputs[action[:output_id]] = output
|
166
|
-
@timings[:tems][tem_index] += time_delta
|
167
|
-
@timings[:tasks][:reduce] += time_delta
|
163
|
+
@timings[:tems][tem_index][:reduce] += time_delta
|
168
164
|
end
|
169
165
|
|
170
166
|
when :finalize
|
@@ -180,8 +176,7 @@ class MapReduceExecutor
|
|
180
176
|
|
181
177
|
@lock.synchronize do
|
182
178
|
@outputs[action[:final_id]] = final_output
|
183
|
-
@timings[:tems][tem_index] += time_delta
|
184
|
-
@timings[:tasks][:finalize] += time_delta
|
179
|
+
@timings[:tems][tem_index][:finalize] += time_delta
|
185
180
|
end
|
186
181
|
end
|
187
182
|
end
|
data/tem_mr_search.gemspec
CHANGED
@@ -34,12 +34,13 @@ class MapReduceExecutorTest < MrTestCase
|
|
34
34
|
'Incorrect Map-Reduce result (score)'
|
35
35
|
|
36
36
|
assert data[:timings], 'No timings returned'
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
assert_equal tems.length, data[:timings][:tems].length,
|
38
|
+
'No TEM data in the timings'
|
39
|
+
data[:timings][:tems].each do |tem_data|
|
40
|
+
[:tem_ids, :migrate, :map, :reduce, :finalize].each do |task|
|
41
|
+
assert tem_data[task], "No data on #{task} in the per-TEM timings"
|
42
|
+
end
|
40
43
|
end
|
41
|
-
assert_operator data[:timings][:tems], :kind_of?, Array,
|
42
|
-
'No per-TEM data in the timings'
|
43
44
|
assert data[:timings][:total], 'No total time in the timings'
|
44
45
|
|
45
46
|
# Dump timing stats to show scheduler performance.
|