lib/elasticity/job_flow.rb in elasticity-2.3.1 vs lib/elasticity/job_flow.rb in elasticity-2.4
- old
+ new
@@ -17,20 +17,23 @@
attr_accessor :ami_version
attr_accessor :keep_job_flow_alive_when_no_steps
attr_accessor :ec2_subnet_id
attr_accessor :placement
- def initialize(access, secret)
+ attr_reader :access_key
+ attr_reader :secret_key
+
+ def initialize(access=nil, secret=nil)
@action_on_failure = 'TERMINATE_JOB_FLOW'
@hadoop_version = '1.0.3'
@name = 'Elasticity Job Flow'
@ami_version = 'latest'
@keep_job_flow_alive_when_no_steps = false
@placement = 'us-east-1a'
- @access = access
- @secret = secret
+ @access_key = access
+ @secret_key = secret
@bootstrap_actions = []
@jobflow_steps = []
@installed_steps = []
@@ -39,12 +42,12 @@
set_core_instance_group(Elasticity::InstanceGroup.new)
@instance_count = 2
@master_instance_type = 'm1.small'
@slave_instance_type = 'm1.small'
- @access = access
- @secret = secret
+ @access_key = access
+ @secret_key = secret
end
def self.from_jobflow_id(access, secret, jobflow_id, region = 'us-east-1')
JobFlow.new(access, secret).tap do |j|
j.instance_variable_set(:@region, region)
@@ -120,10 +123,10 @@
private
def emr
@region ||= @placement.match(/(\w+-\w+-\d+)/)[0]
- @emr ||= Elasticity::EMR.new(@access, @secret, :region => @region)
+ @emr ||= Elasticity::EMR.new(@access_key, @secret_key, :region => @region)
end
def is_jobflow_running?
!@jobflow_id.nil?
end
\ No newline at end of file