Class: Mysql::BinlogQueryDispatcher

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

Direct Known Subclasses

FlydataBinlogQueryDispatcher

Instance Method Summary collapse

Constructor Details

#initializeBinlogQueryDispatcher

Returns a new instance of BinlogQueryDispatcher.



5
6
7
# File 'lib/flydata/fluent-plugins/mysql/binlog_query_dispatcher.rb', line 5

def initialize
  @handlers = []
end

Instance Method Details

#dispatch(record) ⇒ Object



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

def dispatch(record)
  @handlers.each do |handler|
    query = normalize_query(record["query"])
    if (handler.pattern.match(query))
      handler.process(record, query)
      break
    end
  end
end