tango-etl 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/{changelog.md → CHANGELOG.md} +5 -1
- data/{readme.md → README.md} +1 -1
- data/doc/Multidb/Balancer.html +202 -0
- data/doc/Multidb.html +184 -0
- data/doc/Tango/AbstractModel.html +608 -0
- data/doc/Tango/App.html +1334 -0
- data/doc/Tango/DatabaseLocker.html +541 -0
- data/doc/Tango/ETL/Dispatcher.html +465 -0
- data/doc/Tango/ETL/HandlerInterface.html +639 -0
- data/doc/Tango/ETL/OperatorInterface.html +494 -0
- data/doc/Tango/ETL.html +117 -0
- data/doc/Tango/Kernel.html +432 -0
- data/doc/Tango/LinkStack.html +737 -0
- data/doc/Tango/Resource/Buffer.html +565 -0
- data/doc/Tango/Resource/Cache.html +834 -0
- data/doc/Tango/Resource.html +117 -0
- data/doc/Tango.html +131 -0
- data/doc/_index.html +297 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +80 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +80 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +365 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/tango/abstract_model.rb +1 -0
- data/lib/tango/app.rb +4 -7
- data/lib/tango/database_locker.rb +23 -2
- data/lib/tango/etl/handler_interface.rb +12 -6
- data/lib/tango/resource/buffer.rb +7 -7
- data/lib/tango/resource/cache.rb +18 -13
- data/lib/tango/version.rb +1 -1
- data/test/support/lib/simple_handler.rb +5 -14
- data/test/unit/etl/test_dispatcher.rb +21 -5
- metadata +33 -6
- data/config/app.yml.sample +0 -6
- data/config/database.yml.sample +0 -27
@@ -0,0 +1,541 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Tango::DatabaseLocker
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!Tango/DatabaseLocker.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (D)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Tango.html" title="Tango (module)">Tango</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">DatabaseLocker</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Tango::DatabaseLocker
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Tango::DatabaseLocker</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/tango/database_locker.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Database locker in form of .lock file</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
<p class="tag_title">Author:</p>
|
113
|
+
<ul class="author">
|
114
|
+
|
115
|
+
<li>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<div class='inline'>
|
122
|
+
<p>Mckomo</p>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
</li>
|
126
|
+
|
127
|
+
</ul>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
134
|
+
<ul class="summary">
|
135
|
+
|
136
|
+
<li class="public ">
|
137
|
+
<span class="summary_signature">
|
138
|
+
|
139
|
+
<a href="#lock_path-instance_method" title="#lock_path (instance method)">- (Object) <strong>lock_path</strong> </a>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
</span>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<span class="note title readonly">readonly</span>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
<span class="summary_desc"><div class='inline'>
|
159
|
+
<p>Returns the value of attribute lock_path.</p>
|
160
|
+
</div></span>
|
161
|
+
|
162
|
+
</li>
|
163
|
+
|
164
|
+
|
165
|
+
</ul>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<h2>
|
172
|
+
Instance Method Summary
|
173
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
174
|
+
</h2>
|
175
|
+
|
176
|
+
<ul class="summary">
|
177
|
+
|
178
|
+
<li class="public ">
|
179
|
+
<span class="summary_signature">
|
180
|
+
|
181
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Tango::DatabaseLocker) <strong>initialize</strong>(candidates = [], lock_path = "./tmp/database.lock") </a>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
</span>
|
186
|
+
|
187
|
+
|
188
|
+
<span class="note title constructor">constructor</span>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<span class="summary_desc"><div class='inline'>
|
198
|
+
<p>Constructor of DatabaseLocker.</p>
|
199
|
+
</div></span>
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
204
|
+
<li class="public ">
|
205
|
+
<span class="summary_signature">
|
206
|
+
|
207
|
+
<a href="#lock-instance_method" title="#lock (instance method)">- (Tango::DatabaseLocker) <strong>lock</strong>(database) </a>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<span class="summary_desc"><div class='inline'>
|
222
|
+
<p>Lock given database.</p>
|
223
|
+
</div></span>
|
224
|
+
|
225
|
+
</li>
|
226
|
+
|
227
|
+
|
228
|
+
<li class="public ">
|
229
|
+
<span class="summary_signature">
|
230
|
+
|
231
|
+
<a href="#unlocked-instance_method" title="#unlocked (instance method)">- (Object) <strong>unlocked</strong> </a>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
</span>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<span class="summary_desc"><div class='inline'>
|
246
|
+
<p>Return name of unlocked database.</p>
|
247
|
+
</div></span>
|
248
|
+
|
249
|
+
</li>
|
250
|
+
|
251
|
+
|
252
|
+
</ul>
|
253
|
+
|
254
|
+
|
255
|
+
<div id="constructor_details" class="method_details_list">
|
256
|
+
<h2>Constructor Details</h2>
|
257
|
+
|
258
|
+
<div class="method_details first">
|
259
|
+
<h3 class="signature first" id="initialize-instance_method">
|
260
|
+
|
261
|
+
- (<tt><span class='object_link'><a href="" title="Tango::DatabaseLocker (class)">Tango::DatabaseLocker</a></span></tt>) <strong>initialize</strong>(candidates = [], lock_path = "./tmp/database.lock")
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
</h3><div class="docstring">
|
268
|
+
<div class="discussion">
|
269
|
+
|
270
|
+
<p>Constructor of DatabaseLocker</p>
|
271
|
+
|
272
|
+
|
273
|
+
</div>
|
274
|
+
</div>
|
275
|
+
<div class="tags">
|
276
|
+
<p class="tag_title">Parameters:</p>
|
277
|
+
<ul class="param">
|
278
|
+
|
279
|
+
<li>
|
280
|
+
|
281
|
+
<span class='name'>candidates</span>
|
282
|
+
|
283
|
+
|
284
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
285
|
+
|
286
|
+
|
287
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
288
|
+
|
289
|
+
|
290
|
+
—
|
291
|
+
<div class='inline'>
|
292
|
+
<p>List of databases to be blocked</p>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</li>
|
296
|
+
|
297
|
+
<li>
|
298
|
+
|
299
|
+
<span class='name'>lock_path</span>
|
300
|
+
|
301
|
+
|
302
|
+
<span class='type'>(<tt>String</tt>)</span>
|
303
|
+
|
304
|
+
|
305
|
+
<em class="default">(defaults to: <tt>"./tmp/database.lock"</tt>)</em>
|
306
|
+
|
307
|
+
|
308
|
+
</li>
|
309
|
+
|
310
|
+
</ul>
|
311
|
+
|
312
|
+
|
313
|
+
</div><table class="source_code">
|
314
|
+
<tr>
|
315
|
+
<td>
|
316
|
+
<pre class="lines">
|
317
|
+
|
318
|
+
|
319
|
+
16
|
320
|
+
17
|
321
|
+
18
|
322
|
+
19</pre>
|
323
|
+
</td>
|
324
|
+
<td>
|
325
|
+
<pre class="code"><span class="info file"># File 'lib/tango/database_locker.rb', line 16</span>
|
326
|
+
|
327
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span> <span class='id identifier rubyid_candidates'>candidates</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_lock_path'>lock_path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>./tmp/database.lock</span><span class='tstring_end'>"</span></span> <span class='rparen'>)</span>
|
328
|
+
<span class='ivar'>@candidates</span> <span class='op'>=</span> <span class='id identifier rubyid_candidates'>candidates</span>
|
329
|
+
<span class='ivar'>@lock_path</span> <span class='op'>=</span> <span class='id identifier rubyid_lock_path'>lock_path</span>
|
330
|
+
<span class='kw'>end</span></pre>
|
331
|
+
</td>
|
332
|
+
</tr>
|
333
|
+
</table>
|
334
|
+
</div>
|
335
|
+
|
336
|
+
</div>
|
337
|
+
|
338
|
+
<div id="instance_attr_details" class="attr_details">
|
339
|
+
<h2>Instance Attribute Details</h2>
|
340
|
+
|
341
|
+
|
342
|
+
<span id=""></span>
|
343
|
+
<div class="method_details first">
|
344
|
+
<h3 class="signature first" id="lock_path-instance_method">
|
345
|
+
|
346
|
+
- (<tt>Object</tt>) <strong>lock_path</strong> <span class="extras">(readonly)</span>
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
</h3><div class="docstring">
|
353
|
+
<div class="discussion">
|
354
|
+
|
355
|
+
<p>Returns the value of attribute lock_path</p>
|
356
|
+
|
357
|
+
|
358
|
+
</div>
|
359
|
+
</div>
|
360
|
+
<div class="tags">
|
361
|
+
|
362
|
+
|
363
|
+
</div><table class="source_code">
|
364
|
+
<tr>
|
365
|
+
<td>
|
366
|
+
<pre class="lines">
|
367
|
+
|
368
|
+
|
369
|
+
8
|
370
|
+
9
|
371
|
+
10</pre>
|
372
|
+
</td>
|
373
|
+
<td>
|
374
|
+
<pre class="code"><span class="info file"># File 'lib/tango/database_locker.rb', line 8</span>
|
375
|
+
|
376
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_lock_path'>lock_path</span>
|
377
|
+
<span class='ivar'>@lock_path</span>
|
378
|
+
<span class='kw'>end</span></pre>
|
379
|
+
</td>
|
380
|
+
</tr>
|
381
|
+
</table>
|
382
|
+
</div>
|
383
|
+
|
384
|
+
</div>
|
385
|
+
|
386
|
+
|
387
|
+
<div id="instance_method_details" class="method_details_list">
|
388
|
+
<h2>Instance Method Details</h2>
|
389
|
+
|
390
|
+
|
391
|
+
<div class="method_details first">
|
392
|
+
<h3 class="signature first" id="lock-instance_method">
|
393
|
+
|
394
|
+
- (<tt><span class='object_link'><a href="" title="Tango::DatabaseLocker (class)">Tango::DatabaseLocker</a></span></tt>) <strong>lock</strong>(database)
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
</h3><div class="docstring">
|
401
|
+
<div class="discussion">
|
402
|
+
|
403
|
+
<p>Lock given database</p>
|
404
|
+
|
405
|
+
|
406
|
+
</div>
|
407
|
+
</div>
|
408
|
+
<div class="tags">
|
409
|
+
|
410
|
+
<div class="examples">
|
411
|
+
<p class="tag_title">Examples:</p>
|
412
|
+
|
413
|
+
|
414
|
+
<pre class="example code"><code><span class='id identifier rubyid_unlocked'>unlocked</span> <span class='op'>=</span> <span class='id identifier rubyid_database_locker'>database_locker</span><span class='period'>.</span><span class='id identifier rubyid_unlocked'>unlocked</span> <span class='comment'># Find unlocked database
|
415
|
+
</span><span class='id identifier rubyid_connect_to_db'>connect_to_db</span><span class='lparen'>(</span> <span class='id identifier rubyid_unlocked'>unlocked</span> <span class='rparen'>)</span> <span class='comment'># Connect to unlocked database
|
416
|
+
</span><span class='id identifier rubyid_edit_db_data'>edit_db_data</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='comment'># Change database data
|
417
|
+
</span><span class='id identifier rubyid_database_locker'>database_locker</span><span class='period'>.</span><span class='id identifier rubyid_lock'>lock</span><span class='lparen'>(</span> <span class='id identifier rubyid_unlocked'>unlocked</span> <span class='rparen'>)</span> <span class='comment'># Lock database to be sure that any changes wont be made</span></code></pre>
|
418
|
+
|
419
|
+
</div>
|
420
|
+
<p class="tag_title">Parameters:</p>
|
421
|
+
<ul class="param">
|
422
|
+
|
423
|
+
<li>
|
424
|
+
|
425
|
+
<span class='name'>database</span>
|
426
|
+
|
427
|
+
|
428
|
+
<span class='type'>(<tt>String</tt>)</span>
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
</li>
|
433
|
+
|
434
|
+
</ul>
|
435
|
+
|
436
|
+
<p class="tag_title">Returns:</p>
|
437
|
+
<ul class="return">
|
438
|
+
|
439
|
+
<li>
|
440
|
+
|
441
|
+
|
442
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Tango::DatabaseLocker (class)">Tango::DatabaseLocker</a></span></tt>)</span>
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
</li>
|
447
|
+
|
448
|
+
</ul>
|
449
|
+
|
450
|
+
</div><table class="source_code">
|
451
|
+
<tr>
|
452
|
+
<td>
|
453
|
+
<pre class="lines">
|
454
|
+
|
455
|
+
|
456
|
+
37
|
457
|
+
38
|
458
|
+
39
|
459
|
+
40
|
460
|
+
41
|
461
|
+
42
|
462
|
+
43
|
463
|
+
44
|
464
|
+
45
|
465
|
+
46
|
466
|
+
47</pre>
|
467
|
+
</td>
|
468
|
+
<td>
|
469
|
+
<pre class="code"><span class="info file"># File 'lib/tango/database_locker.rb', line 37</span>
|
470
|
+
|
471
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_lock'>lock</span><span class='lparen'>(</span> <span class='id identifier rubyid_database'>database</span> <span class='rparen'>)</span>
|
472
|
+
|
473
|
+
<span class='ivar'>@unlocked</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
474
|
+
|
475
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span> <span class='id identifier rubyid_lock_path'>lock_path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>w</span><span class='tstring_end'>"</span></span> <span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
|
476
|
+
<span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span> <span class='id identifier rubyid_database'>database</span> <span class='rparen'>)</span>
|
477
|
+
<span class='kw'>end</span>
|
478
|
+
|
479
|
+
<span class='kw'>self</span>
|
480
|
+
|
481
|
+
<span class='kw'>end</span></pre>
|
482
|
+
</td>
|
483
|
+
</tr>
|
484
|
+
</table>
|
485
|
+
</div>
|
486
|
+
|
487
|
+
<div class="method_details ">
|
488
|
+
<h3 class="signature " id="unlocked-instance_method">
|
489
|
+
|
490
|
+
- (<tt>Object</tt>) <strong>unlocked</strong>
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
</h3><div class="docstring">
|
497
|
+
<div class="discussion">
|
498
|
+
|
499
|
+
<p>Return name of unlocked database</p>
|
500
|
+
|
501
|
+
<p>return [String]</p>
|
502
|
+
|
503
|
+
|
504
|
+
</div>
|
505
|
+
</div>
|
506
|
+
<div class="tags">
|
507
|
+
|
508
|
+
|
509
|
+
</div><table class="source_code">
|
510
|
+
<tr>
|
511
|
+
<td>
|
512
|
+
<pre class="lines">
|
513
|
+
|
514
|
+
|
515
|
+
24
|
516
|
+
25
|
517
|
+
26</pre>
|
518
|
+
</td>
|
519
|
+
<td>
|
520
|
+
<pre class="code"><span class="info file"># File 'lib/tango/database_locker.rb', line 24</span>
|
521
|
+
|
522
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_unlocked'>unlocked</span>
|
523
|
+
<span class='ivar'>@unlocked</span> <span class='op'>||=</span> <span class='id identifier rubyid_find_unlocked'>find_unlocked</span>
|
524
|
+
<span class='kw'>end</span></pre>
|
525
|
+
</td>
|
526
|
+
</tr>
|
527
|
+
</table>
|
528
|
+
</div>
|
529
|
+
|
530
|
+
</div>
|
531
|
+
|
532
|
+
</div>
|
533
|
+
|
534
|
+
<div id="footer">
|
535
|
+
Generated on Tue Apr 15 02:47:42 2014 by
|
536
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
537
|
+
0.8.7.4 (ruby-2.0.0).
|
538
|
+
</div>
|
539
|
+
|
540
|
+
</body>
|
541
|
+
</html>
|