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 = getCoordActions(rerunType, jobId, scope);
            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(), 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

        try {
            if (!(rerunType.equals(RestConstants.JOB_COORD_RERUN_DATE) || rerunType
                    .equals(RestConstants.JOB_COORD_RERUN_ACTION))) {
                throw new CommandException(ErrorCode.E1018, "date or action expected.");
            }
            CoordinatorActionInfo coordInfo = coordEngine.reRun(jobId, rerunType, scope, Boolean.valueOf(refresh),
                    Boolean.valueOf(noCleanup));
            List<CoordinatorActionBean> coordActions;
            if (coordInfo != null) {
                coordActions = coordInfo.getCoordActions();
            }
            else {
                coordActions = CoordRerunXCommand.getCoordActions(rerunType, jobId, scope);
            }
            json.put(JsonTags.COORDINATOR_ACTIONS, CoordinatorActionBean.toJSONArray(coordActions));
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 = getCoordActions(rerunType, jobId, scope);
            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(), 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

    @Override
    public void rerunChildren() throws CommandException {
        boolean isError = false;
        try {
            CoordinatorActionInfo coordInfo = null;
            InstrumentUtils.incrJobCounter(getName(), 1, getInstrumentation());
            List<CoordinatorActionBean> coordActions = getCoordActions(rerunType, jobId, scope);
            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(), 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

                stopCron();
                String rerunType = request.getParameter(RestConstants.JOB_COORD_RERUN_TYPE_PARAM);
                String scope = request.getParameter(RestConstants.JOB_COORD_RERUN_SCOPE_PARAM);
                String refresh = request.getParameter(RestConstants.JOB_COORD_RERUN_REFRESH_PARAM);
                String noCleanup = request.getParameter(RestConstants.JOB_COORD_RERUN_NOCLEANUP_PARAM);
                CoordinatorActionInfo coordInfo = coordEngine.reRun(jobId, rerunType, scope, Boolean.valueOf(refresh),
                        Boolean.valueOf(noCleanup));
                List<CoordinatorActionBean> actions = coordInfo.getCoordActions();
                JSONObject json = new JSONObject();
                json.put(JsonTags.COORDINATOR_ACTIONS, CoordinatorActionBean.toJSONArray(actions));
                startCron();
                sendJsonResponse(response, HttpServletResponse.SC_OK, json);
            }
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);
                        queueCallable(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

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.