mdbm_dist_support 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec_status +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +46 -21
- data/lib/mdbm_dist_support/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21076e79d83ad7a03a5039c335509dada5d31a6d
|
4
|
+
data.tar.gz: 37e1553b71ff538727d31710863c102fe7e6aa65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25d3ce4e0f7ca1d7b71d926f100806167351c5e926f54dd4287d38461bc42d93c039327993313236ebfb944a20a1c721f84ae68449498aba1044dff0e03a2b13
|
7
|
+
data.tar.gz: 4d2478659b15f95a094bde9dac555b451e664661e72da05f8097ecf9130ee6ee7934d9db9b7b55c95a0b46da35e618e08731509039133dc7925872b35c5de6e9
|
data/.rspec_status
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/mdbm_dist_support_spec.rb[1:1] | passed | 0.
|
3
|
+
./spec/mdbm_dist_support_spec.rb[1:1] | passed | 0.00098 seconds |
|
4
4
|
./spec/mdbm_dist_support_spec.rb[1:2] | passed | 0.00065 seconds |
|
5
|
-
./spec/mdbm_dist_support_spec.rb[1:3] | passed | 0.
|
6
|
-
./spec/mdbm_dist_support_spec.rb[1:4] | passed | 0.
|
7
|
-
./spec/mdbm_dist_support_spec.rb[1:5] | passed | 0.
|
5
|
+
./spec/mdbm_dist_support_spec.rb[1:3] | passed | 0.00031 seconds |
|
6
|
+
./spec/mdbm_dist_support_spec.rb[1:4] | passed | 0.00016 seconds |
|
7
|
+
./spec/mdbm_dist_support_spec.rb[1:5] | passed | 0.00022 seconds |
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,42 +1,63 @@
|
|
1
1
|
# mdbm_dist_support
|
2
|
-
mdbm distribution support gem
|
2
|
+
mdbm distribution support library gem
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/mdbm_dist_support.svg)](https://badge.fury.io/rb/mdbm_dist_support)
|
5
5
|
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
6
6
|
|
7
|
+
## Installation
|
8
|
+
`gem install mdbm-dist-support`
|
9
|
+
|
7
10
|
## Usage
|
11
|
+
This library only provide 2 of method.
|
12
|
+
* run_dist
|
13
|
+
* run_print_after
|
8
14
|
|
9
|
-
|
10
|
-
|
15
|
+
Use like this.
|
16
|
+
|
17
|
+
### Sample
|
18
|
+
#### update.rb
|
19
|
+
```ruby
|
11
20
|
#!/usr/bin/env ruby
|
12
21
|
|
13
22
|
require 'mdbm_dist_support'
|
14
23
|
|
15
24
|
MdbmDistSupport::Distributer.new do |m|
|
16
|
-
m.lock_path = '
|
17
|
-
m.meta_path = '
|
18
|
-
m.local_path = '
|
19
|
-
m.dist_path = '
|
20
|
-
m.cmd_print = 'print
|
21
|
-
m.cmd_gen = '
|
22
|
-
m.cmd_rep = '
|
23
|
-
m.full_mode = true
|
24
|
-
m.dist_server_hosts = ['
|
25
|
+
m.lock_path = '/tmp/hoge.lck'
|
26
|
+
m.meta_path = '/tmp/hoge_meta.mdbm'
|
27
|
+
m.local_path = '/tmp/hoge_local.mdbm'
|
28
|
+
m.dist_path = '/tmp/hoge_dist.mdbm'
|
29
|
+
m.cmd_print = '/tmp/print.rb'
|
30
|
+
m.cmd_gen = '/usr/local/bin/i64_str_gen'
|
31
|
+
m.cmd_rep = '/usr/local/bin/mdbm_replace'
|
32
|
+
m.full_mode = true
|
33
|
+
m.dist_server_hosts = ['localhost']
|
25
34
|
m.meta_incr_key = 'when_processed_fetched_max_date'
|
26
35
|
end.run_dist
|
27
36
|
```
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
|
37
|
+
#### required settings @run_dist
|
38
|
+
|name|value|memo|
|
39
|
+
|:-----------|:------------|:------------|
|
40
|
+
|lock_path|local lock file path||
|
41
|
+
|meta_path|local meta mdbm path||
|
42
|
+
|local_path|local mdbm path||
|
43
|
+
|dist_path|mdbm path in remote servers||
|
44
|
+
|cmd_print|print command path|you need to make this command|
|
45
|
+
|cmd_gen|generate mdbm command path|you need to make this command|
|
46
|
+
|cmd_rep|replace mdbm command path|[mdbm_replace](https://github.com/yahoo/mdbm/blob/master/gendoc/mdbm_replace.rst)|
|
47
|
+
|full_mode|_true_: always update / _false_: when meta_incr_key is changed, do dist||
|
48
|
+
|dist_server_hosts|distribute target server hosts array||
|
49
|
+
|meta_incr_key|meta mdbm key(using increment update)||
|
32
50
|
|
33
|
-
|
34
|
-
```
|
51
|
+
#### print.rb
|
52
|
+
```ruby
|
35
53
|
#!/usr/bin/env ruby
|
36
54
|
|
37
55
|
require 'mdbm_dist_support'
|
38
56
|
|
39
|
-
|
57
|
+
# fetch data and print STDOUT KEY:VALUE set
|
58
|
+
puts "1111111\tFUGAFUGA"
|
59
|
+
|
60
|
+
# fetch db max-date or max id
|
40
61
|
fetched_max_date = '2017-09-09 11:11:11'
|
41
62
|
|
42
63
|
# print after, update meta increment val.
|
@@ -45,10 +66,14 @@ MdbmDistSupport::Distributer.new do |m|
|
|
45
66
|
m.meta_incr_key = 'when_processed_fetched_max_date'
|
46
67
|
end.run_print_after(fetched_max_date)
|
47
68
|
```
|
69
|
+
#### required settings @run_print_after
|
70
|
+
|name|value|memo|
|
71
|
+
|:-----------|:------------|:------------|
|
72
|
+
|meta_path|local meta mdbm path||
|
73
|
+
|meta_incr_key|meta mdbm key (using increment update)||
|
48
74
|
|
49
75
|
## Requires
|
50
|
-
*
|
51
|
-
* ruby-mdbm
|
76
|
+
* [mdbm](https://github.com/yahoo/mdbm)
|
52
77
|
|
53
78
|
## Generate mdbm command module
|
54
79
|
* int64_str_mdbm
|