Class: Flydata::SourceMysql::PluginSupport::DmlRecordHandler

Inherits:
BinlogRecordHandler show all
Defined in:
lib/flydata/source_mysql/plugin_support/dml_record_handler.rb

Constant Summary collapse

ROW =
:row
OLD =
:old
INTEGER_TYPES =
{'TINY' => 1,
                 'SHORT' => 2,
                 'INT24' => 3,
                 'LONG' => 4,
                 'LONGLONG' => 8
}
SIGNLESS_INTEGER_PREFIX =
'0SL'

Constants included from PluginSupport::SyncRecordEmittable

PluginSupport::SyncRecordEmittable::RESPECT_ORDER, PluginSupport::SyncRecordEmittable::SEQ, PluginSupport::SyncRecordEmittable::SRC_POS, PluginSupport::SyncRecordEmittable::TABLE_NAME, PluginSupport::SyncRecordEmittable::TABLE_REV, PluginSupport::SyncRecordEmittable::TYPE, PluginSupport::SyncRecordEmittable::V

Instance Attribute Summary

Attributes included from PluginSupport::SyncRecordEmittable

#context

Instance Method Summary collapse

Methods inherited from BinlogRecordHandler

#initialize

Methods included from PluginSupport::SyncRecordEmittable

#emit_sync_records

Constructor Details

This class inherits a constructor from Flydata::SourceMysql::PluginSupport::BinlogRecordHandler

Instance Method Details

#process(record, type) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/flydata/source_mysql/plugin_support/dml_record_handler.rb', line 18

def process(record, type)
  case type
  when :write_rows
    emit_insert(record)
  when :delete_rows
    emit_delete(record)
  when :update_rows
    emit_update(record)
  else
    raise "Invalid type:#{type}"
  end
end