Class: MysqlReplicationHelper::Agent::Master

Inherits:
MysqlReplicationHelper::Agent show all
Defined in:
lib/mysql_replication_helper/agent/master.rb

Constant Summary

Constants inherited from MysqlReplicationHelper::Agent

DEFAULT_OPTIONS

Instance Method Summary collapse

Methods inherited from MysqlReplicationHelper::Agent

#connection, #execute, #initialize, #query, #with_default_options

Constructor Details

This class inherits a constructor from MysqlReplicationHelper::Agent

Instance Method Details

#master_statusObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/mysql_replication_helper/agent/master.rb', line 8

def master_status
  row = query("SHOW MASTER STATUS").fetch_row
  
  return unless (row)
  
  {
    :master_log_file => row[0],
    :master_log_position => row[1].to_i
  }
end

#poll!Object



4
5
6
# File 'lib/mysql_replication_helper/agent/master.rb', line 4

def poll!
  # Nothing yet
end

#socket_nameObject



23
24
25
# File 'lib/mysql_replication_helper/agent/master.rb', line 23

def socket_name
  @options[:master_socket] or super
end

#user_nameObject



19
20
21
# File 'lib/mysql_replication_helper/agent/master.rb', line 19

def user_name
  @options[:master_user] or super
end