Class: Fluent::BinLogPosition
- Inherits:
-
Object
- Object
- Fluent::BinLogPosition
- Includes:
- Comparable
- Defined in:
- lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#pos ⇒ Object
Returns the value of attribute pos.
Instance Method Summary collapse
- #<=>(obj) ⇒ Object
-
#initialize(binlog_content) ⇒ BinLogPosition
constructor
A new instance of BinLogPosition.
- #to_s ⇒ Object
Constructor Details
#initialize(binlog_content) ⇒ BinLogPosition
Returns a new instance of BinLogPosition.
169 170 171 172 173 |
# File 'lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb', line 169 def initialize(binlog_content) items = binlog_content.split("\t") @file = items[0] @pos = items[1].to_i end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
167 168 169 |
# File 'lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb', line 167 def file @file end |
#pos ⇒ Object
Returns the value of attribute pos.
167 168 169 |
# File 'lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb', line 167 def pos @pos end |
Instance Method Details
#<=>(obj) ⇒ Object
175 176 177 |
# File 'lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb', line 175 def <=>(obj) (self.file <=> obj.file) == 0 ? (self.pos <=> obj.pos) : (self.file <=> obj.file) end |
#to_s ⇒ Object
179 180 181 |
# File 'lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb', line 179 def to_s "#{file}\t#{pos}" end |