Sha256: 1231b248b1db00716645b9e738642b108b48efce6a06e51fe72202b31b49b2cf

Contents?: true

Size: 1.64 KB

Versions: 20

Compression:

Stored size: 1.64 KB

Contents

module Embulk

  class EmbulkRunner
    def initialize(runner_java)
      @runner_java = runner_java  # Java::org.embulk.EmbulkRunner
    end

    def guess(config, options={})
      output_path =
        (options[:next_config_output_path] ? Java::java.lang.String.new(options[:next_config_output_path]) : nil)

      case config
      when String
        @runner_java.guess(Java::java.lang.String.new(config), output_path)
      when Hash, DataSource
        @runner_java.guess(DataSource.new(config).to_java, output_path)
      end

      nil
    end

    def preview(config, options={})
      format = (options[:format] ? Java::java.lang.String.new(options[:format]) : nil)

      case config
      when String
        @runner_java.preview(Java::java.lang.String.new(config), format)
      when Hash, DataSource
        @runner_java.preview(DataSource.new(config).to_java, format)
      end

      nil
    end

    def run(config, options={})
      config_diff_path =
        (options[:next_config_diff_path] ? Java::java.lang.String.new(options[:next_config_diff_path]) : nil)
      output_path =  # deprecated
        (options[:next_config_output_path] ? Java::java.lang.String.new(options[:next_config_output_path]) : nil)
      resume_state_path =
        (options[:resume_state_path] ? Java::java.lang.String.new(options[:resume_state_path]) : nil)

      case config
      when String
        @runner_java.run(Java::java.lang.String.new(config), config_diff_path, output_path, resume_state_path)
      when Hash, DataSource
        @runner_java.run(DataSource.new(config).to_java, config_diff_path, output_path, resume_state_path)
      end

      nil
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
embulk-0.8.39 lib/embulk/runner.rb
embulk-0.8.39-java lib/embulk/runner.rb
embulk-0.8.38 lib/embulk/runner.rb
embulk-0.8.38-java lib/embulk/runner.rb
embulk-0.8.37 lib/embulk/runner.rb
embulk-0.8.37-java lib/embulk/runner.rb
embulk-0.8.36 lib/embulk/runner.rb
embulk-0.8.36-java lib/embulk/runner.rb
embulk-0.8.35 lib/embulk/runner.rb
embulk-0.8.35-java lib/embulk/runner.rb
embulk-0.8.34 lib/embulk/runner.rb
embulk-0.8.34-java lib/embulk/runner.rb
embulk-0.8.33 lib/embulk/runner.rb
embulk-0.8.33-java lib/embulk/runner.rb
embulk-0.8.32 lib/embulk/runner.rb
embulk-0.8.32-java lib/embulk/runner.rb
embulk-0.8.31 lib/embulk/runner.rb
embulk-0.8.31-java lib/embulk/runner.rb
embulk-0.8.30 lib/embulk/runner.rb
embulk-0.8.30-java lib/embulk/runner.rb