Class: Maatkit::SlavePrefetch
- Inherits:
-
Object
- Object
- Maatkit::SlavePrefetch
- Defined in:
- lib/maatkit-ruby/mk-slave-prefetch.rb
Overview
Pipeline relay logs on a MySQL slave to pre-warm caches.
Maatkit::SlavePrefetch.new( array, str, array)
Instance Attribute Summary collapse
-
#ask_pass ⇒ Object
FALSE.
-
#charset ⇒ Object
(No # value).
-
#check_interval ⇒ Object
16,1,1024.
-
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_slave_prefetch.conf,/home/joel/.maatkit.conf,/home/joel/.mk_slave_prefetch.conf.
-
#continue_on_error ⇒ Object
TRUE.
-
#daemonize ⇒ Object
FALSE.
-
#database ⇒ Object
(No # value).
-
#defaults_file ⇒ Object
(No # value).
-
#dry_run ⇒ Object
FALSE.
-
#errors ⇒ Object
0.
-
#execute ⇒ Object
FALSE.
-
#help ⇒ Object
TRUE.
-
#host ⇒ Object
(No # value).
-
#inject_columns ⇒ Object
TRUE.
-
#io_lag ⇒ Object
1024.
-
#log ⇒ Object
(No # value).
-
#max_query_time ⇒ Object
1.
-
#num_prefix ⇒ Object
FALSE.
-
#offset ⇒ Object
128.
-
#password ⇒ Object
(No # value).
-
#path_to_mk_slave_prefetch ⇒ Object
Sets the executable path, otherwise the environment path will be used.
-
#permit_regexp ⇒ Object
(No # value).
-
#pid ⇒ Object
(No # value).
-
#port ⇒ Object
(No # value).
-
#print ⇒ Object
FALSE.
-
#print_nonrewritten ⇒ Object
FALSE.
-
#progress ⇒ Object
(No # value).
-
#query_sample_size ⇒ Object
4.
-
#reject_regexp ⇒ Object
(No # value).
-
#relay_log ⇒ Object
(No # value).
-
#relay_log_dir ⇒ Object
(No # value).
-
#run_time ⇒ Object
(No # value).
-
#secondary_indexes ⇒ Object
FALSE.
-
#sentinel ⇒ Object
/tmp/mk_slave_prefetch_sentinel.
-
#set_vars ⇒ Object
wait_timeout=10000.
-
#sleep ⇒ Object
1.
-
#socket ⇒ Object
(No # value).
-
#statistics ⇒ Object
FALSE.
-
#stop ⇒ Object
FALSE.
-
#threads ⇒ Object
2.
-
#tmpdir ⇒ Object
/dev/null.
-
#user ⇒ Object
(No # value).
-
#version ⇒ Object
FALSE.
-
#window ⇒ Object
4096.
Instance Method Summary collapse
-
#initialize ⇒ SlavePrefetch
constructor
Returns a new SlavePrefetch Object.
-
#start(options = nil) ⇒ Object
Execute the command.
Constructor Details
#initialize ⇒ SlavePrefetch
Returns a new SlavePrefetch Object
67 68 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 67 def initialize() end |
Instance Attribute Details
#ask_pass ⇒ Object
FALSE
15 16 17 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 15 def ask_pass @ask_pass end |
#charset ⇒ Object
(No # value)
16 17 18 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 16 def charset @charset end |
#check_interval ⇒ Object
16,1,1024
17 18 19 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 17 def check_interval @check_interval end |
#config ⇒ Object
/etc/maatkit/maatkit.conf,/etc/maatkit/mk_slave_prefetch.conf,/home/joel/.maatkit.conf,/home/joel/.mk_slave_prefetch.conf
18 19 20 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 18 def config @config end |
#continue_on_error ⇒ Object
TRUE
19 20 21 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 19 def continue_on_error @continue_on_error end |
#daemonize ⇒ Object
FALSE
20 21 22 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 20 def daemonize @daemonize end |
#database ⇒ Object
(No # value)
21 22 23 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 21 def database @database end |
#defaults_file ⇒ Object
(No # value)
22 23 24 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 22 def defaults_file @defaults_file end |
#dry_run ⇒ Object
FALSE
23 24 25 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 23 def dry_run @dry_run end |
#errors ⇒ Object
0
24 25 26 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 24 def errors @errors end |
#execute ⇒ Object
FALSE
25 26 27 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 25 def execute @execute end |
#help ⇒ Object
TRUE
26 27 28 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 26 def help @help end |
#host ⇒ Object
(No # value)
27 28 29 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 27 def host @host end |
#inject_columns ⇒ Object
TRUE
28 29 30 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 28 def inject_columns @inject_columns end |
#io_lag ⇒ Object
1024
29 30 31 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 29 def io_lag @io_lag end |
#log ⇒ Object
(No # value)
30 31 32 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 30 def log @log end |
#max_query_time ⇒ Object
1
31 32 33 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 31 def max_query_time @max_query_time end |
#num_prefix ⇒ Object
FALSE
32 33 34 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 32 def num_prefix @num_prefix end |
#offset ⇒ Object
128
33 34 35 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 33 def offset @offset end |
#password ⇒ Object
(No # value)
34 35 36 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 34 def password @password end |
#path_to_mk_slave_prefetch ⇒ Object
Sets the executable path, otherwise the environment path will be used.
62 63 64 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 62 def path_to_mk_slave_prefetch @path_to_mk_slave_prefetch end |
#permit_regexp ⇒ Object
(No # value)
35 36 37 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 35 def permit_regexp @permit_regexp end |
#pid ⇒ Object
(No # value)
36 37 38 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 36 def pid @pid end |
#port ⇒ Object
(No # value)
37 38 39 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 37 def port @port end |
#print ⇒ Object
FALSE
38 39 40 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 38 def print @print end |
#print_nonrewritten ⇒ Object
FALSE
39 40 41 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 39 def print_nonrewritten @print_nonrewritten end |
#progress ⇒ Object
(No # value)
40 41 42 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 40 def progress @progress end |
#query_sample_size ⇒ Object
4
41 42 43 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 41 def query_sample_size @query_sample_size end |
#reject_regexp ⇒ Object
(No # value)
42 43 44 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 42 def reject_regexp @reject_regexp end |
#relay_log ⇒ Object
(No # value)
43 44 45 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 43 def relay_log @relay_log end |
#relay_log_dir ⇒ Object
(No # value)
44 45 46 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 44 def relay_log_dir @relay_log_dir end |
#run_time ⇒ Object
(No # value)
45 46 47 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 45 def run_time @run_time end |
#secondary_indexes ⇒ Object
FALSE
46 47 48 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 46 def secondary_indexes @secondary_indexes end |
#sentinel ⇒ Object
/tmp/mk_slave_prefetch_sentinel
47 48 49 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 47 def sentinel @sentinel end |
#set_vars ⇒ Object
wait_timeout=10000
48 49 50 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 48 def set_vars @set_vars end |
#sleep ⇒ Object
1
49 50 51 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 49 def sleep @sleep end |
#socket ⇒ Object
(No # value)
50 51 52 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 50 def socket @socket end |
#statistics ⇒ Object
FALSE
51 52 53 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 51 def statistics @statistics end |
#stop ⇒ Object
FALSE
52 53 54 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 52 def stop @stop end |
#threads ⇒ Object
2
53 54 55 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 53 def threads @threads end |
#tmpdir ⇒ Object
/dev/null
54 55 56 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 54 def tmpdir @tmpdir end |
#user ⇒ Object
(No # value)
55 56 57 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 55 def user @user end |
#version ⇒ Object
FALSE
56 57 58 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 56 def version @version end |
#window ⇒ Object
4096
57 58 59 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 57 def window @window end |
Instance Method Details
#start(options = nil) ⇒ Object
Execute the command
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/maatkit-ruby/mk-slave-prefetch.rb', line 73 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 |