Class: Bricolage::StreamingLoad::Event

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

Constant Summary

Constants inherited from Bricolage::SQSMessage

Bricolage::SQSMessage::SQS_EVENT_SOURCE

Instance Attribute Summary

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 Bricolage::SQSMessage

#body, create, for_sqs_record, for_sqs_result, get_event_time, #initialize, parse_sqs_record

Constructor Details

This class inherits a constructor from Bricolage::SQSMessage

Class Method Details

.get_concrete_class(msg, rec) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/bricolage/streamingload/event.rb', line 9

def Event.get_concrete_class(msg, rec)
  case
  when rec['eventName'] == 'shutdown' then ShutdownEvent
  when rec['eventName'] == 'dispatch' then DispatchEvent
  when rec['eventName'] == 'flushtable' then FlushTableEvent
  when rec['eventName'] == 'checkpoint' then CheckPointEvent
  when !!rec['s3'] then S3ObjectEvent
  else UnknownSQSMessage
  end
end

Instance Method Details

#data?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/bricolage/streamingload/event.rb', line 24

def data?
  false
end

#message_typeObject



20
21
22
# File 'lib/bricolage/streamingload/event.rb', line 20

def message_type
  raise "#{self.class}\#message_type must be implemented"
end