mdbm_dist_support 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28f1ce1c3e0857dfc6da0b4b93311bc1be532c2b
4
- data.tar.gz: 8b554fa7943def68d1e927235efe485c8f4106bb
3
+ metadata.gz: 21076e79d83ad7a03a5039c335509dada5d31a6d
4
+ data.tar.gz: 37e1553b71ff538727d31710863c102fe7e6aa65
5
5
  SHA512:
6
- metadata.gz: 8f96bdae3ec6f3015c3239d057f7abe3139ac4fa6cf6a40394d23743d73c0b9f8c1ca10e2d5a6ffbcd989136fb1f17df894cf1b5aee565c007a5aa98e1dff10a
7
- data.tar.gz: 81d2037c1009a2077e5a603aba36f7056fbdf2f0b481cca647afef5f524dd49ba0db84a15df9649c34a2831b57cff0311ef7fdd404ca71cae0ab3ff663663814
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.00093 seconds |
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.00039 seconds |
6
- ./spec/mdbm_dist_support_spec.rb[1:4] | passed | 0.00012 seconds |
7
- ./spec/mdbm_dist_support_spec.rb[1:5] | passed | 0.00023 seconds |
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mdbm_dist_support (0.2.0)
4
+ mdbm_dist_support (0.2.1)
5
5
  ruby-mdbm (>= 0.0.2)
6
6
 
7
7
  GEM
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
- ### update.rb
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 = 'lock file path'
17
- m.meta_path = 'local meta mdbm file path'
18
- m.local_path = 'local mdbm file path'
19
- m.dist_path = 'distribution mdbm file path'
20
- m.cmd_print = 'print command path ( command to print Key Value seperated TAB to STDOUT )'
21
- m.cmd_gen = 'generate mdbm command path'
22
- m.cmd_rep = 'replace mdbm command path'
23
- m.full_mode = true/false
24
- m.dist_server_hosts = ['distribution target server hosts array']
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
- |parameter_name|value|
29
- |:-----------|:------------|
30
- |cmd_gen|_i64_str_gen_ / _i32_str_gen_ / _i32_i64_gen_ / _i32_i32_gen_ etc|
31
- |cmd_rep|_/usr/local/bin/mdbm_replace_|
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
- ### print.rb
34
- ```
51
+ #### print.rb
52
+ ```ruby
35
53
  #!/usr/bin/env ruby
36
54
 
37
55
  require 'mdbm_dist_support'
38
56
 
39
- puts "hoge\tfuga"
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
- * ruby
51
- * ruby-mdbm
76
+ * [mdbm](https://github.com/yahoo/mdbm)
52
77
 
53
78
  ## Generate mdbm command module
54
79
  * int64_str_mdbm
@@ -1,3 +1,3 @@
1
1
  module MdbmDistSupport
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdbm_dist_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - MichinaoShimizu