use of org.apache.oozie.executor.jpa.CoordActionsCountForJobIdJPAExecutor in project oozie by apache.
the class CoordJobXCommand method execute.
/* (non-Javadoc)
* @see org.apache.oozie.command.XCommand#execute()
*/
@Override
protected CoordinatorJobBean execute() throws CommandException {
try {
JPAService jpaService = Services.get().get(JPAService.class);
CoordinatorJobBean coordJob = null;
if (jpaService != null) {
coordJob = jpaService.execute(new CoordJobGetJPAExecutor(id));
if (getActionInfo) {
int numAction = jpaService.execute(new CoordActionsCountForJobIdJPAExecutor(id, filterMap));
List<CoordinatorActionBean> coordActions = null;
if (len == 0) {
coordActions = new ArrayList<CoordinatorActionBean>();
} else {
coordActions = jpaService.execute(new CoordJobGetActionsSubsetJPAExecutor(id, filterMap, offset, len, desc));
}
coordJob.setActions(coordActions);
coordJob.setNumActions(numAction);
}
} else {
LOG.error(ErrorCode.E0610);
}
return coordJob;
} catch (XException ex) {
throw new CommandException(ex);
}
}
Aggregations