Class: Fluent::MysqlBinlogQueryHandler
- Inherits:
-
Object
- Object
- Fluent::MysqlBinlogQueryHandler
- Defined in:
- lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb
Direct Known Subclasses
Instance Method Summary collapse
- #dispatch(record) ⇒ Object
-
#initialize ⇒ MysqlBinlogQueryHandler
constructor
A new instance of MysqlBinlogQueryHandler.
Constructor Details
#initialize ⇒ MysqlBinlogQueryHandler
Returns a new instance of MysqlBinlogQueryHandler.
195 196 197 |
# File 'lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb', line 195 def initialize @mapping_table = [] end |
Instance Method Details
#dispatch(record) ⇒ Object
199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb', line 199 def dispatch(record) @mapping_table.each do |pattern, method_name| query = normalize_query(record["query"]) if (pattern.match(query)) if (self.respond_to?(method_name)) self.send(method_name, record, query) else raise "method '#{method_name}' is not defined in #{self.class.name} although its matching pattern is defined" end break end end end |