Class: Flydata::Mysql::QueryEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/flydata/mysql/table_ddl.rb

Overview

mimics RubyBinlog::QueryEvent

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type, database_name, event_table_name, next_position, event_length, query, timestamp) ⇒ QueryEvent

Returns a new instance of QueryEvent.



97
98
99
100
101
102
103
104
105
106
# File 'lib/flydata/mysql/table_ddl.rb', line 97

def initialize(event_type, database_name, event_table_name, next_position,
               event_length, query, timestamp)
  @event_type = event_type
  @database_name = database_name
  @event_table_name = event_table_name
  @next_position = next_position
  @event_length = event_length
  @query = query
  @timestamp = timestamp
end

Instance Attribute Details

#database_nameObject (readonly)

Returns the value of attribute database_name.



107
108
109
# File 'lib/flydata/mysql/table_ddl.rb', line 107

def database_name
  @database_name
end

#event_lengthObject (readonly)

Returns the value of attribute event_length.



107
108
109
# File 'lib/flydata/mysql/table_ddl.rb', line 107

def event_length
  @event_length
end

#event_table_nameObject (readonly)

Returns the value of attribute event_table_name.



107
108
109
# File 'lib/flydata/mysql/table_ddl.rb', line 107

def event_table_name
  @event_table_name
end

#event_typeObject (readonly)

Returns the value of attribute event_type.



107
108
109
# File 'lib/flydata/mysql/table_ddl.rb', line 107

def event_type
  @event_type
end

#next_positionObject (readonly)

Returns the value of attribute next_position.



107
108
109
# File 'lib/flydata/mysql/table_ddl.rb', line 107

def next_position
  @next_position
end

#queryObject (readonly)

Returns the value of attribute query.



107
108
109
# File 'lib/flydata/mysql/table_ddl.rb', line 107

def query
  @query
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



107
108
109
# File 'lib/flydata/mysql/table_ddl.rb', line 107

def timestamp
  @timestamp
end

Instance Method Details

#to_sObject



110
111
112
113
114
# File 'lib/flydata/mysql/table_ddl.rb', line 110

def to_s
  <<EOS
event_type;#{event_type} database_name:#{database_name} event_table_name:#{event_table_name} next_position:#{next_position} event_length:#{event_length} timestamp:#{timestamp} query:#{query}
EOS
end