Search in sources :

Example 96 with JPAExecutorException

use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.

the class CoordResumeXCommand method loadState.

@Override
protected void loadState() throws CommandException {
    jpaService = Services.get().get(JPAService.class);
    if (jpaService == null) {
        throw new CommandException(ErrorCode.E0610);
    }
    try {
        coordJob = jpaService.execute(new CoordJobGetJPAExecutor(jobId));
    } catch (JPAExecutorException e) {
        throw new CommandException(e);
    }
    setJob(coordJob);
    prevStatus = coordJob.getStatus();
    LogUtils.setLogInfo(coordJob);
}
Also used : JPAExecutorException(org.apache.oozie.executor.jpa.JPAExecutorException) CoordJobGetJPAExecutor(org.apache.oozie.executor.jpa.CoordJobGetJPAExecutor) CommandException(org.apache.oozie.command.CommandException) JPAService(org.apache.oozie.service.JPAService)

Example 97 with JPAExecutorException

use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.

the class CoordActionInputCheckXCommand method loadState.

@Override
protected void loadState() throws CommandException {
    if (jpaService == null) {
        jpaService = Services.get().get(JPAService.class);
    }
    try {
        coordAction = jpaService.execute(new CoordActionGetForInputCheckJPAExecutor(actionId));
        coordJob = CoordJobQueryExecutor.getInstance().get(CoordJobQuery.GET_COORD_JOB_INPUT_CHECK, coordAction.getJobId());
    } catch (JPAExecutorException je) {
        throw new CommandException(je);
    }
    LogUtils.setLogInfo(coordAction);
}
Also used : JPAExecutorException(org.apache.oozie.executor.jpa.JPAExecutorException) CoordActionGetForInputCheckJPAExecutor(org.apache.oozie.executor.jpa.CoordActionGetForInputCheckJPAExecutor) CommandException(org.apache.oozie.command.CommandException) JPAService(org.apache.oozie.service.JPAService)

Example 98 with JPAExecutorException

use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.

the class CoordActionSkipXCommand method loadState.

@Override
protected void loadState() throws CommandException {
    jpaService = Services.get().get(JPAService.class);
    if (jpaService == null) {
        throw new CommandException(ErrorCode.E0610);
    }
    try {
        actionBean = jpaService.execute(new CoordActionGetForTimeoutJPAExecutor(actionBean.getId()));
    } catch (JPAExecutorException e) {
        throw new CommandException(e);
    }
    LogUtils.setLogInfo(actionBean);
}
Also used : JPAExecutorException(org.apache.oozie.executor.jpa.JPAExecutorException) CoordActionGetForTimeoutJPAExecutor(org.apache.oozie.executor.jpa.CoordActionGetForTimeoutJPAExecutor) CommandException(org.apache.oozie.command.CommandException) JPAService(org.apache.oozie.service.JPAService)

Example 99 with JPAExecutorException

use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.

the class CoordActionTimeOutXCommand method execute.

/* (non-Javadoc)
     * @see org.apache.oozie.command.XCommand#execute()
     */
@Override
protected Void execute() throws CommandException {
    if (actionBean.getStatus() == CoordinatorAction.Status.WAITING) {
        actionBean.setStatus(CoordinatorAction.Status.TIMEDOUT);
        try {
            queue(new CoordActionNotificationXCommand(actionBean), 100);
            actionBean.setLastModifiedTime(new Date());
            CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION_STATUS_PENDING_TIME, actionBean);
            if (EventHandlerService.isEnabled()) {
                generateEvent(actionBean, user, appName, null);
            }
        } catch (JPAExecutorException e) {
            throw new CommandException(e);
        }
    }
    return null;
}
Also used : JPAExecutorException(org.apache.oozie.executor.jpa.JPAExecutorException) CommandException(org.apache.oozie.command.CommandException) Date(java.util.Date)

Example 100 with JPAExecutorException

use of org.apache.oozie.executor.jpa.JPAExecutorException in project oozie by apache.

the class CoordMaterializeTransitionXCommand 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) {
        LOG.error(ErrorCode.E0610);
    }
    try {
        coordJob = CoordJobQueryExecutor.getInstance().get(CoordJobQuery.GET_COORD_JOB_MATERIALIZE, jobId);
        prevStatus = coordJob.getStatus();
    } catch (JPAExecutorException jex) {
        throw new CommandException(jex);
    }
    // calculate start materialize and end materialize time
    calcMatdTime();
    LogUtils.setLogInfo(coordJob);
}
Also used : JPAExecutorException(org.apache.oozie.executor.jpa.JPAExecutorException) CommandException(org.apache.oozie.command.CommandException) JPAService(org.apache.oozie.service.JPAService)

Aggregations

JPAExecutorException (org.apache.oozie.executor.jpa.JPAExecutorException)195 JPAService (org.apache.oozie.service.JPAService)137 CoordinatorJobBean (org.apache.oozie.CoordinatorJobBean)65 CommandException (org.apache.oozie.command.CommandException)63 CoordinatorActionBean (org.apache.oozie.CoordinatorActionBean)55 Date (java.util.Date)53 CoordJobGetJPAExecutor (org.apache.oozie.executor.jpa.CoordJobGetJPAExecutor)49 WorkflowActionBean (org.apache.oozie.WorkflowActionBean)45 WorkflowJobBean (org.apache.oozie.WorkflowJobBean)43 CoordActionGetJPAExecutor (org.apache.oozie.executor.jpa.CoordActionGetJPAExecutor)37 WorkflowJobGetJPAExecutor (org.apache.oozie.executor.jpa.WorkflowJobGetJPAExecutor)33 WorkflowActionGetJPAExecutor (org.apache.oozie.executor.jpa.WorkflowActionGetJPAExecutor)31 IOException (java.io.IOException)26 BundleJobBean (org.apache.oozie.BundleJobBean)24 CoordJobInsertJPAExecutor (org.apache.oozie.executor.jpa.CoordJobInsertJPAExecutor)19 BundleActionBean (org.apache.oozie.BundleActionBean)18 Configuration (org.apache.hadoop.conf.Configuration)15 BundleJobGetJPAExecutor (org.apache.oozie.executor.jpa.BundleJobGetJPAExecutor)15 BundleActionGetJPAExecutor (org.apache.oozie.executor.jpa.BundleActionGetJPAExecutor)14 XConfiguration (org.apache.oozie.util.XConfiguration)14