JobConf jobConf = createBaseHadoopConf(context, actionXml);
jobClient = createJobClient(context, jobConf);
RunningJob runningJob = getRunningJob(context, action, jobClient);
if (runningJob == null) {
context.setExecutionData(FAILED, null);
throw new ActionExecutorException(ActionExecutorException.ErrorType.FAILED, "JA017",
"Unknown hadoop job [{0}] associated with action [{1}]. Failing this action!", action
.getExternalId(), action.getId());
}
if (runningJob.isComplete()) {
Path actionDir = context.getActionDir();
String newId = null;
// load sequence file into object
Map<String, String> actionData = LauncherMapperHelper.getActionData(actionFs, actionDir, jobConf);
if (actionData.containsKey(LauncherMapper.ACTION_DATA_NEW_ID)) {
newId = actionData.get(LauncherMapper.ACTION_DATA_NEW_ID);
String launcherId = action.getExternalId();
runningJob = jobClient.getJob(JobID.forName(newId));
if (runningJob == null) {
context.setExternalStatus(FAILED);
throw new ActionExecutorException(ActionExecutorException.ErrorType.FAILED, "JA017",
"Unknown hadoop job [{0}] associated with action [{1}]. Failing this action!", newId,
action.getId());
}
context.setExternalChildIDs(newId);
LOG.info(XLog.STD, "External ID swap, old ID [{0}] new ID [{1}]", launcherId,