Class: Elasticity::CustomJarStep

Inherits:
Object
  • Object
show all
Includes:
JobFlowStep
Defined in:
lib/elasticity/custom_jar_step.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from JobFlowStep

#aws_installation_step_name, #aws_installation_steps, included, #requires_installation?, steps_requiring_installation

Constructor Details

#initialize(jar) ⇒ CustomJarStep

Returns a new instance of CustomJarStep



12
13
14
15
16
17
# File 'lib/elasticity/custom_jar_step.rb', line 12

def initialize(jar)
  @name = 'Elasticity Custom Jar Step'
  @jar = jar
  @arguments = []
  @action_on_failure = 'TERMINATE_JOB_FLOW'
end

Instance Attribute Details

#action_on_failureObject

Returns the value of attribute action_on_failure



10
11
12
# File 'lib/elasticity/custom_jar_step.rb', line 10

def action_on_failure
  @action_on_failure
end

#argumentsObject

Returns the value of attribute arguments



9
10
11
# File 'lib/elasticity/custom_jar_step.rb', line 9

def arguments
  @arguments
end

#jarObject

Returns the value of attribute jar



8
9
10
# File 'lib/elasticity/custom_jar_step.rb', line 8

def jar
  @jar
end

#nameObject

Returns the value of attribute name



7
8
9
# File 'lib/elasticity/custom_jar_step.rb', line 7

def name
  @name
end

Instance Method Details

#to_aws_step(_) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/elasticity/custom_jar_step.rb', line 19

def to_aws_step(_)
  step = {
    :action_on_failure => @action_on_failure,
    :hadoop_jar_step => {
      :jar => @jar
    },
    :name => @name
  }
  step[:hadoop_jar_step][:args] = @arguments unless @arguments.empty?
  step
end