Class: Elasticity::StreamingStep
- Includes:
- JobFlowStep
- Defined in:
- lib/elasticity/streaming_step.rb
Instance Attribute Summary collapse
-
#action_on_failure ⇒ Object
Returns the value of attribute action_on_failure.
-
#input_bucket ⇒ Object
Returns the value of attribute input_bucket.
-
#mapper ⇒ Object
Returns the value of attribute mapper.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output_bucket ⇒ Object
Returns the value of attribute output_bucket.
-
#reducer ⇒ Object
Returns the value of attribute reducer.
Instance Method Summary collapse
-
#initialize(input_bucket, output_bucket, mapper, reducer) ⇒ StreamingStep
constructor
A new instance of StreamingStep.
- #to_aws_step(job_flow) ⇒ Object
Methods included from JobFlowStep
#aws_installation_step, included, #requires_installation?, steps_requiring_installation
Constructor Details
#initialize(input_bucket, output_bucket, mapper, reducer) ⇒ StreamingStep
Returns a new instance of StreamingStep.
14 15 16 17 18 19 20 21 |
# File 'lib/elasticity/streaming_step.rb', line 14 def initialize(input_bucket, output_bucket, mapper, reducer) @name = 'Elasticity Streaming Step' @action_on_failure = 'TERMINATE_JOB_FLOW' @input_bucket = input_bucket @output_bucket = output_bucket @mapper = mapper @reducer = reducer end |
Instance Attribute Details
#action_on_failure ⇒ Object
Returns the value of attribute action_on_failure.
8 9 10 |
# File 'lib/elasticity/streaming_step.rb', line 8 def action_on_failure @action_on_failure end |
#input_bucket ⇒ Object
Returns the value of attribute input_bucket.
9 10 11 |
# File 'lib/elasticity/streaming_step.rb', line 9 def input_bucket @input_bucket end |
#mapper ⇒ Object
Returns the value of attribute mapper.
11 12 13 |
# File 'lib/elasticity/streaming_step.rb', line 11 def mapper @mapper end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/elasticity/streaming_step.rb', line 7 def name @name end |
#output_bucket ⇒ Object
Returns the value of attribute output_bucket.
10 11 12 |
# File 'lib/elasticity/streaming_step.rb', line 10 def output_bucket @output_bucket end |
#reducer ⇒ Object
Returns the value of attribute reducer.
12 13 14 |
# File 'lib/elasticity/streaming_step.rb', line 12 def reducer @reducer end |
Instance Method Details
#to_aws_step(job_flow) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/elasticity/streaming_step.rb', line 23 def to_aws_step(job_flow) step = Elasticity::CustomJarStep.new('/home/hadoop/contrib/streaming/hadoop-streaming.jar') step.name = @name step.action_on_failure = @action_on_failure step.arguments = ['-input', @input_bucket, '-output', @output_bucket, '-mapper', @mapper, '-reducer', @reducer] step.to_aws_step(job_flow) end |