List of usage examples for com.amazonaws.services.elasticmapreduce.model StepConfig StepConfig
public StepConfig(String name, HadoopJarStepConfig hadoopJarStep)
From source file:org.pentaho.amazon.client.impl.EmrClientImpl.java
License:Apache License
private StepConfig configureHiveStep(String stagingS3qUrl, String cmdLineArgs) { String[] cmdLineArgsArr;/*from w w w .java2 s . c om*/ if (cmdLineArgs == null) { cmdLineArgsArr = new String[] { "" }; } else { List<String> cmdArgs = Arrays.asList(cmdLineArgs.split("\\s+")); List<String> updatedCmdArgs = cmdArgs.stream().map(e -> replaceDoubleS3(e)) .collect(Collectors.toList()); cmdLineArgsArr = updatedCmdArgs.toArray(new String[updatedCmdArgs.size()]); } StepConfig hiveStepConfig = new StepConfig("Hive", new StepFactory().newRunHiveScriptStep(stagingS3qUrl, cmdLineArgsArr)); if (alive) { hiveStepConfig.withActionOnFailure(ActionOnFailure.CANCEL_AND_WAIT); } else { hiveStepConfig.withActionOnFailure(ActionOnFailure.TERMINATE_JOB_FLOW); } return hiveStepConfig; }