Package org.apache.oozie.command

Examples of org.apache.oozie.command.CommandException


            }

            return workflow.getId();
        }
        catch (WorkflowException ex) {
            throw new CommandException(ex);
        }
        catch (Exception ex) {
            throw new CommandException(ErrorCode.E0803, ex);
        }
    }
View Full Code Here


                this.wfAction = jpaService.execute(new WorkflowActionGetJPAExecutor(actionId));
                LogUtils.setLogInfo(wfJob, logInfo);
                LogUtils.setLogInfo(wfAction, logInfo);
            }
            else {
                throw new CommandException(ErrorCode.E0610);
            }
        }
        catch (XException ex) {
            throw new CommandException(ex);
        }
    }
View Full Code Here

                    try {
                        jpaService.execute(new WorkflowActionUpdateJPAExecutor(wfAction));
                        jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfJob));
                    }
                    catch (JPAExecutorException je) {
                        throw new CommandException(je);
                    }
                    // What will happen to WF and COORD_ACTION, NOTIFICATION?
                    SLADbXOperations.writeStausEvent(wfAction.getSlaXml(), wfAction.getId(), Status.FAILED,
                            SlaAppType.WORKFLOW_ACTION);
                    LOG.warn("Exception while executing kill(). Error Code [{0}], Message[{1}]",
                            ex.getErrorCode(), ex.getMessage(), ex);
                }
                catch (JPAExecutorException je) {
                    throw new CommandException(je);
                }
            }
        }
        LOG.debug("ENDED WorkflowActionKillXCommand for action " + actionId);
        return null;
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 CoordJobGetJPAExecutor(jobId));
        }
        catch (JPAExecutorException e) {
            throw new CommandException(e);
        }
        setJob(coordJob);
        prevStatus = coordJob.getStatus();
        LogUtils.setLogInfo(coordJob, logInfo);
    }
View Full Code Here

                + coordJob.isPending());
        try {
            jpaService.execute(new CoordJobUpdateJPAExecutor(coordJob));
        }
        catch (JPAExecutorException e) {
            throw new CommandException(e);
        }
    }
View Full Code Here

            }

        }
        catch (XException ex) {
            exceptionOccured = true;
            throw new CommandException(ex);
        }
        finally {
            if (exceptionOccured) {
                coordJob.setStatus(CoordinatorJob.Status.FAILED);
                coordJob.resetPending();
View Full Code Here

        action.setLastModifiedTime(new Date());
        try {
            jpaService.execute(new CoordActionUpdateStatusJPAExecutor(action));
        }
        catch (JPAExecutorException e) {
            throw new CommandException(e);
        }
    }
View Full Code Here

            }
            LOG.debug("ENDED CoordActionUpdateXCommand for wfId=" + workflow.getId());
        }
        catch (XException ex) {
            LOG.warn("CoordActionUpdate Failed ", ex.getMessage());
            throw new CommandException(ex);
        }
        return null;
    }
View Full Code Here

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

        int retries = 0;
        while (retries++ < maxRetries) {
            try {
View Full Code Here

            try {
                newWfInstance = workflowLib.createInstance(app, conf, jobId);
            }
            catch (WorkflowException e) {
                throw new CommandException(e);
            }
            wfBean.setAppName(app.getName());
            wfBean.setProtoActionConf(protoActionConf.toXmlString());
        }
        catch (WorkflowException ex) {
            throw new CommandException(ex);
        }
        catch (IOException ex) {
            throw new CommandException(ErrorCode.E0803, ex);
        }
        catch (HadoopAccessorException ex) {
            throw new CommandException(ex);
        }
        catch (URISyntaxException ex) {
            throw new CommandException(ErrorCode.E0711, ex.getMessage(), ex);
        }

        try {
            for (int i = 0; i < actions.size(); i++) {
                if (!nodesToSkip.contains(actions.get(i).getName())) {
                    jpaService.execute(new WorkflowActionDeleteJPAExecutor(actions.get(i).getId()));
                    LOG.info("Deleting Action[{0}] for re-run", actions.get(i).getId());
                }
                else {
                    copyActionData(newWfInstance, oldWfInstance);
                }
            }

            wfBean.setAppPath(conf.get(OozieClient.APP_PATH));
            wfBean.setConf(XmlUtils.prettyPrint(conf).toString());
            wfBean.setLogToken(conf.get(OozieClient.LOG_TOKEN, ""));
            wfBean.setUser(conf.get(OozieClient.USER_NAME));
            String group = ConfigUtils.getWithDeprecatedCheck(conf, OozieClient.JOB_ACL, OozieClient.GROUP_NAME, null);
            wfBean.setGroup(group);
            wfBean.setExternalId(conf.get(OozieClient.EXTERNAL_ID));
            wfBean.setEndTime(null);
            wfBean.setRun(wfBean.getRun() + 1);
            wfBean.setStatus(WorkflowJob.Status.PREP);
            wfBean.setWorkflowInstance(newWfInstance);
            jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfBean));
        }
        catch (JPAExecutorException e) {
            throw new CommandException(e);
        }

        return null;
    }
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.