def run_job_flow(job_flow_config)
      params = {
        :operation => 'RunJobFlow',
      }.merge!(job_flow_config)
      aws_result = @aws_request.submit(params)
      yield aws_result if block_given?
      JSON.parse(aws_result)['JobFlowId']
    end
def run_job_flow(job_flow_config)
      params = {
        :operation => 'RunJobFlow',
      }.merge!(job_flow_config)
      aws_result = @aws_request.submit(params)
      yield aws_result if block_given?
      JSON.parse(aws_result)['JobFlowId']
    end
Start a job flow with the specified configuration.  This is a very thin
 wrapper around the AWS API, so in order to use it directly you'll need
 to have the PDF API reference handy, which can be found here:

 http://awsdocs.s3.amazonaws.com/ElasticMapReduce/20090331/emr-api-20090331.pdf

 Here is a sample job flow configuration that should help.  This job flow
 starts by installing Pig then running a Pig script.  It is based off of the
 Pig demo script from Amazon.

   emr.run_job_flow({
     :name => "Elasticity Test Flow (EMR Pig Script)",
     :instances => {
       :ec2_key_name => "sharethrough-dev",
       :hadoop_version => "0.20",
       :instance_count => 2,
       :master_instance_type => "m1.small",
       :placement => {
         :availability_zone => "us-east-1a"
       },
       :slave_instance_type => "m1.small",
     },
     :steps => [
       {
         :action_on_failure => "TERMINATE_JOB_FLOW",
         :hadoop_jar_step => {
           :args => [
             "s3://elasticmapreduce/libs/pig/pig-script",
               "--base-path",
               "s3://elasticmapreduce/libs/pig/",
               "--install-pig"
           ],
           :jar => "s3://elasticmapreduce/libs/script-runner/script-runner.jar"
         },
         :name => "Setup Pig"
       },
         {
           :action_on_failure => "TERMINATE_JOB_FLOW",
           :hadoop_jar_step => {
             :args => [
               "s3://elasticmapreduce/libs/pig/pig-script",
                 "--run-pig-script",
                 "--args",
                 "-p",
                 "INPUT=s3n://elasticmapreduce/samples/pig-apache/input",
                 "-p",
                 "OUTPUT=s3n://slif-elasticity/pig-apache/output/2011-04-19",
                 "s3n://elasticmapreduce/samples/pig-apache/do-reports.pig"
             ],
             :jar => "s3://elasticmapreduce/libs/script-runner/script-runner.jar"
           },
           :name => "Run Pig Script"
         }
     ]
   })