Class: Flydata::Command::Mysql

Inherits:
Sync
  • Object
show all
Defined in:
lib/flydata/command/mysql.rb

Constant Summary

Constants inherited from Sync

Sync::INSERT_PROGRESS_INTERVAL, 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 inherited from Sync

#check, #repair, 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

#fix_binlogposObject



34
# File 'lib/flydata/command/mysql.rb', line 34

def fix_binlogpos; end

#flushObject



30
# File 'lib/flydata/command/mysql.rb', line 30

def flush; end

#generate_table_ddlObject



33
# File 'lib/flydata/command/mysql.rb', line 33

def generate_table_ddl; end

#resetObject



31
# File 'lib/flydata/command/mysql.rb', line 31

def reset; end

#runObject



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

def run
  de = retrieve_sync_data_entry
  de['mysql_data_entry_preference'].delete('tables')
  cmd = FlydataCore::Mysql::CommandGenerator::generate_mysql_cmd(de['mysql_data_entry_preference'])
  if $stdin.tty?
    # interactive shell
    system cmd
  else
    # execute queries given to $stdin
    Open3.popen2e(cmd) do |i, o, wt|
      $stdin.each_line do |line|
        i.print line
      end
      i.close
      while line = o.gets
        print line
      end
    end
  end
end

#skipObject



32
# File 'lib/flydata/command/mysql.rb', line 32

def skip; end