Class: Flydata::Command::Mysqlbinlog

Inherits:
Sync
  • Object
show all
Includes:
MysqlCommandBase
Defined in:
lib/flydata/command/mysqlbinlog.rb

Constant Summary

Constants inherited from Sync

Sync::INSERT_PROGRESS_INTERVAL, Sync::RUN_PROFILE, Sync::SERVER_DATA_PROCESSING_TIMEOUT, Sync::STATUS_COMPLETE, Sync::STATUS_PARSED, Sync::STATUS_PARSING

Constants included from Helpers

Helpers::UNIT_PREFIX

Instance Attribute Summary

Attributes inherited from Sync

#ddl_tables, #full_initial_sync, #full_tables, #input_tables, #new_tables

Attributes inherited from Base

#opts

Instance Method Summary collapse

Methods included from MysqlCommandBase

#fix_binlogpos, #flush, #generate_table_ddl, #reset, #run, #skip

Methods inherited from Sync

#check, #fix_binlogpos, #flush, #generate_table_ddl, #repair, #reset, #run, #skip, slop, slop_fix_binlogpos, slop_flush, slop_generate_table_ddl, slop_repair, slop_reset, #try_mysql_sync

Methods included from Helpers

as_size, development?, env_mode, env_suffix, flydata_api_host_file, flydata_conf_file, flydata_version, format_menu_list, retry_on, to_command_class, usage_text

Methods inherited from Base

#ask_input_table_name, #ask_yes_no, #choose_one, #data_entry, #flydata, #initialize, #newline, #register_crontab, #retrieve_data_entries, #separator, #show_purpose_name

Methods included from ExclusiveRunnable

included

Methods included from Flydata::CommandLoggable

#before_logging, #log_error_stderr, #log_info_stdout, #log_warn_stderr

Constructor Details

This class inherits a constructor from Flydata::Command::Base

Instance Method Details

#generate_command(dbconf, args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/flydata/command/mysqlbinlog.rb', line 9

def generate_command(dbconf, args)
  dbconf.delete('tables')
  dbconf[:custom_option_end] = args.join(' ')
  dbconf[:command] = 'mysqlbinlog'
  # --default-character-set=utf8 is not supported
  dbconf[:no_default_option] = true
  # ssl is not supported for mysql5.6 or older mysqlbinlog command
  dbconf.delete('ssl_ca')
  dbconf.delete('ssl_cipher')
  dbconf.delete('database')
  if args.empty?
    puts <<EOT
example:
1. Dump raw binlog
  flydata mysqlbinlog --raw --read-from-remote-server --result-file "binlog-" mysql-bin-changelog.xxxx
2. Dump decoded binlog data
  flydata mysqlbinlog  -vv --base64-output=decode-row --hexdump --read-from-remote-server --start-position=4 --stop-position=yyyyy mysql-bin-changelog.xxxxx > mysql-bin-changelog.xxxxx
EOT
    return
  end
  FlydataCore::Mysql::CommandGenerator::generate_mysql_cmd(dbconf)
end