Class: Mysql::BinlogRecordDispatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/flydata/fluent-plugins/mysql/binlog_record_dispatcher.rb

Direct Known Subclasses

FlydataBinlogRecordDispatcher

Instance Method Summary collapse

Instance Method Details

#dispatch(event) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/flydata/fluent-plugins/mysql/binlog_record_dispatcher.rb', line 8

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