Class: Flydata::Source::ParseDumpAndSend

Inherits:
Component
  • Object
show all
Defined in:
lib/flydata/source/parse_dump_and_send.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#initialize

Constructor Details

This class inherits a constructor from Flydata::Source::Component

Class Method Details

.inherited(child_class) ⇒ Object


9
10
11
# File 'lib/flydata/source/parse_dump_and_send.rb', line 9

def self.inherited(child_class)
  Source.register(child_class, self)
end

Instance Method Details

#parse_dump(dump_pos_info, dmpio, create_table_block, insert_record_block, check_point_block) ⇒ Object

Public Interface: Parse Dump

dump_pos_info: A hash containing the dump position from where the parse

starts

dmpio: A read IO object to the dump create_table_block: A callback called with a table info before its data gets

                  sent
callback parameters:
  source_table: A SourceTable object

insert_record_block: A callback called with parsed records

callback parameters:
  source_table: A SourceTable object
  values_set: An array of arrays.  Each array has values for a row.

check_point_block: A callback called between transactions. Dump position

                 gets saved for resume at this timing.
callback_parameters:
  source_table: A SourceTable object
  last_pos: An IO location as of the check point
  bytesize: Number of bytes which have been processed
  source_pos: Source position of the dump
  state: Current dump state
  substate: Current dump sub-state

Returns none


46
47
48
# File 'lib/flydata/source/parse_dump_and_send.rb', line 46

def parse_dump(dump_pos_info, dmpio, create_table_block, insert_record_block, check_point_block)
  raise UnsupportedSourceError,  "subclass must implement"
end

#value_convertersObject

Public Interface: Value Converters

Returns a hash of value converters which convert source values to FlyData values. Hash key is a data type for which the converter is called. A conveter takes a source value and returns a converted value.


18
19
20
# File 'lib/flydata/source/parse_dump_and_send.rb', line 18

def value_converters
  raise UnsupportedSourceError,  "subclass must implement"
end