Class: Flydata::SourceMysql::PluginSupport::Context

Inherits:
PluginSupport::Context show all
Defined in:
lib/flydata/source_mysql/plugin_support/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PluginSupport::Context

mandatory_opts, optional_opts, register_mandatory_opts, register_optional_opts, #source_pos_class

Constructor Details

#initialize(opts) ⇒ Context

Returns a new instance of Context.



11
12
13
14
# File 'lib/flydata/source_mysql/plugin_support/context.rb', line 11

def initialize(opts)
  super
  set_table_binlog_pos
end

Instance Attribute Details

#table_binlog_posObject (readonly)

Returns the value of attribute table_binlog_pos.



16
17
18
# File 'lib/flydata/source_mysql/plugin_support/context.rb', line 16

def table_binlog_pos
  @table_binlog_pos
end

Instance Method Details

#set_table_binlog_posObject



18
19
20
21
22
23
24
25
26
# File 'lib/flydata/source_mysql/plugin_support/context.rb', line 18

def set_table_binlog_pos
  @table_binlog_pos = {}
  tables.each do |table_name|
    table_binlog_pos_str = sync_fm.get_table_source_raw_pos(table_name)
    if table_binlog_pos_str
      @table_binlog_pos[table_name] = ::FlydataCore::Mysql::BinlogPos.load(table_binlog_pos_str)
    end
  end
end