Class: Embulk::FormatterPlugin::JavaAdapter::OutputAdapter

Inherits:
Object
  • Object
show all
Includes:
Java::TransactionalPageOutput
Defined in:
embulk-core/src/main/ruby/embulk/formatter_plugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(ruby_object, schema, file_output) ⇒ OutputAdapter

Returns a new instance of OutputAdapter



68
69
70
71
72
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 68

def initialize(ruby_object, schema, file_output)
  @ruby_object = ruby_object
  @schema = schema
  @file_output = file_output
end

Instance Method Details

#add(java_page) ⇒ Object



74
75
76
77
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 74

def add(java_page)
  # TODO reuse page reader
  @ruby_object.add Page.new(java_page, @schema)
end

#closeObject



83
84
85
86
87
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 83

def close
  @ruby_object.close
ensure
  @file_output.close
end

#finishObject



79
80
81
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 79

def finish
  @ruby_object.finish
end