use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class CoordActionReadyXCommand method loadState.
@Override
protected void loadState() throws CommandException {
jpaService = Services.get().get(JPAService.class);
if (jpaService == null) {
throw new CommandException(ErrorCode.E0610);
}
try {
coordJob = CoordJobQueryExecutor.getInstance().get(CoordJobQuery.GET_COORD_JOB_ACTION_READY, jobId);
} catch (JPAExecutorException e) {
throw new CommandException(e);
}
LogUtils.setLogInfo(coordJob);
}
use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class CoordActionStartXCommand method loadState.
@Override
protected void loadState() throws CommandException {
jpaService = Services.get().get(JPAService.class);
try {
coordAction = jpaService.execute(new org.apache.oozie.executor.jpa.CoordActionGetForStartJPAExecutor(actionId));
} catch (JPAExecutorException je) {
throw new CommandException(je);
}
LogUtils.setLogInfo(coordAction);
}
use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class CoordChangeXCommand method loadState.
/* (non-Javadoc)
* @see org.apache.oozie.command.XCommand#loadState()
*/
@Override
protected void loadState() throws CommandException {
jpaService = Services.get().get(JPAService.class);
if (jpaService == null) {
throw new CommandException(ErrorCode.E0610);
}
try {
this.coordJob = jpaService.execute(new CoordJobGetJPAExecutor(jobId));
oldPauseTime = coordJob.getPauseTime();
prevStatus = coordJob.getStatus();
} catch (JPAExecutorException e) {
throw new CommandException(e);
}
LogUtils.setLogInfo(this.coordJob);
}
use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class DagEngine method reRun.
/**
* Rerun a job.
*
* @param jobId job Id to rerun.
* @param conf configuration information for the rerun.
* @throws DagEngineException thrown if the job could not be rerun.
*/
@Override
public void reRun(String jobId, Configuration conf) throws DagEngineException {
try {
WorkflowJobBean wfBean = WorkflowJobQueryExecutor.getInstance().get(WorkflowJobQuery.GET_WORKFLOW, jobId);
Configuration wfConf = new XConfiguration(new StringReader(wfBean.getConf()));
XConfiguration.copy(conf, wfConf);
validateReRunConfiguration(wfConf);
new ReRunXCommand(jobId, wfConf).call();
} catch (CommandException ex) {
throw new DagEngineException(ex);
} catch (JPAExecutorException ex) {
throw new DagEngineException(ex);
} catch (IOException ex) {
throw new DagEngineException(ErrorCode.E0803, ex.getMessage());
}
}
use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.
the class TestActionStartXCommand method addRecordToWfActionTableWithAppPathConfig.
/**
* Create workflow action with custom action configuration
*
* @param wfId workflow id
* @param actionName action name
* @param status workflow action status
* @return workflow action bean
* @throws Exception thrown if failed to create workflow action
*/
protected WorkflowActionBean addRecordToWfActionTableWithAppPathConfig(String wfId, String actionName, WorkflowAction.Status status) throws Exception {
WorkflowActionBean action = createWorkflowActionWithAppPathConfig(wfId, status);
try {
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
WorkflowActionInsertJPAExecutor actionInsertCmd = new WorkflowActionInsertJPAExecutor(action);
jpaService.execute(actionInsertCmd);
} catch (JPAExecutorException ce) {
ce.printStackTrace();
fail("Unable to insert the test wf action record to table");
throw ce;
}
return action;
}
Aggregations