class AWS::EMR::JobFlow
@attr_reader [String] name
The name of the job flow.
@attr_reader [String] ami_version
The version of the AMI used to initialize Amazon EC2 instances in the job flow.
@attr_reader [String,nil] log_uri
The location in Amazon S3 where log files for the job are stored.
@attr_reader [Array<String>] supported_products
A list of strings set by third party software when the job flow is launched. If you are not using third party software to manage the job flow this value is empty.
@attr_reader [Array<Hash>] bootstrap_actions
@attr_reader [String] state
@attr_reader [Time] created_at
@attr_reader [Time] started_at
@attr_reader [Time] ready_at
@attr_reader [Time] ended_at
@attr_reader [String] last_state_change_reason
@attr_reader [String] master_instance_type
@attr_reader [String] master_public_dns_name
@attr_reader [String] master_instance_id
@attr_reader [String] slave_instance_id
@attr_reader [Integer] instance_count
@attr_reader [Integer] normalized_instance_hours
@attr_reader [String] ec2_key_name
@attr_reader [String] ec2_subnet_id
@attr_reader [String] availability_zone_name
@attr_reader [Boolean] keep_job_flow_alive_when_no_steps
@attr_reader [Boolean] termination_protected
@attr_reader [String] hadoop_version
@attr_reader [Array<Hash>] instance_group_details
@attr_reader [Array<Hash>] step_details
Attributes
@return [String]
@return [String]
Public Class Methods
@param [String] #job_flow_id @param [Hash] options @api private
# File lib/aws/emr/job_flow.rb, line 80 def initialize job_flow_id, options = {} @job_flow_id = job_flow_id super end
Public Instance Methods
Adds one (or more) steps to the current job flow.
emr.job_flows['job-flow-id'].add_steps([{ :name => 'step-name', :action_on_failure => 'TERMINATE_JOB_FLOW', :hadoop_jar_step => { :jar => 'path/to/a/jar/file', :main_class => 'MainClassName', :args => %w(arg1 arg2 arg3)], :properties => [ { :key => 'property-1-name', :value => 'property-1-value' } { :key => 'property-2-name', :value => 'property-2-value' } ], } }]) emr.job_flows['job-flow-id'].add_steps([{
@param [Array<Hash>] steps A list of one or more steps to add.
Each step should be a hash with the following structure: * %x:name` - *required* - (String) The name of the job flow step. * %x:action_on_failure` - (String) Specifies the action to take if the job flow step fails. * %x:hadoop_jar_step` - *required* - (Hash) Specifies the JAR file used for the job flow step. * %x:properties` - (Array<Hash>) A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function. * %x:key` - (String) The unique identifier of a key value pair. * %x:value` - (String) The value part of the identified key. * %x:jar` - *required* - (String) A path to a JAR file run during the step. * %x:main_class` - (String) The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file. * %x:args` - (Array<String>) A list of command line arguments passed to the JAR file's main function when executed.
@return [nil]
# File lib/aws/emr/job_flow.rb, line 234 def add_steps *steps options = {} options[:job_flow_id] = job_flow_id options[:steps] = steps.flatten client.add_job_flow_steps(options) nil end
@return [EC2::AvailabilityZone,nil]
# File lib/aws/emr/job_flow.rb, line 189 def availability_zone if name = availability_zone_name AWS::EC2.new(:config => config).availability_zones[name] end end
Removes a lock on this job flow so the Amazon EC2 instances in the cluster may be terminated. @return [nil]
# File lib/aws/emr/job_flow.rb, line 258 def disable_termination_protection set_termination_protection(false) end
Locks this job flow so the Amazon EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error. @return [nil]
# File lib/aws/emr/job_flow.rb, line 251 def enable_termination_protection set_termination_protection(true) end
@return [Boolean] Returns `true` if the job flow exists.
# File lib/aws/emr/job_flow.rb, line 291 def exists? !get_resource.data[:job_flows].empty? end
@return [InstanceGroupCollection]
# File lib/aws/emr/job_flow.rb, line 243 def instance_groups InstanceGroupCollection.new(self) end
@return [EC2::Instance,nil]
# File lib/aws/emr/job_flow.rb, line 175 def master_instance if instance_id = master_instance_id AWS::EC2.new(:config => config).instances[instance_id] end end
@param [Boolean] state @return [nil]
# File lib/aws/emr/job_flow.rb, line 264 def set_termination_protection state options = {} options[:termination_protected] = state options[:job_flow_ids] = [job_flow_id] client.set_termination_protection(options) nil end
@param [Boolean] state @return [nil]
# File lib/aws/emr/job_flow.rb, line 274 def set_visible_to_all_users state options = {} options[:visible_to_all_users] = state options[:job_flow_ids] = [job_flow_id] client.set_visible_to_all_users(options) nil end
@return [EC2::Instance,nil]
# File lib/aws/emr/job_flow.rb, line 182 def slave_instance if instance_id = slave_instance_id AWS::EC2.new(:config => config).instances[instance_id] end end
Terminates the current job flow. @return [nil]
# File lib/aws/emr/job_flow.rb, line 284 def terminate client.terminate_job_flows(:job_flow_ids => [job_flow_id]) nil end
Protected Instance Methods
# File lib/aws/emr/job_flow.rb, line 301 def get_resource attr = nil client.describe_job_flows(:job_flow_ids => [job_flow_id]) end
# File lib/aws/emr/job_flow.rb, line 297 def resource_identifiers [[:job_flow_id, job_flow_id]] end