Class: Bricolage::StreamingLoad::FlushTableEvent

Inherits:
Event show all
Defined in:
lib/bricolage/streamingload/event.rb

Constant Summary

Constants inherited from Bricolage::SQSMessage

Bricolage::SQSMessage::SQS_EVENT_SOURCE

Instance Attribute Summary collapse

Attributes inherited from Bricolage::SQSMessage

#delay_seconds, #message_id, #name, #receipt_handle, #source, #time

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Event

#data?, get_concrete_class

Methods inherited from Bricolage::SQSMessage

for_sqs_record, for_sqs_result, get_event_time, #initialize

Constructor Details

This class inherits a constructor from Bricolage::SQSMessage

Instance Attribute Details

#table_nameObject (readonly)

Returns the value of attribute table_name.



86
87
88
# File 'lib/bricolage/streamingload/event.rb', line 86

def table_name
  @table_name
end

Class Method Details

.create(table_name:) ⇒ Object



70
71
72
# File 'lib/bricolage/streamingload/event.rb', line 70

def FlushTableEvent.create(table_name:)
  super name: 'flushtable', table_name: table_name
end

.parse_sqs_record(msg, rec) ⇒ Object



74
75
76
77
78
# File 'lib/bricolage/streamingload/event.rb', line 74

def FlushTableEvent.parse_sqs_record(msg, rec)
  {
    table_name: rec['tableName']
  }
end

Instance Method Details

#bodyObject



88
89
90
91
92
# File 'lib/bricolage/streamingload/event.rb', line 88

def body
  obj = super
  obj['tableName'] = @table_name
  obj
end

#init_message(table_name:) ⇒ Object



82
83
84
# File 'lib/bricolage/streamingload/event.rb', line 82

def init_message(table_name:)
  @table_name = table_name
end