Sha256: 2cdc84076d6da728cc90efd60048937e268efd59ad84ac3e6e7d14e636af06a5

Contents?: true

Size: 924 Bytes

Versions: 1

Compression:

Stored size: 924 Bytes

Contents

module Elasticity

  class CustomJarJob < Elasticity::SimpleJob

    def initialize(aws_access_key_id, aws_secret_access_key)
      super
      @name = "Elasticity Custom Jar Job"
    end

    def run(jar, arguments=nil)
      jobflow_config = {
        :name => @name,
        :instances => {
          :ec2_key_name => @ec2_key_name,
          :hadoop_version => @hadoop_version,
          :instance_count => @instance_count,
          :master_instance_type => @master_instance_type,
          :slave_instance_type => @slave_instance_type,
        },
        :steps => [
          {
            :action_on_failure => @action_on_failure,
            :hadoop_jar_step => {
              :jar => jar
            },
            :name => "Execute Custom Jar"
          }
        ]
      }

      jobflow_config[:steps].first[:hadoop_jar_step][:args] = arguments if arguments

      run_job(jobflow_config)
    end

  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
elasticity-1.5 lib/elasticity/custom_jar_job.rb