coordAction.setLastModifiedTime(new Date());
try {
jpaService.execute(new org.apache.oozie.executor.jpa.CoordActionUpdateForInputCheckJPAExecutor(coordAction));
}
catch (JPAExecutorException e) {
throw new CommandException(e);
}
LOG.info("[" + actionId
+ "]::ActionInputCheck:: nominal Time is newer than current time, so requeue and wait. Current="
+ currentTime + ", nominal=" + nominalTime);
return null;
}
StringBuilder actionXml = new StringBuilder(coordAction.getActionXml());
Instrumentation.Cron cron = new Instrumentation.Cron();
try {
Configuration actionConf = new XConfiguration(new StringReader(coordAction.getRunConf()));
cron.start();
StringBuilder existList = new StringBuilder();
StringBuilder nonExistList = new StringBuilder();
StringBuilder nonResolvedList = new StringBuilder();
CoordCommandUtils.getResolvedList(coordAction.getMissingDependencies(), nonExistList, nonResolvedList);
LOG.info("[" + actionId + "]::CoordActionInputCheck:: Missing deps:" + nonExistList.toString() + " "
+ nonResolvedList.toString());
boolean status = checkInput(actionXml, existList, nonExistList, actionConf);
coordAction.setLastModifiedTime(currentTime);
coordAction.setActionXml(actionXml.toString());
if (nonResolvedList.length() > 0 && status == false) {
nonExistList.append(CoordCommandUtils.RESOLVED_UNRESOLVED_SEPARATOR).append(nonResolvedList);
}
coordAction.setMissingDependencies(nonExistList.toString());
if (status == true) {
coordAction.setStatus(CoordinatorAction.Status.READY);
// pass jobID to the CoordActionReadyXCommand
queue(new CoordActionReadyXCommand(coordAction.getJobId()), 100);
}
else {
long waitingTime = (currentTime.getTime() - Math.max(coordAction.getNominalTime().getTime(), coordAction
.getCreatedTime().getTime()))
/ (60 * 1000);
int timeOut = coordAction.getTimeOut();
if ((timeOut >= 0) && (waitingTime > timeOut)) {
queue(new CoordActionTimeOutXCommand(coordAction), 100);
}
else {
queue(new CoordActionInputCheckXCommand(coordAction.getId(), coordAction.getJobId()), getCoordInputCheckRequeueInterval());
}
}
coordAction.setLastModifiedTime(new Date());
jpaService.execute(new org.apache.oozie.executor.jpa.CoordActionUpdateForInputCheckJPAExecutor(coordAction));
}
catch (Exception e) {
throw new CommandException(ErrorCode.E1021, e.getMessage(), e);
}
cron.stop();
return null;
}