Class: Fluent::MysqlBinlogRecordHandler

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

Direct Known Subclasses

FlydataMysqlBinlogRecordHandler

Instance Method Summary collapse

Instance Method Details

#dispatch(event) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb', line 60

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 = MysqlBinlogInput::BinlogUtil.to_hash(event)
    self.send(method_name, record)
  else
    # $log.trace "Unhandled type: #{record["event_type"]}"
  end
end