use of com.amazonaws.services.elasticmapreduce.model.HadoopJarStepConfig in project herd by FINRAOS.
the class EmrShellStepHelper method getEmrStepConfig.
@Override
public StepConfig getEmrStepConfig(Object step) {
EmrShellStep emrShellStep = (EmrShellStep) step;
// Hadoop Jar provided by Amazon for running Shell Scripts
String hadoopJarForShellScript = configurationHelper.getProperty(ConfigurationValue.EMR_SHELL_SCRIPT_JAR);
// Default ActionOnFailure is to cancel the execution and wait
ActionOnFailure actionOnFailure = ActionOnFailure.CANCEL_AND_WAIT;
if (emrShellStep.isContinueOnError() != null && emrShellStep.isContinueOnError()) {
// Override based on user input
actionOnFailure = ActionOnFailure.CONTINUE;
}
// Add the script location
List<String> argsList = new ArrayList<>();
argsList.add(emrShellStep.getScriptLocation().trim());
// Add the script arguments
if (!CollectionUtils.isEmpty(emrShellStep.getScriptArguments())) {
for (String argument : emrShellStep.getScriptArguments()) {
argsList.add(argument.trim());
}
}
// Return the StepConfig object
HadoopJarStepConfig jarConfig = new HadoopJarStepConfig(hadoopJarForShellScript).withArgs(argsList);
return new StepConfig().withName(emrShellStep.getStepName().trim()).withActionOnFailure(actionOnFailure).withHadoopJarStep(jarConfig);
}
Aggregations