Class: Embulk::PluginManager

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

Instance Method Summary collapse

Constructor Details

#initializePluginManager

Returns a new instance of PluginManager



21
22
23
24
25
26
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 21

def initialize
  @registries = {}
  %w[input output parser formatter decoder encoder line_filter filter guess executor].each do |category|
    @registries[category.to_sym] = PluginRegistry.new(category, "embulk/#{category}/")
  end
end

Instance Method Details

#get_guess(type) ⇒ Object

TODO EncoderPlugin::RubyAdapter is not written by anyone yet def get_encoder(type)

# TODO not implemented yet
lookup(:encoder, type)

end



103
104
105
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 103

def get_guess(type)
  lookup(:guess, type)
end

#new_java_decoder(type) ⇒ Object



174
175
176
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 174

def new_java_decoder(type)
  lookup(:decoder, type).new_java
end

#new_java_encoder(type) ⇒ Object



178
179
180
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 178

def new_java_encoder(type)
  lookup(:encoder, type).new_java
end

#new_java_executor(type) ⇒ Object



186
187
188
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 186

def new_java_executor(type)
  lookup(:executor, type).new_java
end

#new_java_filter(type) ⇒ Object



162
163
164
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 162

def new_java_filter(type)
  lookup(:filter, type).new_java
end

#new_java_formatter(type) ⇒ Object



170
171
172
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 170

def new_java_formatter(type)
  lookup(:formatter, type).new_java
end

#new_java_guess(type) ⇒ Object



182
183
184
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 182

def new_java_guess(type)
  lookup(:guess, type).new_java
end

#new_java_input(type) ⇒ Object



154
155
156
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 154

def new_java_input(type)
  lookup(:input, type).new_java
end

#new_java_output(type) ⇒ Object



158
159
160
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 158

def new_java_output(type)
  lookup(:output, type).new_java
end

#new_java_parser(type) ⇒ Object



166
167
168
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 166

def new_java_parser(type)
  lookup(:parser, type).new_java
end

#register_filter(type, klass) ⇒ Object



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

def register_filter(type, klass)
  register_plugin(:filter, type, klass, FilterPlugin)
end

#register_formatter(type, klass) ⇒ Object



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

def register_formatter(type, klass)
  register_plugin(:formatter, type, klass, FormatterPlugin)
end

#register_guess(type, klass) ⇒ Object

TODO EncoderPlugin JRuby API is not written by anyone yet def register_encoder(type, klass)

register_plugin(:encoder, type, klass, EncoderPlugin)

end



59
60
61
62
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 59

def register_guess(type, klass)
  register_plugin(:guess, type, klass, GuessPlugin,
                 "Guess plugin #{klass} must extend GuessPlugin, LineGuessPlugin, or TextGuessPlugin class")
end

#register_input(type, klass) ⇒ Object



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

def register_input(type, klass)
  register_plugin(:input, type, klass, InputPlugin)
end

#register_java_decoder(type, klass) ⇒ Object



134
135
136
137
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 134

def register_java_decoder(type, klass)
  register_java_plugin(:decoder, type, klass,
                       "org.embulk.spi.DecoderPlugin" => DecoderPlugin)
end

#register_java_encoder(type, klass) ⇒ Object



139
140
141
142
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 139

def register_java_encoder(type, klass)
  register_java_plugin(:encoder, type, klass,
                       "org.embulk.spi.EncoderPlugin" => EncoderPlugin)
end

#register_java_executor(type, klass) ⇒ Object



149
150
151
152
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 149

def register_java_executor(type, klass)
  register_java_plugin(:executor, type, klass,
                       "org.embulk.spi.ExecutorPlugin" => ExecutorPlugin)
end

#register_java_filter(type, klass) ⇒ Object



119
120
121
122
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 119

def register_java_filter(type, klass)
  register_java_plugin(:filter, type, klass,
                       "org.embulk.spi.FilterPlugin" => FilterPlugin)
end

#register_java_formatter(type, klass) ⇒ Object



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

def register_java_formatter(type, klass)
  register_java_plugin(:formatter, type, klass,
                       "org.embulk.spi.FormatterPlugin" => FormatterPlugin)
end

#register_java_guess(type, klass) ⇒ Object



144
145
146
147
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 144

def register_java_guess(type, klass)
  register_java_plugin(:guess, type, klass,
                       "org.embulk.spi.GuessPlugin" => GuessPlugin)
end

#register_java_input(type, klass) ⇒ Object



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

def register_java_input(type, klass)
  register_java_plugin(:input, type, klass,
                       "org.embulk.spi.InputPlugin" => InputPlugin,
                       "org.embulk.spi.FileInputPlugin" => FileInputPlugin)
end

#register_java_output(type, klass) ⇒ Object



113
114
115
116
117
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 113

def register_java_output(type, klass)
  register_java_plugin(:output, type, klass,
                       "org.embulk.spi.OutputPlugin" => OutputPlugin,
                       "org.embulk.spi.FileOutputPlugin" => FileOutputPlugin)
end

#register_java_parser(type, klass) ⇒ Object



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

def register_java_parser(type, klass)
  register_java_plugin(:parser, type, klass,
                       "org.embulk.spi.ParserPlugin" => ParserPlugin)
end

#register_output(type, klass) ⇒ Object



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

def register_output(type, klass)
  register_plugin(:output, type, klass, OutputPlugin,
                  "Output plugin #{klass} must extend OutputPlugin")
end

#register_parser(type, klass) ⇒ Object



41
42
43
# File 'embulk-core/src/main/ruby/embulk/plugin.rb', line 41

def register_parser(type, klass)
  register_plugin(:parser, type, klass, ParserPlugin)
end