Class: Mysql::FlydataJsonHandlerFactory

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

Defined Under Namespace

Classes: DatabaseFlydataJsonHandler, FlydataJsonHandler, TableFlydataJsonHandler

Class Method Summary collapse

Class Method Details

.create(records, record, context, type, increment_table_rev) ⇒ Object



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/flydata/fluent-plugins/mysql/binlog_record_handler.rb', line 82

def self.create(records, record, context, type, increment_table_rev)
  table = records.first[:table_name] || record['table_name']
  database = records.first[:db_name] || record['db_name']

  case table
  when nil
    DatabaseFlydataJsonHandler.new(records, record, context, type)
  else
    TableFlydataJsonHandler.new(records, record, context, type, increment_table_rev)
  end
end