Class: Embulk::InputPlugin

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

Direct Known Subclasses

Embulk::Input::ExampleInputPlugin

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, page_builder) ⇒ InputPlugin

Returns a new instance of InputPlugin.



24
25
26
27
28
29
30
# File 'lib/embulk/input_plugin.rb', line 24

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

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



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

def index
  @index
end

#page_builderObject (readonly)

Returns the value of attribute page_builder.



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

def page_builder
  @page_builder
end

#schemaObject (readonly)

Returns the value of attribute schema.



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

def schema
  @schema
end

#taskObject (readonly)

Returns the value of attribute task.



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

def task
  @task
end

Class Method Details

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



16
17
18
# File 'lib/embulk/input_plugin.rb', line 16

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

.from_java(java_class) ⇒ Object



108
109
110
# File 'lib/embulk/input_plugin.rb', line 108

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

.guess(config) ⇒ Object

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/embulk/input_plugin.rb', line 20

def self.guess(config)
  raise NotImplementedError, "#{self}.guess(config) is not implemented. This input plugin does not support guess."
end

.new_javaObject



41
42
43
# File 'lib/embulk/input_plugin.rb', line 41

def self.new_java
  JavaAdapter.new(self)
end

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

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/embulk/input_plugin.rb', line 12

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

.transaction(config, &control) ⇒ Object

Raises:

  • (NotImplementedError)


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

def self.transaction(config, &control)
  raise NotImplementedError, "InputPlugin.transaction(config, &control) must be implemented"
end

Instance Method Details

#initObject



34
35
# File 'lib/embulk/input_plugin.rb', line 34

def init
end

#runObject

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/embulk/input_plugin.rb', line 37

def run
  raise NotImplementedError, "InputPlugin#run must be implemented"
end