Class: MdbmDistSupport::Distributer
- Inherits:
-
Object
- Object
- MdbmDistSupport::Distributer
- Includes:
- CustomLogger
- Defined in:
- lib/mdbm_dist_support/distributer.rb
Overview
Mdbm distributer
Constant Summary collapse
- INCR_KEY =
'meta_mdbm_increment_key'.freeze
Instance Attribute Summary collapse
-
#cmd_gen ⇒ Object
Returns the value of attribute cmd_gen.
-
#cmd_print ⇒ Object
Returns the value of attribute cmd_print.
-
#cmd_rep ⇒ Object
Returns the value of attribute cmd_rep.
-
#dist_path ⇒ Object
Returns the value of attribute dist_path.
-
#dist_servers ⇒ Object
Returns the value of attribute dist_servers.
-
#full_mode ⇒ Object
Returns the value of attribute full_mode.
-
#local_path ⇒ Object
Returns the value of attribute local_path.
-
#lock_path ⇒ Object
Returns the value of attribute lock_path.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#meta_path ⇒ Object
Returns the value of attribute meta_path.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Distributer
constructor
A new instance of Distributer.
- #run_dist ⇒ Object
- #run_print_after(meta_val) ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Distributer
Returns a new instance of Distributer.
19 20 21 22 |
# File 'lib/mdbm_dist_support/distributer.rb', line 19 def initialize yield self if block_given? @meta = MdbmDistSupport::Meta.new(@meta_path) end |
Instance Attribute Details
#cmd_gen ⇒ Object
Returns the value of attribute cmd_gen.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def cmd_gen @cmd_gen end |
#cmd_print ⇒ Object
Returns the value of attribute cmd_print.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def cmd_print @cmd_print end |
#cmd_rep ⇒ Object
Returns the value of attribute cmd_rep.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def cmd_rep @cmd_rep end |
#dist_path ⇒ Object
Returns the value of attribute dist_path.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def dist_path @dist_path end |
#dist_servers ⇒ Object
Returns the value of attribute dist_servers.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def dist_servers @dist_servers end |
#full_mode ⇒ Object
Returns the value of attribute full_mode.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def full_mode @full_mode end |
#local_path ⇒ Object
Returns the value of attribute local_path.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def local_path @local_path end |
#lock_path ⇒ Object
Returns the value of attribute lock_path.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def lock_path @lock_path end |
#meta ⇒ Object
Returns the value of attribute meta.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def @meta end |
#meta_path ⇒ Object
Returns the value of attribute meta_path.
13 14 15 |
# File 'lib/mdbm_dist_support/distributer.rb', line 13 def @meta_path end |
Instance Method Details
#run_dist ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/mdbm_dist_support/distributer.rb', line 24 def run_dist unless MdbmDistSupport::Validator.valid_run_dist_settings?(instance_variables) raise 'invalid settings' end unless MdbmDistSupport::Lock.new(@lock_path).try_lock raise 'could not get lock' end dist if local_up @@logger.info "#{__method__} complete" end |
#run_print_after(meta_val) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/mdbm_dist_support/distributer.rb', line 35 def run_print_after() unless MdbmDistSupport::Validator.valid_run_print_after_settings?(instance_variables) raise 'invalid settings' end @meta.store(INCR_KEY, ) end |