use of org.apache.oozie.executor.jpa.CoordJobGetActionsSuspendedJPAExecutor in project oozie by apache.
the class CoordResumeXCommand method resumeChildren.
@Override
public void resumeChildren() throws CommandException {
try {
// Get all suspended actions to resume them
List<CoordinatorActionBean> actionList = jpaService.execute(new CoordJobGetActionsSuspendedJPAExecutor(jobId));
for (CoordinatorActionBean action : actionList) {
if (action.getExternalId() != null) {
// queue a ResumeXCommand
queue(new ResumeXCommand(action.getExternalId()));
updateCoordAction(action);
LOG.debug("Resume coord action = [{0}], new status = [{1}], pending = [{2}] and queue ResumeXCommand for [{3}]", action.getId(), action.getStatus(), action.getPending(), action.getExternalId());
} else {
updateCoordAction(action);
LOG.debug("Resume coord action = [{0}], new status = [{1}], pending = [{2}] and external id is null", action.getId(), action.getStatus(), action.getPending());
}
}
} catch (XException ex) {
exceptionOccured = true;
throw new CommandException(ex);
} finally {
if (exceptionOccured) {
coordJob.setStatus(CoordinatorJob.Status.FAILED);
coordJob.resetPending();
LOG.warn("Resume children failed so fail coordinator, coordinator job id = " + jobId + ", status = " + coordJob.getStatus());
updateList.add(new UpdateEntry<CoordJobQuery>(CoordJobQuery.UPDATE_COORD_JOB_STATUS_PENDING_TIME, coordJob));
}
}
}
Aggregations