Class: Embulk::GuessPlugin::JavaAdapter

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

Instance Method Summary collapse

Constructor Details

#initialize(ruby_guess) ⇒ JavaAdapter

Returns a new instance of JavaAdapter



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

def initialize(ruby_guess)
  @ruby_guess = ruby_guess
end

Instance Method Details

#guess(java_config, java_sample) ⇒ Object



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

def guess(java_config, java_sample)
  config = DataSource.from_java(java_config)
  sample = Buffer.from_java(java_sample)
  config_diff_hash = @ruby_guess.guess(config, sample)
  return DataSource.from_ruby_hash(config_diff_hash).to_java
end