Class: Embulk::OutputPlugin::JavaAdapter::OutputAdapter

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

Instance Method Summary collapse

Constructor Details

#initialize(ruby_object, schema) ⇒ OutputAdapter

Returns a new instance of OutputAdapter



107
108
109
110
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 107

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

Instance Method Details

#abortObject



125
126
127
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 125

def abort
  @ruby_object.abort
end

#add(java_page) ⇒ Object



112
113
114
115
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 112

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

#closeObject



121
122
123
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 121

def close
  @ruby_object.close
end

#commitObject



129
130
131
132
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 129

def commit
  task_report_hash = @ruby_object.commit
  return DataSource.from_ruby_hash(task_report_hash).to_java
end

#finishObject



117
118
119
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 117

def finish
  @ruby_object.finish
end