我编写了一个AWS SWF工作流程,第一个操作是启动集群并运行mapreduce程序。这个动作还有2个其他mapreduce jar可以执行,具体取决于第一个jar的输出。我用它来添加罐子
HadoopJarStepConfig jarConfig = new HadoopJarStepConfig(S3N_HADOOP_JAR);
jarConfig.setArgs(ARGS_AS_LIST);
HadoopJarStepConfig jarConfig1 = new HadoopJarStepConfig(S3N_HADOOP_JAR);
jarConfig1.setArgs(ARGS_AS_LIST1);
try {
StepConfig enableDebugging = new StepConfig()
.withName("Enable debugging")
.withActionOnFailure("TERMINATE_JOB_FLOW")
.withHadoopJarStep(new StepFactory().newEnableDebuggingStep());
StepConfig runJar = new StepConfig(HADOOP_JAR, jarConfig);
StepConfig runJar1 = new StepConfig(HADOOP_JAR, jarConfig1);
request.setSteps(Arrays.asList(new StepConfig[]{enableDebugging, runJar, runJar1}));
RunJobFlowResult result = emr.runJobFlow(request);
这是添加多个罐子的正确方法吗?感谢。
答案 0 :(得分:0)
使用:
request.withSteps(enableDebugging,runJar,runJar1);
不要使用:
new StepConfig [] {enableDebugging,runJar,runJar1}));是错的,你不需要再次使用SpetConfig ..