Class: Maatkit::SlaveMove
- Inherits:
-
Object
- Object
- Maatkit::SlaveMove
- Defined in:
- lib/maatkit-ruby/mk-slave-move.rb
Overview
Move a MySQL slave around in the replication hierarchy.
Maatkit::SlaveMove.new( array, str, array)
Instance Attribute Summary collapse
-
#ask_pass ⇒ Object
FALSE.
-
#charset ⇒ Object
(No # value).
-
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_slave_move.conf,/home/joel/.maatkit.conf,/home/joel/.mk_slave_move.conf.
-
#defaults_file ⇒ Object
(No # value).
-
#detach ⇒ Object
FALSE.
-
#help ⇒ Object
TRUE.
-
#host ⇒ Object
(No # value).
-
#password ⇒ Object
(No # value).
-
#path_to_mk_slave_move ⇒ Object
Sets the executable path, otherwise the environment path will be used.
-
#pid ⇒ Object
(No # value).
-
#port ⇒ Object
(No # value).
-
#set_vars ⇒ Object
wait_timeout=10000.
-
#sibling_of_master ⇒ Object
FALSE.
-
#slave_of_sibling ⇒ Object
FALSE.
-
#slave_of_uncle ⇒ Object
FALSE.
-
#socket ⇒ Object
(No # value).
-
#timeout ⇒ Object
600.
-
#user ⇒ Object
(No # value).
-
#version ⇒ Object
FALSE.
Instance Method Summary collapse
-
#initialize ⇒ SlaveMove
constructor
Returns a new SlaveMove Object.
-
#start(options = nil) ⇒ Object
Execute the command.
Constructor Details
#initialize ⇒ SlaveMove
Returns a new SlaveMove Object
42 43 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 42 def initialize() end |
Instance Attribute Details
#ask_pass ⇒ Object
FALSE
15 16 17 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 15 def ask_pass @ask_pass end |
#charset ⇒ Object
(No # value)
16 17 18 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 16 def charset @charset end |
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_slave_move.conf,/home/joel/.maatkit.conf,/home/joel/.mk_slave_move.conf
17 18 19 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 17 def config @config end |
#defaults_file ⇒ Object
(No # value)
18 19 20 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 18 def defaults_file @defaults_file end |
#detach ⇒ Object
FALSE
19 20 21 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 19 def detach @detach end |
#help ⇒ Object
TRUE
20 21 22 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 20 def help @help end |
#host ⇒ Object
(No # value)
21 22 23 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 21 def host @host end |
#password ⇒ Object
(No # value)
22 23 24 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 22 def password @password end |
#path_to_mk_slave_move ⇒ Object
Sets the executable path, otherwise the environment path will be used.
37 38 39 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 37 def path_to_mk_slave_move @path_to_mk_slave_move end |
#pid ⇒ Object
(No # value)
23 24 25 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 23 def pid @pid end |
#port ⇒ Object
(No # value)
24 25 26 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 24 def port @port end |
#set_vars ⇒ Object
wait_timeout=10000
25 26 27 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 25 def set_vars @set_vars end |
#sibling_of_master ⇒ Object
FALSE
26 27 28 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 26 def sibling_of_master @sibling_of_master end |
#slave_of_sibling ⇒ Object
FALSE
27 28 29 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 27 def slave_of_sibling @slave_of_sibling end |
#slave_of_uncle ⇒ Object
FALSE
28 29 30 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 28 def slave_of_uncle @slave_of_uncle end |
#socket ⇒ Object
(No # value)
29 30 31 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 29 def socket @socket end |
#timeout ⇒ Object
600
30 31 32 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 30 def timeout @timeout end |
#user ⇒ Object
(No # value)
31 32 33 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 31 def user @user end |
#version ⇒ Object
FALSE
32 33 34 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 32 def version @version end |
Instance Method Details
#start(options = nil) ⇒ Object
Execute the command
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/maatkit-ruby/mk-slave-move.rb', line 48 def start( = nil) tmp = Tempfile.new('tmp') command = option_string() + .to_s + " 2> " + tmp.path success = system(command) if success begin while (line = tmp.readline) line.chomp selected_string = line end rescue EOFError tmp.close end return selected_string else tmp.close! return success end end |