title: (JAVA) How check status of Step in AWS EMR?
body: <p>I am using Java EMR API to run pig job on EMR cluster. I am using following code to add Steps in JobFLow:</p>
  
  <pre><code>    String jobFlowId = "j-assdasd";
      AmazonElasticMapReduceClient client = new AmazonElasticMapReduceClient(
                      credentials);
  
      StepFactory stepFactory = new StepFactory();
  
  
      StepConfig executePig = new StepConfig()
                      .withName("Execute Pig")
                      .withActionOnFailure(ActionOnFailure.CANCEL_AND_WAIT)
                      .withHadoopJarStep(
                                      stepFactory
                                      .newRunPigScriptStep("s3://bucket/script/load.pig"));
  
      AddJobFlowStepsRequest pig = new AddJobFlowStepsRequest(jobFlowId)
                      .withSteps( executePig);
      AddJobFlowStepsResult result = client.addJobFlowSteps(pig);
  </code></pre>
  
  <p>How can i get the status of the "Execute Pig" status? I want to make program wait till the step finishes on EMR.</p>