Package org.apache.oozie

Examples of org.apache.oozie.CoordinatorActionInfo


    @Override
    public void rerunChildren() throws CommandException {
        boolean isError = false;
        try {
            CoordinatorActionInfo coordInfo = null;
            InstrumentUtils.incrJobCounter(getName(), 1, getInstrumentation());
            List<CoordinatorActionBean> coordActions;
            if (rerunType.equals(RestConstants.JOB_COORD_RERUN_DATE)) {
                coordActions = getCoordActionsFromDates(jobId, scope);
            }
            else if (rerunType.equals(RestConstants.JOB_COORD_RERUN_ACTION)) {
                coordActions = getCoordActionsFromIds(jobId, scope);
            }
            else {
                isError = true;
                throw new CommandException(ErrorCode.E1018, "date or action expected.");
            }
            if (checkAllActionsRunnable(coordActions)) {
                for (CoordinatorActionBean coordAction : coordActions) {
                    String actionXml = coordAction.getActionXml();
                    if (!noCleanup) {
                        Element eAction = XmlUtils.parseXml(actionXml);
                        cleanupOutputEvents(eAction, coordJob.getUser(), coordJob.getGroup());
                    }
                    if (refresh) {
                        refreshAction(coordJob, coordAction);
                    }
                    updateAction(coordJob, coordAction, actionXml);

                    queue(new CoordActionNotificationXCommand(coordAction), 100);
                    queue(new CoordActionInputCheckXCommand(coordAction.getId()), 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;
View Full Code Here


            List<CoordinatorAction> actions = coordJobs.get(idx).getActions();
            List<CoordinatorActionBean> actionBeans = new ArrayList<CoordinatorActionBean>();
            for (CoordinatorAction action : actions) {
                actionBeans.add((CoordinatorActionBean) action);
            }
            return new CoordinatorActionInfo(actionBeans);
        }
View Full Code Here

        XLog.getLog(getClass()).info(
                "Rerun coordinator for jobId=" + jobId + ", rerunType=" + rerunType + ",scope=" + scope + ",refresh="
                        + refresh + ", noCleanup=" + noCleanup);

        try {
            CoordinatorActionInfo coordInfo = coordEngine.reRun(jobId, rerunType, scope, Boolean.valueOf(refresh),
                    Boolean.valueOf(noCleanup));
            List<CoordinatorActionBean> actions = coordInfo.getCoordActions();
            json.put(JsonTags.COORDINATOR_ACTIONS, CoordinatorActionBean.toJSONArray(actions));
        }
        catch (BaseEngineException ex) {
            throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
        }
View Full Code Here

    @Override
    protected CoordinatorActionInfo call(CoordinatorStore store) throws StoreException, CommandException {
        try {
            CoordinatorJobBean coordJob = store.getCoordinatorJob(jobId, false);
            CoordinatorActionInfo coordInfo = null;
            setLogInfo(coordJob);
            if (coordJob.getStatus() != CoordinatorJob.Status.KILLED
                    && coordJob.getStatus() != CoordinatorJob.Status.FAILED) {
                incrJobCounter(1);

                List<CoordinatorActionBean> coordActions;
                if (rerunType.equals(RestConstants.JOB_COORD_RERUN_DATE)) {
                    coordActions = getCoordActionsFromDates(jobId, scope, store);
                }
                else if (rerunType.equals(RestConstants.JOB_COORD_RERUN_ACTION)) {
                    coordActions = getCoordActionsFromIds(jobId, scope, store);
                }
                else {
                    throw new CommandException(ErrorCode.E1018, "date or action expected.");
                }
                if (checkAllActionsRunnable(coordActions)) {
                    Configuration conf = new XConfiguration(new StringReader(coordJob.getConf()));
                    for (CoordinatorActionBean coordAction : coordActions) {
                        String actionXml = coordAction.getActionXml();
                        if (!noCleanup) {
                            Element eAction = XmlUtils.parseXml(actionXml);
                            cleanupOutputEvents(eAction, coordJob.getUser(), coordJob.getGroup(), conf);
                        }
                        if (refresh) {
                            refreshAction(coordJob, coordAction, store);
                        }
                        updateAction(coordJob, coordAction, actionXml, store);

                        // TODO: time 100s should be configurable
                        queueCallable(new CoordActionNotification(coordAction), 100);
                        CoordActionInputCheckCommand.queue(new CoordActionInputCheckCommand(coordAction.getId()), 100);
                    }
                }
                else {
                    throw new CommandException(ErrorCode.E1018, "part or all actions are not eligible to rerun!");
                }
                coordInfo = new CoordinatorActionInfo(coordActions);
            }
            else {
                log.info("CoordRerunCommand is not able to run, job status=" + coordJob.getStatus() + ", jobid="
                        + jobId);
                throw new CommandException(ErrorCode.E1018,
View Full Code Here

    }

    @Override
    protected CoordinatorActionInfo execute(CoordinatorStore store) throws StoreException, CommandException {
        log.info("STARTED CoordRerunCommand for jobId=" + jobId + ", scope=" + scope);
        CoordinatorActionInfo coordInfo = null;
        try {
            if (lock(jobId)) {
                coordInfo = call(store);
            }
            else {
View Full Code Here

            List<CoordinatorAction> actions = coordJobs.get(idx).getActions();
            List<CoordinatorActionBean> actionBeans = new ArrayList<CoordinatorActionBean>();
            for (CoordinatorAction action : actions) {
                actionBeans.add((CoordinatorActionBean) action);
            }
            return new CoordinatorActionInfo(actionBeans);
        }
View Full Code Here

            List<CoordinatorAction> actions = coordJobs.get(idx).getActions();
            List<CoordinatorActionBean> actionBeans = new ArrayList<CoordinatorActionBean>();
            for (CoordinatorAction action : actions) {
                actionBeans.add((CoordinatorActionBean) action);
            }
            return new CoordinatorActionInfo(actionBeans);
        }
View Full Code Here

                CoordinatorXCommand.generateEvent(coordAction, coordJob.getUser(), coordJob.getAppName(),
                        coordAction.getCreatedTime());
            }
            queue(new CoordActionNotificationXCommand(coordAction), 100);
        }
        CoordinatorActionInfo coordInfo = new CoordinatorActionInfo(coordActions);
        ret = coordInfo;
    }
View Full Code Here

    @Override
    public void rerunChildren() throws CommandException {
        boolean isError = false;
        try {
            CoordinatorActionInfo coordInfo = null;
            InstrumentUtils.incrJobCounter(getName(), 1, getInstrumentation());
            List<CoordinatorActionBean> coordActions = CoordUtils.getCoordActions(rerunType, jobId, scope, false);
            if (checkAllActionsRunnable(coordActions)) {
                for (CoordinatorActionBean coordAction : coordActions) {
                    String actionXml = coordAction.getActionXml();
                    if (!noCleanup) {
                        Element eAction = XmlUtils.parseXml(actionXml);
                        cleanupOutputEvents(eAction, coordJob.getUser(), coordJob.getGroup());
                    }
                    if (refresh) {
                        refreshAction(coordJob, coordAction);
                    }
                    updateAction(coordJob, coordAction);
                    if (SLAService.isEnabled()) {
                        SLAOperations.updateRegistrationEvent(coordAction.getId());
                    }
                    queue(new CoordActionNotificationXCommand(coordAction), 100);
                    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;
View Full Code Here

            List<CoordinatorAction> actions = coordJobs.get(idx).getActions();
            List<CoordinatorActionBean> actionBeans = new ArrayList<CoordinatorActionBean>();
            for (CoordinatorAction action : actions) {
                actionBeans.add((CoordinatorActionBean) action);
            }
            return new CoordinatorActionInfo(actionBeans);

        }
View Full Code Here

TOP

Related Classes of org.apache.oozie.CoordinatorActionInfo

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.