List of usage examples for com.amazonaws.services.elasticmapreduce.model AddJobFlowStepsRequest getSteps
public java.util.List<StepConfig> getSteps()
A list of StepConfig to be executed by the job flow.
From source file:org.finra.dm.dao.impl.MockEmrOperationsImpl.java
License:Apache License
/** * Add Job Flow Step to AmazonElasticMapReduceClient *///ww w . jav a 2 s . c om @Override public List<String> addJobFlowStepsRequest(AmazonElasticMapReduceClient emrClient, AddJobFlowStepsRequest addJobFlowStepsRequest) { if (addJobFlowStepsRequest.getSteps() != null && addJobFlowStepsRequest.getSteps().get(0) != null) { StepConfig firstStep = addJobFlowStepsRequest.getSteps().get(0); if (firstStep.getName().equals(MockAwsOperationsHelper.AMAZON_BAD_REQUEST)) { AmazonServiceException badRequestException = new AmazonServiceException( MockAwsOperationsHelper.AMAZON_BAD_REQUEST); badRequestException.setStatusCode(HttpStatus.SC_BAD_REQUEST); throw badRequestException; } else if (firstStep.getName().equals(MockAwsOperationsHelper.AMAZON_NOT_FOUND)) { AmazonServiceException notFoundException = new AmazonServiceException( MockAwsOperationsHelper.AMAZON_NOT_FOUND); notFoundException.setStatusCode(HttpStatus.SC_NOT_FOUND); throw notFoundException; } else if (firstStep.getName().equals(MockAwsOperationsHelper.AMAZON_SERVICE_EXCEPTION)) { throw new AmazonServiceException(MockAwsOperationsHelper.AMAZON_SERVICE_EXCEPTION); } } MockEmrJobFlow cluster = getClusterById(addJobFlowStepsRequest.getJobFlowId()); if (cluster == null) { throw new AmazonServiceException( "No Cluster exists with jobFlowId: " + addJobFlowStepsRequest.getJobFlowId()); } List<String> jobIds = new ArrayList<>(); for (StepConfig step : addJobFlowStepsRequest.getSteps()) { jobIds.add(addClusterStep(cluster.getJobFlowId(), step).getJobFlowId()); } return jobIds; }