Class: Flydata::SourceMysql::PluginSupport::FlydataBinlogRecordDispatcher

Inherits:
BinlogRecordDispatcher show all
Defined in:
lib/flydata/source_mysql/plugin_support/binlog_record_dispatcher.rb

Instance Method Summary collapse

Methods inherited from BinlogRecordDispatcher

#dispatch

Constructor Details

#initialize(context) ⇒ FlydataBinlogRecordDispatcher

Returns a new instance of FlydataBinlogRecordDispatcher.



26
27
28
29
30
31
# File 'lib/flydata/source_mysql/plugin_support/binlog_record_dispatcher.rb', line 26

def initialize(context)
  context.cur_src_pos_file = ""
  @context = context
  @query_dispatcher = FlydataBinlogQueryDispatcher.new(context)
  @dml_record_handler = DmlRecordHandler.new(context)
end

Instance Method Details

#on_delete_rows(record) ⇒ Object



45
46
47
# File 'lib/flydata/source_mysql/plugin_support/binlog_record_dispatcher.rb', line 45

def on_delete_rows(record)
  @dml_record_handler.process(record, :delete_rows)
end

#on_query(record) ⇒ Object



49
50
51
# File 'lib/flydata/source_mysql/plugin_support/binlog_record_dispatcher.rb', line 49

def on_query(record)
  @query_dispatcher.dispatch(record)
end

#on_rotate(record) ⇒ Object



33
34
35
# File 'lib/flydata/source_mysql/plugin_support/binlog_record_dispatcher.rb', line 33

def on_rotate(record)
  @context.cur_src_pos_file = record["binlog_file"]
end

#on_update_rows(record) ⇒ Object



41
42
43
# File 'lib/flydata/source_mysql/plugin_support/binlog_record_dispatcher.rb', line 41

def on_update_rows(record)
  @dml_record_handler.process(record, :update_rows)
end

#on_write_rows(record) ⇒ Object



37
38
39
# File 'lib/flydata/source_mysql/plugin_support/binlog_record_dispatcher.rb', line 37

def on_write_rows(record)
  @dml_record_handler.process(record, :write_rows)
end