Package org.apache.oozie.executor.jpa

Examples of org.apache.oozie.executor.jpa.WorkflowJobGetForSLAJPAExecutor


            if (jpaService != null) {
                coordAction = jpaService.execute(new CoordActionGetForCheckJPAExecutor(actionId));
                coordJob = jpaService.execute(new CoordinatorJobGetForUserAppnameJPAExecutor(
                        coordAction.getJobId()));
                workflowJob = jpaService.execute (new WorkflowJobGetForSLAJPAExecutor(coordAction.getExternalId()));
                LogUtils.setLogInfo(coordAction);
            }
            else {
                throw new CommandException(ErrorCode.E0610);
            }
View Full Code Here


            LOG.trace("Coordinator action status is " + coordAction.getStatusStr() + " and summary bean status is "
                    + summaryBean.getJobStatus());
            isJobModified = true;
            summaryBean.setJobStatus(coordAction.getStatusStr());
            if (coordAction.isTerminalStatus()) {
                WorkflowJobBean wfJob = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(coordAction
                        .getExternalId()));
                setEndForSLASummaryBean(summaryBean, wfJob.getStartTime(), coordAction.getLastModifiedTime(),
                        coordAction.getStatusStr());
            }
            else if (coordAction.getStatus() != CoordinatorAction.Status.WAITING) {
                WorkflowJobBean wfJob = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(coordAction
                        .getExternalId()));
                setStartForSLASummaryBean(summaryBean, summaryBean.getEventProcessed(), wfJob.getStartTime());
            }
        }
        return isJobModified;
View Full Code Here

    private boolean processSummaryBeanForWorkflowJob(SLASummaryBean summaryBean, String jobId)
            throws JPAExecutorException {
        boolean isJobModified = false;
        WorkflowJobBean wfJob = null;
        wfJob = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(jobId));
        if (!wfJob.getStatusStr().equals(summaryBean.getJobStatus())) {
            LOG.trace("Workflow job status is " + wfJob.getStatusStr() + "and summary bean status is "
                    + summaryBean.getJobStatus());
            isJobModified = true;
            summaryBean.setJobStatus(wfJob.getStatusStr());
View Full Code Here

    private void confirmWithDB(SLACalcStatus slaCalc) {
        boolean ended = false, isEndMiss = false;
        try {
            switch (slaCalc.getAppType()) {
                case WORKFLOW_JOB:
                    WorkflowJobBean wf = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(slaCalc.getId()));
                    if (wf.getEndTime() != null) {
                        ended = true;
                        if (wf.getStatus() == WorkflowJob.Status.KILLED || wf.getStatus() == WorkflowJob.Status.FAILED
                                || wf.getEndTime().getTime() > slaCalc.getExpectedEnd().getTime()) {
                            isEndMiss = true;
                        }
                    }
                    slaCalc.setActualStart(wf.getStartTime());
                    slaCalc.setActualEnd(wf.getEndTime());
                    slaCalc.setJobStatus(wf.getStatusStr());
                    break;
                case WORKFLOW_ACTION:
                    WorkflowActionBean wa = jpaService.execute(new WorkflowActionGetForSLAJPAExecutor(slaCalc.getId()));
                    if (wa.getEndTime() != null) {
                        ended = true;
                        if (wa.isTerminalWithFailure()
                                || wa.getEndTime().getTime() > slaCalc.getExpectedEnd().getTime()) {
                            isEndMiss = true;
                        }
                    }
                    slaCalc.setActualStart(wa.getStartTime());
                    slaCalc.setActualEnd(wa.getEndTime());
                    slaCalc.setJobStatus(wa.getStatusStr());
                    break;
                case COORDINATOR_ACTION:
                    CoordinatorActionBean ca = jpaService.execute(new CoordActionGetForSLAJPAExecutor(slaCalc.getId()));
                    if (ca.isTerminalWithFailure()) {
                        isEndMiss = ended = true;
                        slaCalc.setActualEnd(ca.getLastModifiedTime());
                    }
                    if (ca.getExternalId() != null) {
                        wf = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(ca.getExternalId()));
                        if (wf.getEndTime() != null) {
                            ended = true;
                            if (wf.getEndTime().getTime() > slaCalc.getExpectedEnd().getTime()) {
                                isEndMiss = true;
                            }
View Full Code Here

        new CoordActionsKillXCommand(ids[0], "action", "1,3").call();
        CoordinatorActionBean action = jpaService.execute(new CoordActionGetForCheckJPAExecutor(ids[1]));
        assertEquals(CoordinatorAction.Status.KILLED, action.getStatus());

        sleep(100);
        WorkflowJobBean wf = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(ids[3]));
        assertEquals(WorkflowJob.Status.KILLED, wf.getStatus());

        CoordinatorJobBean job = jpaService.execute(new CoordJobGetJPAExecutor(ids[0]));
        assertEquals(CoordinatorJob.Status.RUNNING, job.getStatus());
        Runnable runnable = new StatusTransitRunnable();
View Full Code Here

        action = jpaService.execute(new CoordActionGetForCheckJPAExecutor(ids[2]));
        System.out.println(action.getNominalTime());
        assertEquals(CoordinatorAction.Status.KILLED, action.getStatus());

        sleep(100);
        WorkflowJobBean wf = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(ids[3]));
        assertEquals(WorkflowJob.Status.KILLED, wf.getStatus());

        CoordinatorJobBean job = jpaService.execute(new CoordJobGetJPAExecutor(ids[0]));
        assertEquals(CoordinatorJob.Status.RUNNING, job.getStatus());
        Runnable runnable = new StatusTransitRunnable();
View Full Code Here

            LOG.trace("Coordinator action status is " + coordAction.getStatusStr() + " and summary bean status is "
                    + summaryBean.getJobStatus());
            isJobModified = true;
            summaryBean.setJobStatus(coordAction.getStatusStr());
            if (coordAction.isTerminalStatus()) {
                WorkflowJobBean wfJob = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(coordAction
                        .getExternalId()));
                setEndForSLASummaryBean(summaryBean, wfJob.getStartTime(), coordAction.getLastModifiedTime(),
                        coordAction.getStatusStr());
            }
            else if (coordAction.getStatus() != CoordinatorAction.Status.WAITING) {
                WorkflowJobBean wfJob = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(coordAction
                        .getExternalId()));
                setStartForSLASummaryBean(summaryBean, summaryBean.getEventProcessed(), wfJob.getStartTime());
            }
        }
        return isJobModified;
View Full Code Here

    private boolean processSummaryBeanForWorkflowJob(SLASummaryBean summaryBean, String jobId)
            throws JPAExecutorException {
        boolean isJobModified = false;
        WorkflowJobBean wfJob = null;
        wfJob = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(jobId));
        if (!wfJob.getStatusStr().equals(summaryBean.getJobStatus())) {
            LOG.trace("Workflow job status is " + wfJob.getStatusStr() + "and summary bean status is "
                    + summaryBean.getJobStatus());
            isJobModified = true;
            summaryBean.setJobStatus(wfJob.getStatusStr());
View Full Code Here

    private void confirmWithDB(SLACalcStatus slaCalc) {
        boolean ended = false, isEndMiss = false;
        try {
            switch (slaCalc.getAppType()) {
                case WORKFLOW_JOB:
                    WorkflowJobBean wf = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(slaCalc.getId()));
                    if (wf.getEndTime() != null) {
                        ended = true;
                        if (wf.getStatus() == WorkflowJob.Status.KILLED || wf.getStatus() == WorkflowJob.Status.FAILED
                                || wf.getEndTime().getTime() > slaCalc.getExpectedEnd().getTime()) {
                            isEndMiss = true;
                        }
                    }
                    slaCalc.setActualStart(wf.getStartTime());
                    slaCalc.setActualEnd(wf.getEndTime());
                    slaCalc.setJobStatus(wf.getStatusStr());
                    break;
                case WORKFLOW_ACTION:
                    WorkflowActionBean wa = jpaService.execute(new WorkflowActionGetForSLAJPAExecutor(slaCalc.getId()));
                    if (wa.getEndTime() != null) {
                        ended = true;
                        if (wa.isTerminalWithFailure()
                                || wa.getEndTime().getTime() > slaCalc.getExpectedEnd().getTime()) {
                            isEndMiss = true;
                        }
                    }
                    slaCalc.setActualStart(wa.getStartTime());
                    slaCalc.setActualEnd(wa.getEndTime());
                    slaCalc.setJobStatus(wa.getStatusStr());
                    break;
                case COORDINATOR_ACTION:
                    CoordinatorActionBean ca = jpaService.execute(new CoordActionGetForSLAJPAExecutor(slaCalc.getId()));
                    if (ca.isTerminalWithFailure()) {
                        isEndMiss = ended = true;
                        slaCalc.setActualStart(null);
                        slaCalc.setActualEnd(ca.getLastModifiedTime());
                    }
                    if (ca.getExternalId() != null) {
                        wf = jpaService.execute(new WorkflowJobGetForSLAJPAExecutor(ca.getExternalId()));
                        if (wf.getEndTime() != null) {
                            ended = true;
                            if (wf.getEndTime().getTime() > slaCalc.getExpectedEnd().getTime()) {
                                isEndMiss = true;
                            }
View Full Code Here

            if (jpaService != null) {
                coordAction = jpaService.execute(new CoordActionGetForCheckJPAExecutor(actionId));
                coordJob = jpaService.execute(new CoordinatorJobGetForUserAppnameJPAExecutor(
                        coordAction.getJobId()));
                workflowJob = jpaService.execute (new WorkflowJobGetForSLAJPAExecutor(coordAction.getExternalId()));
                LogUtils.setLogInfo(coordAction, logInfo);
            }
            else {
                throw new CommandException(ErrorCode.E0610);
            }
View Full Code Here

TOP

Related Classes of org.apache.oozie.executor.jpa.WorkflowJobGetForSLAJPAExecutor

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.