Class: Flydata::SourceMysql::PluginSupport::BinlogRecordDispatcher

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

Direct Known Subclasses

FlydataBinlogRecordDispatcher

Instance Method Summary collapse

Instance Method Details

#dispatch(event) ⇒ Object


11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/flydata/source_mysql/plugin_support/binlog_record_dispatcher.rb', line 11

def dispatch(event)
  method_name = "on_#{event.event_type.downcase}"
  if self.respond_to?(method_name)
    # TODO to_hash method call below can fail if event.event_type is
    # "Update_rows".  This seems to be a bug of ruby-binlog.  The bug must
    # be fixed when we support record update.
    record = Fluent::MysqlBinlogInput::BinlogUtil.to_hash(event)
    self.send(method_name, record)
  else
    # $log.trace "Unhandled type: #{record["event_type"]}"
  end
end