Class: Flydata::SourceMysql::PluginSupport::BinlogQueryDispatcher
- Inherits:
-
Object
- Object
- Flydata::SourceMysql::PluginSupport::BinlogQueryDispatcher
- Defined in:
- lib/flydata/source_mysql/plugin_support/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.
11 12 13 |
# File 'lib/flydata/source_mysql/plugin_support/binlog_query_dispatcher.rb', line 11 def initialize @handlers = [] end |
Instance Method Details
#dispatch(record) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/flydata/source_mysql/plugin_support/binlog_query_dispatcher.rb', line 15 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 |