@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AddJobFlowStepsRequest == false) return false; AddJobFlowStepsRequest other = (AddJobFlowStepsRequest) obj; if (other.getJobFlowId() == null ^ this.getJobFlowId() == null) return false; if (other.getJobFlowId() != null && other.getJobFlowId().equals(this.getJobFlowId()) == false) return false; if (other.getSteps() == null ^ this.getSteps() == null) return false; if (other.getSteps() != null && other.getSteps().equals(this.getSteps()) == false) return false; return true; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getJobFlowId() != null) sb.append("JobFlowId: ").append(getJobFlowId()).append(","); if (getSteps() != null) sb.append("Steps: ").append(getSteps()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(AddJobFlowStepsRequest addJobFlowStepsRequest, ProtocolMarshaller protocolMarshaller) { if (addJobFlowStepsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(addJobFlowStepsRequest.getJobFlowId(), JOBFLOWID_BINDING); protocolMarshaller.marshall(addJobFlowStepsRequest.getSteps(), STEPS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getJobFlowId() != null) sb.append("JobFlowId: ").append(getJobFlowId()).append(","); if (getSteps() != null) sb.append("Steps: ").append(getSteps()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AddJobFlowStepsRequest == false) return false; AddJobFlowStepsRequest other = (AddJobFlowStepsRequest) obj; if (other.getJobFlowId() == null ^ this.getJobFlowId() == null) return false; if (other.getJobFlowId() != null && other.getJobFlowId().equals(this.getJobFlowId()) == false) return false; if (other.getSteps() == null ^ this.getSteps() == null) return false; if (other.getSteps() != null && other.getSteps().equals(this.getSteps()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(AddJobFlowStepsRequest addJobFlowStepsRequest, ProtocolMarshaller protocolMarshaller) { if (addJobFlowStepsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(addJobFlowStepsRequest.getJobFlowId(), JOBFLOWID_BINDING); protocolMarshaller.marshall(addJobFlowStepsRequest.getSteps(), STEPS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
private Submitter existingClusterSubmitter(AmazonElasticMapReduce emr, String tag, StepCompiler stepCompiler, String clusterId, Filer filer) { return () -> { List<String> stepIds = pollingRetryExecutor(state, "submission") .retryUnless(AmazonServiceException.class, Aws::isDeterministicException) .withRetryInterval(DurationInterval.of(Duration.ofSeconds(30), Duration.ofMinutes(5))) .runOnce(new TypeReference<List<String>>() {}, s -> { RemoteFile runner = prepareRunner(filer, tag); // Compile steps stepCompiler.compile(runner); // Stage files to S3 filer.stageFiles(); AddJobFlowStepsRequest request = new AddJobFlowStepsRequest() .withJobFlowId(clusterId) .withSteps(stepCompiler.stepConfigs()); int steps = request.getSteps().size(); logger.info("Submitting {} EMR step(s) to {}", steps, clusterId); AddJobFlowStepsResult result = emr.addJobFlowSteps(request); logSubmittedSteps(clusterId, steps, i -> request.getSteps().get(i).getName(), i -> result.getStepIds().get(i)); return ImmutableList.copyOf(result.getStepIds()); }); return SubmissionResult.ofExistingCluster(clusterId, stepIds); }; }
@Override public List<String> answer(InvocationOnMock invocation) throws Throwable { AddJobFlowStepsRequest addJobFlowStepsRequest = invocation.getArgument(1); assertEquals(clusterId, addJobFlowStepsRequest.getJobFlowId()); List<StepConfig> steps = addJobFlowStepsRequest.getSteps(); assertEquals(1, steps.size()); assertEquals(emrStepConfig, steps.get(0)); // return a single step with the given stepId return Arrays.asList(stepId); } });
public List<String> addJobFlowStepsRequest(AmazonElasticMapReduceClient emrClient, AddJobFlowStepsRequest addJobFlowStepsRequest) if (addJobFlowStepsRequest.getSteps() != null && addJobFlowStepsRequest.getSteps().get(0) != null) StepConfig firstStep = addJobFlowStepsRequest.getSteps().get(0); for (StepConfig step : addJobFlowStepsRequest.getSteps())