jylis-rb 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +221 -0
  3. data/doc/Jylis.html +1087 -6
  4. data/doc/Jylis/Connection.html +1128 -0
  5. data/doc/Jylis/Connection/HostMissingError.html +135 -0
  6. data/doc/Jylis/Connection/UnsupportedSchemaError.html +135 -0
  7. data/doc/Jylis/DataType.html +135 -0
  8. data/doc/Jylis/DataType/Base.html +346 -0
  9. data/doc/Jylis/DataType/GCOUNT.html +331 -0
  10. data/doc/Jylis/DataType/GCOUNT/Result.html +132 -0
  11. data/doc/Jylis/DataType/MVREG.html +318 -0
  12. data/doc/Jylis/DataType/PNCOUNT.html +404 -0
  13. data/doc/Jylis/DataType/TLOG.html +750 -0
  14. data/doc/Jylis/DataType/TLOG/Result.html +640 -0
  15. data/doc/Jylis/DataType/TLOG/Row.html +616 -0
  16. data/doc/Jylis/DataType/TREG.html +345 -0
  17. data/doc/Jylis/DataType/TREG/Result.html +616 -0
  18. data/doc/Jylis/DataType/UJSON.html +549 -0
  19. data/doc/_index.html +185 -4
  20. data/doc/class_list.html +1 -1
  21. data/doc/file.README.html +223 -3
  22. data/doc/file.license.html +3 -3
  23. data/doc/frames.html +1 -1
  24. data/doc/index.html +223 -3
  25. data/doc/method_list.html +512 -0
  26. data/doc/top-level-namespace.html +3 -3
  27. data/lib/jylis-rb.rb +9 -0
  28. data/lib/jylis-rb/connection.rb +121 -0
  29. data/lib/jylis-rb/data_types/base.rb +24 -0
  30. data/lib/jylis-rb/data_types/gcount.rb +24 -0
  31. data/lib/jylis-rb/data_types/mvreg.rb +23 -0
  32. data/lib/jylis-rb/data_types/pncount.rb +33 -0
  33. data/lib/jylis-rb/data_types/tlog.rb +157 -0
  34. data/lib/jylis-rb/data_types/treg.rb +57 -0
  35. data/lib/jylis-rb/data_types/ujson.rb +87 -0
  36. data/lib/jylis-rb/jylis.rb +106 -0
  37. data/lib/jylis-rb/version.rb +1 -1
  38. metadata +39 -2
@@ -0,0 +1,750 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Jylis::DataType::TLOG
8
+
9
+ &mdash; Documentation by YARD 0.9.14
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
+ pathId = "Jylis::DataType::TLOG";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (T)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Jylis.html" title="Jylis (class)">Jylis</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../DataType.html" title="Jylis::DataType (module)">DataType</a></span></span>
41
+ &raquo;
42
+ <span class="title">TLOG</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Jylis::DataType::TLOG
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Base.html" title="Jylis::DataType::Base (class)">Base</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="Base.html" title="Jylis::DataType::Base (class)">Base</a></span></li>
78
+
79
+ <li class="next">Jylis::DataType::TLOG</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/jylis-rb/data_types/tlog.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>A timestamped log.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ <p class="tag_title">See Also:</p>
116
+ <ul class="see">
117
+
118
+ <li><a href="https://jemc.github.io/jylis/docs/types/tlog/" target="_parent" title="https://jemc.github.io/jylis/docs/types/tlog/">https://jemc.github.io/jylis/docs/types/tlog/</a></li>
119
+
120
+ </ul>
121
+
122
+ </div><h2>Defined Under Namespace</h2>
123
+ <p class="children">
124
+
125
+
126
+
127
+
128
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="TLOG/Result.html" title="Jylis::DataType::TLOG::Result (class)">Result</a></span>, <span class='object_link'><a href="TLOG/Row.html" title="Jylis::DataType::TLOG::Row (class)">Row</a></span>
129
+
130
+
131
+ </p>
132
+
133
+
134
+
135
+
136
+
137
+
138
+ <h2>Instance Attribute Summary</h2>
139
+
140
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="Jylis::DataType::Base (class)">Base</a></span></h3>
141
+ <p class="inherited"><span class='object_link'><a href="Base.html#connection-instance_method" title="Jylis::DataType::Base#connection (method)">#connection</a></span></p>
142
+
143
+
144
+
145
+ <h2>
146
+ Instance Method Summary
147
+ <small><a href="#" class="summary_toggle">collapse</a></small>
148
+ </h2>
149
+
150
+ <ul class="summary">
151
+
152
+ <li class="public ">
153
+ <span class="summary_signature">
154
+
155
+ <a href="#clr-instance_method" title="#clr (instance method)">#<strong>clr</strong>(key) &#x21d2; Object </a>
156
+
157
+
158
+
159
+ </span>
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+ <span class="summary_desc"><div class='inline'>
170
+ <p>Raise the cutoff timestamp to be the timestamp of the latest entry plus
171
+ one, such that all local entries in the log will be discarded due to having
172
+ timestamps earlier than the cutoff timestamp.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ <li class="public ">
179
+ <span class="summary_signature">
180
+
181
+ <a href="#cutoff-instance_method" title="#cutoff (instance method)">#<strong>cutoff</strong>(key) &#x21d2; Integer </a>
182
+
183
+
184
+
185
+ </span>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+ <span class="summary_desc"><div class='inline'>
196
+ <p>The current cutoff timestamp of the log at `key`.</p>
197
+ </div></span>
198
+
199
+ </li>
200
+
201
+
202
+ <li class="public ">
203
+ <span class="summary_signature">
204
+
205
+ <a href="#get-instance_method" title="#get (instance method)">#<strong>get</strong>(key, count = nil) &#x21d2; Jylis::DataType::TLOG::Result </a>
206
+
207
+
208
+
209
+ </span>
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+ <span class="summary_desc"><div class='inline'>
220
+ <p>Get the latest `value` and `timestamp` for the register at `key`.</p>
221
+ </div></span>
222
+
223
+ </li>
224
+
225
+
226
+ <li class="public ">
227
+ <span class="summary_signature">
228
+
229
+ <a href="#ins-instance_method" title="#ins (instance method)">#<strong>ins</strong>(key, value, timestamp) &#x21d2; Object </a>
230
+
231
+
232
+
233
+ </span>
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+ <span class="summary_desc"><div class='inline'>
244
+ <p>Insert a `value`/`timestamp` entry into the log at `key`.</p>
245
+ </div></span>
246
+
247
+ </li>
248
+
249
+
250
+ <li class="public ">
251
+ <span class="summary_signature">
252
+
253
+ <a href="#size-instance_method" title="#size (instance method)">#<strong>size</strong>(key) &#x21d2; Integer </a>
254
+
255
+
256
+
257
+ </span>
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+ <span class="summary_desc"><div class='inline'>
268
+ <p>The number of entries in the log at `key`.</p>
269
+ </div></span>
270
+
271
+ </li>
272
+
273
+
274
+ <li class="public ">
275
+ <span class="summary_signature">
276
+
277
+ <a href="#trim-instance_method" title="#trim (instance method)">#<strong>trim</strong>(key, count) &#x21d2; Object </a>
278
+
279
+
280
+
281
+ </span>
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+ <span class="summary_desc"><div class='inline'>
292
+ <p>Raise the cutoff timestamp of the log to retain at least `count` entries,
293
+ by setting the cutoff timestamp to the timestamp of the entry at index
294
+ `count - 1` in the log.</p>
295
+ </div></span>
296
+
297
+ </li>
298
+
299
+
300
+ <li class="public ">
301
+ <span class="summary_signature">
302
+
303
+ <a href="#trimat-instance_method" title="#trimat (instance method)">#<strong>trimat</strong>(key, timestamp) &#x21d2; Object </a>
304
+
305
+
306
+
307
+ </span>
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+ <span class="summary_desc"><div class='inline'>
318
+ <p>Raise the cutoff timestamp of the log, causing any entries to be discarded
319
+ whose timestamp is earlier than the newly given `timestamp`.</p>
320
+ </div></span>
321
+
322
+ </li>
323
+
324
+
325
+ </ul>
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Jylis::DataType::Base (class)">Base</a></span></h3>
338
+ <p class="inherited"><span class='object_link'><a href="Base.html#initialize-instance_method" title="Jylis::DataType::Base#initialize (method)">#initialize</a></span></p>
339
+ <div id="constructor_details" class="method_details_list">
340
+ <h2>Constructor Details</h2>
341
+
342
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="Base.html#initialize-instance_method" title="Jylis::DataType::Base#initialize (method)">Jylis::DataType::Base</a></span></p>
343
+
344
+ </div>
345
+
346
+
347
+ <div id="instance_method_details" class="method_details_list">
348
+ <h2>Instance Method Details</h2>
349
+
350
+
351
+ <div class="method_details first">
352
+ <h3 class="signature first" id="clr-instance_method">
353
+
354
+ #<strong>clr</strong>(key) &#x21d2; <tt>Object</tt>
355
+
356
+
357
+
358
+
359
+
360
+ </h3><div class="docstring">
361
+ <div class="discussion">
362
+
363
+ <p>Raise the cutoff timestamp to be the timestamp of the latest entry plus
364
+ one, such that all local entries in the log will be discarded due to having
365
+ timestamps earlier than the cutoff timestamp.</p>
366
+
367
+
368
+ </div>
369
+ </div>
370
+ <div class="tags">
371
+
372
+
373
+ </div><table class="source_code">
374
+ <tr>
375
+ <td>
376
+ <pre class="lines">
377
+
378
+
379
+ 148
380
+ 149
381
+ 150
382
+ 151
383
+ 152
384
+ 153
385
+ 154</pre>
386
+ </td>
387
+ <td>
388
+ <pre class="code"><span class="info file"># File 'lib/jylis-rb/data_types/tlog.rb', line 148</span>
389
+
390
+ <span class='kw'>def</span> <span class='id identifier rubyid_clr'>clr</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
391
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TLOG</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>CLR</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
392
+
393
+ <span class='kw'>unless</span> <span class='id identifier rubyid_result'>result</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>OK</span><span class='tstring_end'>&quot;</span></span>
394
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Failed: TLOG CLR </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
395
+ <span class='kw'>end</span>
396
+ <span class='kw'>end</span></pre>
397
+ </td>
398
+ </tr>
399
+ </table>
400
+ </div>
401
+
402
+ <div class="method_details ">
403
+ <h3 class="signature " id="cutoff-instance_method">
404
+
405
+ #<strong>cutoff</strong>(key) &#x21d2; <tt>Integer</tt>
406
+
407
+
408
+
409
+
410
+
411
+ </h3><div class="docstring">
412
+ <div class="discussion">
413
+
414
+ <p>Returns the current cutoff timestamp of the log at `key`</p>
415
+
416
+
417
+ </div>
418
+ </div>
419
+ <div class="tags">
420
+
421
+ <p class="tag_title">Returns:</p>
422
+ <ul class="return">
423
+
424
+ <li>
425
+
426
+
427
+ <span class='type'>(<tt>Integer</tt>)</span>
428
+
429
+
430
+
431
+ &mdash;
432
+ <div class='inline'>
433
+ <p>the current cutoff timestamp of the log at `key`</p>
434
+ </div>
435
+
436
+ </li>
437
+
438
+ </ul>
439
+
440
+ </div><table class="source_code">
441
+ <tr>
442
+ <td>
443
+ <pre class="lines">
444
+
445
+
446
+ 118
447
+ 119
448
+ 120</pre>
449
+ </td>
450
+ <td>
451
+ <pre class="code"><span class="info file"># File 'lib/jylis-rb/data_types/tlog.rb', line 118</span>
452
+
453
+ <span class='kw'>def</span> <span class='id identifier rubyid_cutoff'>cutoff</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
454
+ <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TLOG</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>CUTOFF</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
455
+ <span class='kw'>end</span></pre>
456
+ </td>
457
+ </tr>
458
+ </table>
459
+ </div>
460
+
461
+ <div class="method_details ">
462
+ <h3 class="signature " id="get-instance_method">
463
+
464
+ #<strong>get</strong>(key, count = nil) &#x21d2; <tt><span class='object_link'><a href="TLOG/Result.html" title="Jylis::DataType::TLOG::Result (class)">Jylis::DataType::TLOG::Result</a></span></tt>
465
+
466
+
467
+
468
+
469
+
470
+ </h3><div class="docstring">
471
+ <div class="discussion">
472
+
473
+ <p>Get the latest `value` and `timestamp` for the register at `key`.</p>
474
+
475
+
476
+ </div>
477
+ </div>
478
+ <div class="tags">
479
+
480
+ <p class="tag_title">Returns:</p>
481
+ <ul class="return">
482
+
483
+ <li>
484
+
485
+
486
+ <span class='type'>(<tt><span class='object_link'><a href="TLOG/Result.html" title="Jylis::DataType::TLOG::Result (class)">Jylis::DataType::TLOG::Result</a></span></tt>)</span>
487
+
488
+
489
+
490
+ </li>
491
+
492
+ </ul>
493
+
494
+ </div><table class="source_code">
495
+ <tr>
496
+ <td>
497
+ <pre class="lines">
498
+
499
+
500
+ 84
501
+ 85
502
+ 86
503
+ 87
504
+ 88
505
+ 89
506
+ 90
507
+ 91
508
+ 92</pre>
509
+ </td>
510
+ <td>
511
+ <pre class="code"><span class="info file"># File 'lib/jylis-rb/data_types/tlog.rb', line 84</span>
512
+
513
+ <span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_count'>count</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
514
+ <span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TLOG</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>GET</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
515
+
516
+ <span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_count'>count</span>
517
+
518
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
519
+
520
+ <span class='const'><span class='object_link'><a href="TLOG/Result.html" title="Jylis::DataType::TLOG::Result (class)">Result</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="TLOG/Result.html#parse-class_method" title="Jylis::DataType::TLOG::Result.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
521
+ <span class='kw'>end</span></pre>
522
+ </td>
523
+ </tr>
524
+ </table>
525
+ </div>
526
+
527
+ <div class="method_details ">
528
+ <h3 class="signature " id="ins-instance_method">
529
+
530
+ #<strong>ins</strong>(key, value, timestamp) &#x21d2; <tt>Object</tt>
531
+
532
+
533
+
534
+
535
+
536
+ </h3><div class="docstring">
537
+ <div class="discussion">
538
+
539
+ <p>Insert a `value`/`timestamp` entry into the log at `key`.</p>
540
+
541
+
542
+ </div>
543
+ </div>
544
+ <div class="tags">
545
+
546
+
547
+ </div><table class="source_code">
548
+ <tr>
549
+ <td>
550
+ <pre class="lines">
551
+
552
+
553
+ 104
554
+ 105
555
+ 106
556
+ 107
557
+ 108
558
+ 109
559
+ 110</pre>
560
+ </td>
561
+ <td>
562
+ <pre class="code"><span class="info file"># File 'lib/jylis-rb/data_types/tlog.rb', line 104</span>
563
+
564
+ <span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_timestamp'>timestamp</span><span class='rparen'>)</span>
565
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TLOG</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>INS</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_timestamp'>timestamp</span><span class='rparen'>)</span>
566
+
567
+ <span class='kw'>unless</span> <span class='id identifier rubyid_result'>result</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>OK</span><span class='tstring_end'>&quot;</span></span>
568
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Failed: TLOG INS </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_timestamp'>timestamp</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
569
+ <span class='kw'>end</span>
570
+ <span class='kw'>end</span></pre>
571
+ </td>
572
+ </tr>
573
+ </table>
574
+ </div>
575
+
576
+ <div class="method_details ">
577
+ <h3 class="signature " id="size-instance_method">
578
+
579
+ #<strong>size</strong>(key) &#x21d2; <tt>Integer</tt>
580
+
581
+
582
+
583
+
584
+
585
+ </h3><div class="docstring">
586
+ <div class="discussion">
587
+
588
+ <p>Returns the number of entries in the log at `key`</p>
589
+
590
+
591
+ </div>
592
+ </div>
593
+ <div class="tags">
594
+
595
+ <p class="tag_title">Returns:</p>
596
+ <ul class="return">
597
+
598
+ <li>
599
+
600
+
601
+ <span class='type'>(<tt>Integer</tt>)</span>
602
+
603
+
604
+
605
+ &mdash;
606
+ <div class='inline'>
607
+ <p>the number of entries in the log at `key`</p>
608
+ </div>
609
+
610
+ </li>
611
+
612
+ </ul>
613
+
614
+ </div><table class="source_code">
615
+ <tr>
616
+ <td>
617
+ <pre class="lines">
618
+
619
+
620
+ 113
621
+ 114
622
+ 115</pre>
623
+ </td>
624
+ <td>
625
+ <pre class="code"><span class="info file"># File 'lib/jylis-rb/data_types/tlog.rb', line 113</span>
626
+
627
+ <span class='kw'>def</span> <span class='id identifier rubyid_size'>size</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
628
+ <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TLOG</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>SIZE</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
629
+ <span class='kw'>end</span></pre>
630
+ </td>
631
+ </tr>
632
+ </table>
633
+ </div>
634
+
635
+ <div class="method_details ">
636
+ <h3 class="signature " id="trim-instance_method">
637
+
638
+ #<strong>trim</strong>(key, count) &#x21d2; <tt>Object</tt>
639
+
640
+
641
+
642
+
643
+
644
+ </h3><div class="docstring">
645
+ <div class="discussion">
646
+
647
+ <p>Raise the cutoff timestamp of the log to retain at least `count` entries,
648
+ by setting the cutoff timestamp to the timestamp of the entry at index
649
+ `count - 1` in the log. Any entries with an earlier timestamp than the
650
+ entry at that index will be discarded. If `count` is zero, this is the same
651
+ as calling #clr.</p>
652
+
653
+
654
+ </div>
655
+ </div>
656
+ <div class="tags">
657
+
658
+
659
+ </div><table class="source_code">
660
+ <tr>
661
+ <td>
662
+ <pre class="lines">
663
+
664
+
665
+ 137
666
+ 138
667
+ 139
668
+ 140
669
+ 141
670
+ 142
671
+ 143</pre>
672
+ </td>
673
+ <td>
674
+ <pre class="code"><span class="info file"># File 'lib/jylis-rb/data_types/tlog.rb', line 137</span>
675
+
676
+ <span class='kw'>def</span> <span class='id identifier rubyid_trim'>trim</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span>
677
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TLOG</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TRIM</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span>
678
+
679
+ <span class='kw'>unless</span> <span class='id identifier rubyid_result'>result</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>OK</span><span class='tstring_end'>&quot;</span></span>
680
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Failed: TLOG TRIM </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_count'>count</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
681
+ <span class='kw'>end</span>
682
+ <span class='kw'>end</span></pre>
683
+ </td>
684
+ </tr>
685
+ </table>
686
+ </div>
687
+
688
+ <div class="method_details ">
689
+ <h3 class="signature " id="trimat-instance_method">
690
+
691
+ #<strong>trimat</strong>(key, timestamp) &#x21d2; <tt>Object</tt>
692
+
693
+
694
+
695
+
696
+
697
+ </h3><div class="docstring">
698
+ <div class="discussion">
699
+
700
+ <p>Raise the cutoff timestamp of the log, causing any entries to be discarded
701
+ whose timestamp is earlier than the newly given `timestamp`.</p>
702
+
703
+
704
+ </div>
705
+ </div>
706
+ <div class="tags">
707
+
708
+
709
+ </div><table class="source_code">
710
+ <tr>
711
+ <td>
712
+ <pre class="lines">
713
+
714
+
715
+ 124
716
+ 125
717
+ 126
718
+ 127
719
+ 128
720
+ 129
721
+ 130</pre>
722
+ </td>
723
+ <td>
724
+ <pre class="code"><span class="info file"># File 'lib/jylis-rb/data_types/tlog.rb', line 124</span>
725
+
726
+ <span class='kw'>def</span> <span class='id identifier rubyid_trimat'>trimat</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_timestamp'>timestamp</span><span class='rparen'>)</span>
727
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TLOG</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TRIMAT</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_timestamp'>timestamp</span><span class='rparen'>)</span>
728
+
729
+ <span class='kw'>unless</span> <span class='id identifier rubyid_result'>result</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>OK</span><span class='tstring_end'>&quot;</span></span>
730
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Failed: TLOG TRIMAT </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_timestamp'>timestamp</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
731
+ <span class='kw'>end</span>
732
+ <span class='kw'>end</span></pre>
733
+ </td>
734
+ </tr>
735
+ </table>
736
+ </div>
737
+
738
+ </div>
739
+
740
+ </div>
741
+
742
+ <div id="footer">
743
+ Generated on Sun Jun 3 21:47:00 2018 by
744
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
745
+ 0.9.14 (ruby-2.5.1).
746
+ </div>
747
+
748
+ </div>
749
+ </body>
750
+ </html>