Class: Embulk::OutputPlugin

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

Defined Under Namespace

Modules: RubyAdapter 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
26
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 21

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

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index



28
29
30
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 28

def index
  @index
end

#schemaObject (readonly)

Returns the value of attribute schema



28
29
30
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 28

def schema
  @schema
end

#taskObject (readonly)

Returns the value of attribute task



28
29
30
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 28

def task
  @task
end

Class Method Details

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



17
18
19
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 17

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

.from_java(java_class) ⇒ Object



136
137
138
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 136

def self.from_java(java_class)
  JavaPlugin.ruby_adapter_class(java_class, OutputPlugin, RubyAdapter)
end

.new_javaObject



50
51
52
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 50

def self.new_java
  JavaAdapter.new(self)
end

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

Raises:

  • (NotImplementedError)


13
14
15
# File 'embulk-core/src/main/ruby/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, task_count) {|config| ... } ⇒ Object

Yields:

  • (config)


8
9
10
11
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 8

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

Instance Method Details

#abortObject



43
44
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 43

def abort
end

#add(page) ⇒ Object

Raises:

  • (NotImplementedError)


33
34
35
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 33

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

#closeObject



40
41
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 40

def close
end

#commitObject



46
47
48
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 46

def commit
  {}
end

#finishObject



37
38
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 37

def finish
end

#initObject



30
31
# File 'embulk-core/src/main/ruby/embulk/output_plugin.rb', line 30

def init
end