Class: Embulk::OutputPlugin

Inherits:
Object
  • Object
show all
Defined in:
lib/embulk/output_plugin.rb

Direct Known Subclasses

Plugin::OutputExample

Defined Under Namespace

Classes: JavaAdapter

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task, schema, index) ⇒ OutputPlugin

Returns a new instance of OutputPlugin.



21
22
23
24
25
# File 'lib/embulk/output_plugin.rb', line 21

def initialize(task, schema, index)
  @task = task
  @schema = schema
  @index = index
end

Instance Attribute Details

#index ⇒ Object (readonly)

Returns the value of attribute index.



27
28
29
# File 'lib/embulk/output_plugin.rb', line 27

def index
  @index
end

#schema ⇒ Object (readonly)

Returns the value of attribute schema.



27
28
29
# File 'lib/embulk/output_plugin.rb', line 27

def schema
  @schema
end

#task ⇒ Object (readonly)

Returns the value of attribute task.



27
28
29
# File 'lib/embulk/output_plugin.rb', line 27

def task
  @task
end

Class Method Details

.cleanup(task, schema, count, commit_reports) ⇒ Object



17
18
19
# File 'lib/embulk/output_plugin.rb', line 17

def self.cleanup(task, schema, count, commit_reports)
  # do nothing by default
end

.java_object ⇒ Object



47
48
49
# File 'lib/embulk/output_plugin.rb', line 47

def self.java_object
  JavaAdapter.new(self)
end

.resume(task, schema, count, &control) ⇒ Object

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/embulk/output_plugin.rb', line 13

def self.resume(task, schema, count, &control)
  raise NotImplementedError, "#{self}.resume(task, schema, count, &control) is not implemented. This plugin is not resumable"
end

.transaction(config, schema, processor_count) {|config| ... } ⇒ Object

Yields:

  • (config)


8
9
10
11
# File 'lib/embulk/output_plugin.rb', line 8

def self.transaction(config, schema, processor_count, &control)
  yield(config)
  return {}
end

Instance Method Details

#abort ⇒ Object



39
40
# File 'lib/embulk/output_plugin.rb', line 39

def abort
end

#add(page) ⇒ Object

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/embulk/output_plugin.rb', line 29

def add(page)
  raise NotImplementedError, "OutputPlugin#add(page) must be implemented"
end

#close ⇒ Object



36
37
# File 'lib/embulk/output_plugin.rb', line 36

def close
end

#commit ⇒ Object



42
43
44
# File 'lib/embulk/output_plugin.rb', line 42

def commit
  {}
end

#finish ⇒ Object



33
34
# File 'lib/embulk/output_plugin.rb', line 33

def finish
end