use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class CoordRerunXCommand method loadState.
/* (non-Javadoc)
* @see org.apache.oozie.command.XCommand#loadState()
*/
@Override
protected void loadState() throws CommandException {
try {
coordJob = CoordJobQueryExecutor.getInstance().get(CoordJobQuery.GET_COORD_JOB, jobId);
prevPending = coordJob.isPending();
} catch (JPAExecutorException je) {
throw new CommandException(je);
}
LogUtils.setLogInfo(coordJob);
}
use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class ActionCheckXCommand method loadState.
@Override
protected void loadState() throws CommandException {
try {
this.wfJob = WorkflowJobQueryExecutor.getInstance().get(WorkflowJobQuery.GET_WORKFLOW_ACTION_OP, jobId);
this.wfAction = WorkflowActionQueryExecutor.getInstance().get(WorkflowActionQuery.GET_ACTION_CHECK, actionId);
} catch (JPAExecutorException e) {
throw new CommandException(e);
}
LogUtils.setLogInfo(wfJob);
LogUtils.setLogInfo(wfAction);
}
use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class BundleStartXCommand method startCoordJobs.
/**
* Start Coord Jobs
*
* @throws CommandException thrown if failed to start coord jobs
*/
@SuppressWarnings("unchecked")
private void startCoordJobs() throws CommandException {
if (bundleJob != null) {
try {
Element bAppXml = XmlUtils.parseXml(bundleJob.getJobXml());
List<Element> coordElems = bAppXml.getChildren("coordinator", bAppXml.getNamespace());
for (Element coordElem : coordElems) {
Attribute name = coordElem.getAttribute("name");
Configuration coordConf = mergeConfig(coordElem);
coordConf.set(OozieClient.BUNDLE_ID, jobId);
if (OozieJobInfo.isJobInfoEnabled()) {
coordConf.set(OozieJobInfo.BUNDLE_NAME, bundleJob.getAppName());
}
// skip coord job if it is not enabled
if (!isEnabled(coordElem, coordConf)) {
continue;
}
String coordName = name.getValue();
try {
coordName = ELUtils.resolveAppName(coordName, coordConf);
} catch (Exception e) {
throw new CommandException(ErrorCode.E1321, e.getMessage(), e);
}
queue(new BundleCoordSubmitXCommand(coordConf, bundleJob.getId(), name.getValue()));
}
updateBundleAction();
} catch (JDOMException jex) {
throw new CommandException(ErrorCode.E1301, jex.getMessage(), jex);
} catch (JPAExecutorException je) {
throw new CommandException(je);
}
} else {
throw new CommandException(ErrorCode.E0604, jobId);
}
}
use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class CoordWfActionInfoXCommand method execute.
@Override
protected List<CoordinatorWfActionBean> execute() throws CommandException {
List<CoordinatorWfActionBean> coordWfActions = new ArrayList<CoordinatorWfActionBean>();
for (CoordinatorActionBean coordAction : coordActions) {
String wfId = coordAction.getExternalId();
String nullReason = null;
WorkflowActionBean wfAction = null;
if (wfId != null) {
String wfActionId = wfId + "@" + actionName;
try {
wfAction = jpaService.execute(new WorkflowActionGetJPAExecutor(wfActionId, true));
if (wfAction == null) {
nullReason = CoordinatorWfAction.NullReason.ACTION_NULL.getNullReason(actionName, wfId);
}
} catch (JPAExecutorException ex) {
throw new CommandException(ex);
}
} else {
nullReason = CoordinatorWfAction.NullReason.PARENT_NULL.getNullReason();
LOG.warn(nullReason);
wfAction = null;
}
int actionNumber = coordAction.getActionNumber();
CoordinatorWfActionBean coordWfAction = new CoordinatorWfActionBean(actionNumber, wfAction, nullReason);
coordWfActions.add(coordWfAction);
}
return coordWfActions;
}
use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class SLACoordActionJobEventXCommand method loadState.
@Override
protected void loadState() throws CommandException {
try {
ca = CoordActionQueryExecutor.getInstance().get(CoordActionQuery.GET_COORD_ACTION_FOR_SLA, slaCalc.getId());
if (ca.getExternalId() != null) {
wf = WorkflowJobQueryExecutor.getInstance().get(WorkflowJobQuery.GET_WORKFLOW_FOR_SLA, ca.getExternalId());
}
LogUtils.setLogInfo(ca);
} catch (JPAExecutorException e) {
throw new CommandException(e);
}
}
Aggregations