Package org.apache.oozie.command

Examples of org.apache.oozie.command.CommandException


                    queue(new CoordActionInputCheckXCommand(coordAction.getId(), coordAction.getJobId()), 100);
                }
            }
            else {
                isError = true;
                throw new CommandException(ErrorCode.E1018, "part or all actions are not eligible to rerun!");
            }
            coordInfo = new CoordinatorActionInfo(coordActions);

            ret = coordInfo;
        }
        catch (XException xex) {
            isError = true;
            throw new CommandException(xex);
        }
        catch (JDOMException jex) {
            isError = true;
            throw new CommandException(ErrorCode.E0700, jex);
        }
        catch (Exception ex) {
            isError = true;
            throw new CommandException(ErrorCode.E1018, ex);
        }
        finally{
            if(isError){
                transitToPrevious();
            }
View Full Code Here


            }

            jpaService.execute(new CoordJobUpdateJPAExecutor(coordJob));
        }
        catch (JPAExecutorException je) {
            throw new CommandException(je);
        }
    }
View Full Code Here

                                    }
                                }
                            }
                        }
                        catch (JDOMException jex) {
                            throw new CommandException(ErrorCode.E1301, jex);
                        }
                        catch (JPAExecutorException je) {
                            throw new CommandException(je);
                        }
                    }
                    else if(baction.getStatus() == Job.Status.KILLED){
                        queueCallable(new CoordKillXCommand(baction.getCoordId()));
                    }
View Full Code Here

         * @throws CommandException
         */
        private void runWFActionCheck() throws CommandException {
            JPAService jpaService = Services.get().get(JPAService.class);
            if (jpaService == null) {
                throw new CommandException(ErrorCode.E0610);
            }

            List<WorkflowActionBean> actions;
            try {
                actions = jpaService
                        .execute(new WorkflowActionsRunningGetJPAExecutor(actionCheckDelay));
            }
            catch (JPAExecutorException je) {
                throw new CommandException(je);
            }

            if (actions == null || actions.size() == 0) {
                return;
            }
View Full Code Here

         * @throws CommandException
         */
        private void runCoordActionCheck() throws CommandException {
            JPAService jpaService = Services.get().get(JPAService.class);
            if (jpaService == null) {
                throw new CommandException(ErrorCode.E0610);
            }

            List<String> cactionIds;
            try {
                cactionIds = jpaService.execute(new CoordActionsRunningGetJPAExecutor(
                        actionCheckDelay));
            }
            catch (JPAExecutorException je) {
                throw new CommandException(je);
            }

            if (cactionIds == null || cactionIds.size() == 0) {
                return;
            }
View Full Code Here

     */
    @Override
    protected void loadState() throws CommandException {
        jpaService = Services.get().get(JPAService.class);
        if (jpaService == null) {
            throw new CommandException(ErrorCode.E0610);
        }

        try {
            bundleJob = jpaService.execute(new BundleJobGetJPAExecutor(jobId));
        }
        catch (Exception Ex) {
            throw new CommandException(ErrorCode.E0604, jobId);
        }

        try {
            bundleActions = jpaService.execute(new BundleActionsGetJPAExecutor(jobId));
        }
        catch (Exception Ex) {
            throw new CommandException(ErrorCode.E1311, jobId);
        }

        LogUtils.setLogInfo(bundleJob, logInfo);
    }
View Full Code Here

            int numRunningJobs;
            try {
                numRunningJobs = jpaService.execute(new CoordJobGetRunningActionsCountJPAExecutor(jobId));
            }
            catch (JPAExecutorException je) {
                throw new CommandException(je);
            }

            numActionsToStart = jobConcurrency - numRunningJobs;
            if (numActionsToStart < 0) {
                numActionsToStart = 0;
            }
            log.debug("concurrency=" + jobConcurrency + ", execution=" + jobExecution + ", numRunningJobs="
                    + numRunningJobs + ", numLeftover=" + numActionsToStart);
            // no actions to start
            if (numActionsToStart == 0) {
                log.warn("No actions to start! for jobId=" + jobId);
                return null;
            }
        }
        // get list of actions that are READY and fit in the concurrency and execution

        List<CoordinatorActionBean> actions;
        try {
            actions = jpaService.execute(new CoordJobGetReadyActionsJPAExecutor(jobId, numActionsToStart, jobExecution));
        }
        catch (JPAExecutorException je) {
            throw new CommandException(je);
        }
        log.debug("Number of READY actions = " + actions.size());
        String user = coordJob.getUser();
        String authToken = coordJob.getAuthToken();
        // make sure auth token is not null
        // log.denug("user=" + user + ", token=" + authToken);
        int counter = 0;
        for (CoordinatorActionBean action : actions) {
            // continue if numActionsToStart is negative (no limit on number of
            // actions), or if the counter is less than numActionsToStart
            if ((numActionsToStart < 0) || (counter < numActionsToStart)) {
                log.debug("Set status to SUBMITTED for id: " + action.getId());
                // change state of action to SUBMITTED
                action.setStatus(CoordinatorAction.Status.SUBMITTED);
                // queue action to start action
                queue(new CoordActionStartXCommand(action.getId(), user, authToken, action.getJobId()), 100);
                try {
                    jpaService.execute(new org.apache.oozie.executor.jpa.CoordActionUpdateStatusJPAExecutor(action));
                }
                catch (JPAExecutorException je) {
                    throw new CommandException(je);
                }
            }
            else {
                break;
            }
View Full Code Here

        LOG.debug("Suspend bundle job id = " + jobId + ", status = " + bundleJob.getStatus() + ", pending = " + bundleJob.isPending());
        try {
            jpaService.execute(new BundleJobUpdateJPAExecutor(bundleJob));
        }
        catch (JPAExecutorException e) {
            throw new CommandException(e);
        }
    }
View Full Code Here

    @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 org.apache.oozie.executor.jpa.CoordJobGetJPAExecutor(jobId));
        }
        catch (JPAExecutorException e) {
            throw new CommandException(e);
        }
        LogUtils.setLogInfo(coordJob, logInfo);
    }
View Full Code Here

                }
            }
            LOG.debug("Suspended bundle actions for the bundle=[{0}]", jobId);
        }
        catch (XException ex) {
            throw new CommandException(ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.oozie.command.CommandException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.