I need to chain two MapReduce jobs. I used JobControl to set job2 as dependent of job1. It works, output files are created!! But it doesn\'t stop! In the shell it remains in
try this:
Thread jcThread = new Thread(jobControl);
jcThread.start();
System.out.println("循环判断jobControl运行状态 >>>>>>>>>>>>>>>>");
while (true) {
if (jobControl.allFinished()) {
System.out.println("====>> jobControl.allFinished=" + jobControl.getSuccessfulJobList());
jobControl.stop();
// 如果不加 break 或者 return,程序会一直循环
break;
}
if (jobControl.getFailedJobList().size() > 0) {
succ = 0;
System.out.println("====>> jobControl.getFailedJobList=" + jobControl.getFailedJobList());
jobControl.stop();
// 如果不加 break 或者 return,程序会一直循环
break;
}
}