Class: Chronicle::ETL::BufferTransformer

Inherits:
Transformer show all
Defined in:
lib/chronicle/etl/transformers/buffer_transformer.rb

Instance Attribute Summary

Attributes inherited from Transformer

#stashed_records

Attributes included from Registry::SelfRegistering

#connector_registration

Instance Method Summary collapse

Methods inherited from Transformer

#call, #call_finish, #initialize

Methods included from Registry::SelfRegistering

#register_connector

Methods included from Configurable

included

Constructor Details

This class inherits a constructor from Chronicle::ETL::Transformer

Instance Method Details

#finishObject



24
25
26
# File 'lib/chronicle/etl/transformers/buffer_transformer.rb', line 24

def finish
  flush_stashed_records
end

#transform(record) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/chronicle/etl/transformers/buffer_transformer.rb', line 13

def transform(record)
  stash_record(record)

  # FIXME: this doesn't seem to be working with the runner
  return if @stashed_records.size < @config.size

  # FIXME: this will result in the wrong extraction being associated with
  # the batch of flushed records
  flush_stashed_records.map(&:data)
end