Sha256: eab3aa55ca83e4b340d46b195cefeca8a25b8828aea1b26e061dca54c60d1f2c

Contents?: true

Size: 952 Bytes

Versions: 19

Compression:

Stored size: 952 Bytes

Contents

require 'flydata/plugin_support/context'
require 'flydata-core/mysql/binlog_pos'

module Flydata
module SourceMysql
module PluginSupport

  class Context < ::Flydata::PluginSupport::Context
    register_mandatory_opts :database

    def initialize(opts)
      super
      set_table_binlog_pos
    end

    attr_reader :table_binlog_pos

    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

    def set_infinity_to_table_binlog_pos(table_name)
      new_src_pos = FlydataCore::Mysql::BinlogPos.infinity_src_pos
      sync_fm.save_table_source_pos(table_name, new_src_pos, destination: :positions)
      @table_binlog_pos[table_name] = new_src_pos
    end
  end

end
end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
flydata-0.8.10.2 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.10.1 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.9.11 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.10 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.9 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.8 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.7 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.6 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.5 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.4 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.3 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.2 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.1 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.8.0 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.7.19 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.7.18 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.7.17 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.7.16 lib/flydata/source_mysql/plugin_support/context.rb
flydata-0.7.15 lib/flydata/source_mysql/plugin_support/context.rb