Package org.apache.oozie.executor.jpa

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


        WorkflowJobBean wfBean = createWorkflow(app, conf, jobStatus, instanceStatus);

        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            assertNotNull(jpaService);
            WorkflowJobInsertJPAExecutor wfInsertCmd = new WorkflowJobInsertJPAExecutor(wfBean);
            jpaService.execute(wfInsertCmd);
        }
        catch (JPAExecutorException je) {
            je.printStackTrace();
            fail("Unable to insert the test wf job record to table");
View Full Code Here


        wfBean.setExternalId("external-id");

        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            assertNotNull(jpaService);
            WorkflowJobInsertJPAExecutor wfInsertCmd = new WorkflowJobInsertJPAExecutor(wfBean);
            jpaService.execute(wfInsertCmd);
        }
        catch (JPAExecutorException je) {
            je.printStackTrace();
            fail("Unable to insert the test wf job record to table");
View Full Code Here

        WorkflowJobBean wfBean = createWorkflow(app, conf, jobStatus, instanceStatus);
        wfBean.setId(wfId);
        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            assertNotNull(jpaService);
            WorkflowJobInsertJPAExecutor wfInsertCmd = new WorkflowJobInsertJPAExecutor(wfBean);
            jpaService.execute(wfInsertCmd);
        }
        catch (JPAExecutorException je) {
            je.printStackTrace();
            fail("Unable to insert the test wf job record to table");
View Full Code Here

        wfBean.setEndTime(DateUtils.parseDateOozieTZ("2015-12-18T03:00Z"));

        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            assertNotNull(jpaService);
            WorkflowJobInsertJPAExecutor wfInsertCmd = new WorkflowJobInsertJPAExecutor(wfBean);
            jpaService.execute(wfInsertCmd);
        }
        catch (JPAExecutorException ce) {
            ce.printStackTrace();
            fail("Unable to insert the test wf job record to table");
View Full Code Here

            workflow.setExternalId(conf.get(OozieClient.EXTERNAL_ID));

            LogUtils.setLogInfo(workflow, logInfo);
            JPAService jpaService = Services.get().get(JPAService.class);
            if (jpaService != null) {
                jpaService.execute(new WorkflowJobInsertJPAExecutor(workflow));
            }
            else {
                LOG.error(ErrorCode.E0610);
                return null;
            }
View Full Code Here

        WorkflowJobBean workflow = createWorkflow(app, conf, WorkflowJob.Status.PREP,
                WorkflowInstance.Status.PREP);
        String executionPath = "/";

        assertNotNull(jpaService);
        WorkflowJobInsertJPAExecutor wfInsertCmd = new WorkflowJobInsertJPAExecutor(workflow);
        jpaService.execute(wfInsertCmd);
        WorkflowActionBean wfAction = addRecordToWfActionTable(workflow.getId(), "one", WorkflowAction.Status.OK,
                executionPath, true);
        wfAction.setPending();
        wfAction.setSignalValue(WorkflowAction.Status.OK.name());
View Full Code Here

        assertEquals(0, ehs.getEventQueue().size());

        WorkflowJobBean wf = new WorkflowJobBean();
        wf.setId(action.getExternalId());
        wf.setStatus(WorkflowJob.Status.KILLED);
        jpa.execute(new WorkflowJobInsertJPAExecutor(wf));
        new CoordActionUpdateXCommand(wf).call();
        assertEquals(1, ehs.getEventQueue().size());

        jobEvent = (CoordinatorActionEvent) ehs.getEventQueue().peek();
        assertEquals(AppType.COORDINATOR_ACTION, jobEvent.getAppType());
View Full Code Here

                CoordinatorAction.Status.WAITING, "coord-action-get.xml", 0);
        WorkflowJobBean extWf = new WorkflowJobBean();
        extWf.setId(action1.getExternalId());
        extWf.setEndTime(new Date(System.currentTimeMillis() - 1 * 1800 * 1000));
        extWf.setStartTime(new Date(System.currentTimeMillis() - 1 * 2100 * 1000));
        jpaService.execute(new WorkflowJobInsertJPAExecutor(extWf));
        sla = _createSLARegistration(action1.getId(), AppType.COORDINATOR_ACTION);
        sla.setExpectedEnd(new Date(System.currentTimeMillis() - 1 * 2000 * 1000)); // past
        slas.addRegistrationEvent(sla);

        // CASE 4: positive test coord action
        CoordinatorActionBean action2 = addRecordToCoordActionTable("coord-action-2", 1,
                CoordinatorAction.Status.FAILED, "coord-action-get.xml", 0);
        extWf = new WorkflowJobBean();
        extWf.setId(action2.getExternalId());
        // actual end before expected. but action is failed
        extWf.setEndTime(new Date(System.currentTimeMillis() - 1 * 1800 * 1000));
        extWf.setStartTime(new Date(System.currentTimeMillis() - 1 * 2000 * 1000));
        jpaService.execute(new WorkflowJobInsertJPAExecutor(extWf));
        sla = _createSLARegistration(action2.getId(), AppType.COORDINATOR_ACTION);
        sla.setExpectedEnd(new Date(System.currentTimeMillis() - 1 * 1500 * 1000));
        slas.addRegistrationEvent(sla);

        // CASE 5: negative test coord action
        CoordinatorActionBean action3 = addRecordToCoordActionTable("coord-action-3", 1,
                CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
        extWf = new WorkflowJobBean();
        extWf.setId(action3.getExternalId());
        extWf.setStartTime(new Date(System.currentTimeMillis() - 1 * 2100 * 1000));
        extWf.setEndTime(new Date(System.currentTimeMillis() - 1 * 1800 * 1000));
        jpaService.execute(new WorkflowJobInsertJPAExecutor(extWf));
        sla = _createSLARegistration(action3.getId(), AppType.COORDINATOR_ACTION);
        sla.setExpectedStart(new Date(System.currentTimeMillis() - 1 * 3600 * 1000)); // cause start_miss
        sla.setExpectedEnd(new Date(System.currentTimeMillis() - 1 * 1500 * 1000)); // in past but > actual end, end_met
        sla.setExpectedDuration(0); //cause duration miss
        slas.addRegistrationEvent(sla);
View Full Code Here

            // System.out.println("SlaXml :"+ slaXml);

            //store.insertWorkflow(workflow);
            JPAService jpaService = Services.get().get(JPAService.class);
            if (jpaService != null) {
                jpaService.execute(new WorkflowJobInsertJPAExecutor(workflow));
            }
            else {
                LOG.error(ErrorCode.E0610);
                return null;
            }
View Full Code Here

            workflow.setExternalId(conf.get(OozieClient.EXTERNAL_ID));

            LogUtils.setLogInfo(workflow, logInfo);
            JPAService jpaService = Services.get().get(JPAService.class);
            if (jpaService != null) {
                jpaService.execute(new WorkflowJobInsertJPAExecutor(workflow));
            }
            else {
                LOG.error(ErrorCode.E0610);
                return null;
            }
View Full Code Here

TOP

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

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.