Class: Maatkit::Upgrade

Inherits:
Object
  • Object
show all
Defined in:
lib/maatkit-ruby/mk-upgrade.rb

Overview

Execute queries on multiple servers and check for differences.

Maatkit::Upgrade.new( array, str, array)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUpgrade

Returns a new Upgrade Object



61
62
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 61

def initialize()
end

Instance Attribute Details

#ask_passObject

FALSE



15
16
17
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 15

def ask_pass
  @ask_pass
end

#base_dirObject

/tmp



16
17
18
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 16

def base_dir
  @base_dir
end

#charsetObject

(No # value)



17
18
19
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 17

def charset
  @charset
end

#clear_warningsObject

TRUE



18
19
20
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 18

def clear_warnings
  @clear_warnings
end

#clear_warnings_tableObject

(No # value)



19
20
21
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 19

def clear_warnings_table
  @clear_warnings_table
end

#compareObject

query_times,results,warnings



20
21
22
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 20

def compare
  @compare
end

#compare_results_methodObject

CHECKSUM



21
22
23
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 21

def compare_results_method
  @compare_results_method
end

#configObject

/etc/maatkit/maatkit.conf,/etc/maatkit/mk_upgrade.conf,/home/joel/.maatkit.conf,/home/joel/.mk_upgrade.conf



22
23
24
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 22

def config
  @config
end

#continue_on_errorObject

FALSE



23
24
25
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 23

def continue_on_error
  @continue_on_error
end

#convert_to_selectObject

FALSE



24
25
26
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 24

def convert_to_select
  @convert_to_select
end

#daemonizeObject

FALSE



25
26
27
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 25

def daemonize
  @daemonize
end

#explain_hostsObject

FALSE



26
27
28
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 26

def explain_hosts
  @explain_hosts
end

#filterObject

(No # value)



27
28
29
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 27

def filter
  @filter
end

#fingerprintsObject

FALSE



28
29
30
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 28

def fingerprints
  @fingerprints
end

#float_precisionObject

(No # value)



29
30
31
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 29

def float_precision
  @float_precision
end

#helpObject

TRUE



30
31
32
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 30

def help
  @help
end

#hostObject

(No # value)



31
32
33
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 31

def host
  @host
end

#iterationsObject

1



32
33
34
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 32

def iterations
  @iterations
end

#limitObject

95%:20



33
34
35
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 33

def limit
  @limit
end

#logObject

(No # value)



34
35
36
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 34

def log
  @log
end

#max_different_rowsObject

10



35
36
37
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 35

def max_different_rows
  @max_different_rows
end

#order_byObject

differences:sum



36
37
38
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 36

def order_by
  @order_by
end

#passwordObject

(No # value)



37
38
39
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 37

def password
  @password
end

#path_to_mk_upgradeObject

Sets the executable path, otherwise the environment path will be used.



56
57
58
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 56

def path_to_mk_upgrade
  @path_to_mk_upgrade
end

#pidObject

(No # value)



38
39
40
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 38

def pid
  @pid
end

#portObject

(No # value)



39
40
41
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 39

def port
  @port
end

#queryObject

(No # value)



40
41
42
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 40

def query
  @query
end

#reportObject

TRUE



41
42
43
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 41

def report
  @report
end

#reportsObject

differences,errors,queries,statistics



42
43
44
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 42

def reports
  @reports
end

#run_timeObject

(No # value)



43
44
45
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 43

def run_time
  @run_time
end

#set_varsObject

wait_timeout=10000,query_cache_type=0



44
45
46
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 44

def set_vars
  @set_vars
end

#shortenObject

1024



45
46
47
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 45

def shorten
  @shorten
end

#socketObject

(No # value)



46
47
48
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 46

def socket
  @socket
end

#temp_databaseObject

(No # value)



47
48
49
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 47

def temp_database
  @temp_database
end

#temp_tableObject

mk_upgrade



48
49
50
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 48

def temp_table
  @temp_table
end

#userObject

(No # value)



49
50
51
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 49

def user
  @user
end

#versionObject

FALSE



50
51
52
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 50

def version
  @version
end

#zero_query_timesObject

FALSE



51
52
53
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 51

def zero_query_times
  @zero_query_times
end

Instance Method Details

#start(options = nil) ⇒ Object

Execute the command



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/maatkit-ruby/mk-upgrade.rb', line 67

def start(options = nil)
  tmp = Tempfile.new('tmp')
  command = option_string() + options.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