Class: Mysql::BinlogQueryDispatcher
- Inherits:
-
Object
- Object
- Mysql::BinlogQueryDispatcher
- Defined in:
- lib/flydata/fluent-plugins/mysql/binlog_query_dispatcher.rb
Direct Known Subclasses
Instance Method Summary collapse
- #dispatch(record) ⇒ Object
-
#initialize ⇒ BinlogQueryDispatcher
constructor
A new instance of BinlogQueryDispatcher.
Constructor Details
#initialize ⇒ BinlogQueryDispatcher
Returns a new instance of BinlogQueryDispatcher.
7 8 9 |
# File 'lib/flydata/fluent-plugins/mysql/binlog_query_dispatcher.rb', line 7 def initialize @handlers = [] end |
Instance Method Details
#dispatch(record) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/flydata/fluent-plugins/mysql/binlog_query_dispatcher.rb', line 11 def dispatch(record) normalize_query(record["query"]) do |query| @handlers.each do |handler| if (handler.pattern.match(query)) handler.process(record.merge({"normalized_query" => query})) break end end end end |