Package org.apache.oozie.service

Examples of org.apache.oozie.service.JPAService.execute()


        CoordActionGetJPAExecutor coordActionGetCmd = new CoordActionGetJPAExecutor(action1.getId());
        action1 = jpaService.execute(coordActionGetCmd);
        assertNotSame(action1.getStatus(), CoordinatorAction.Status.FAILED);

        coordActionGetCmd = new CoordActionGetJPAExecutor(action2.getId());
        action2 = jpaService.execute(coordActionGetCmd);
        assertNotSame(action2.getStatus(), CoordinatorAction.Status.SUCCEEDED);
    }

    /**
     * Tests functionality of the coord rerun for backward support is true. </p> Insert a coordinator job with SUCCEEDED
View Full Code Here


                false, 3);

        final JPAService jpaService = Services.get().get(JPAService.class);
        assertNotNull(jpaService);
        coordJob.setAppNamespace(SchemaService.COORDINATOR_NAMESPACE_URI_1);
        jpaService.execute(new CoordJobUpdateJPAExecutor(coordJob));

        CoordinatorActionBean action1 = addRecordToCoordActionTable(coordJob.getId(), 1,
                CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);
        CoordinatorActionBean action2 = addRecordToCoordActionTable(coordJob.getId(), 2,
                CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);
View Full Code Here

        final OozieClient coordClient = LocalOozie.getCoordClient();
        coordClient.reRunCoord(coordJob.getId(), RestConstants.JOB_COORD_RERUN_ACTION, rerunScope, false, true);

        CoordJobGetJPAExecutor coordJobGetCmd = new CoordJobGetJPAExecutor(coordJob.getId());
        coordJob = jpaService.execute(coordJobGetCmd);
        assertEquals(CoordinatorJob.Status.SUCCEEDED, coordJob.getStatus());

        CoordActionGetJPAExecutor coordActionGetCmd = new CoordActionGetJPAExecutor(action1.getId());
        action1 = jpaService.execute(coordActionGetCmd);
        assertNotSame(action1.getStatus(), CoordinatorAction.Status.SUCCEEDED);
View Full Code Here

        CoordJobGetJPAExecutor coordJobGetCmd = new CoordJobGetJPAExecutor(coordJob.getId());
        coordJob = jpaService.execute(coordJobGetCmd);
        assertEquals(CoordinatorJob.Status.SUCCEEDED, coordJob.getStatus());

        CoordActionGetJPAExecutor coordActionGetCmd = new CoordActionGetJPAExecutor(action1.getId());
        action1 = jpaService.execute(coordActionGetCmd);
        assertNotSame(action1.getStatus(), CoordinatorAction.Status.SUCCEEDED);

        coordActionGetCmd = new CoordActionGetJPAExecutor(action2.getId());
        action2 = jpaService.execute(coordActionGetCmd);
        assertNotSame(action2.getStatus(), CoordinatorAction.Status.SUCCEEDED);
View Full Code Here

        CoordActionGetJPAExecutor coordActionGetCmd = new CoordActionGetJPAExecutor(action1.getId());
        action1 = jpaService.execute(coordActionGetCmd);
        assertNotSame(action1.getStatus(), CoordinatorAction.Status.SUCCEEDED);

        coordActionGetCmd = new CoordActionGetJPAExecutor(action2.getId());
        action2 = jpaService.execute(coordActionGetCmd);
        assertNotSame(action2.getStatus(), CoordinatorAction.Status.SUCCEEDED);
    }

    protected CoordinatorJobBean addRecordToCoordJobTableWithPausedTime(CoordinatorJob.Status status, boolean pending,
            boolean doneMatd, Date pausedTime) throws Exception {
View Full Code Here

        coordJob.setPauseTime(pausedTime);
        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            assertNotNull(jpaService);
            CoordJobInsertJPAExecutor coordInsertCmd = new CoordJobInsertJPAExecutor(coordJob);
            jpaService.execute(coordInsertCmd);
        }
        catch (JPAExecutorException je) {
            je.printStackTrace();
            fail("Unable to insert the test coord job record to table");
            throw je;
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

    private void _testBundleJobsForPurge(int olderThan, int expected) throws Exception {
        JPAService jpaService = Services.get().get(JPAService.class);
        assertNotNull(jpaService);

        BundleJobsGetForPurgeJPAExecutor executor = new BundleJobsGetForPurgeJPAExecutor(olderThan, 50);
        List<BundleJobBean> jobList = jpaService.execute(executor);
        assertEquals(expected, jobList.size());
    }

    protected BundleJobBean addRecordToBundleJobTable(Job.Status jobStatus, Date lastModifiedTime) throws Exception {
        BundleJobBean bundle = createBundleJob(jobStatus, false);
View Full Code Here

        bundle.setLastModifiedTime(lastModifiedTime);
        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            assertNotNull(jpaService);
            BundleJobInsertJPAExecutor bundleInsertjpa = new BundleJobInsertJPAExecutor(bundle);
            jpaService.execute(bundleInsertjpa);
        }
        catch (JPAExecutorException ce) {
            ce.printStackTrace();
            fail("Unable to insert the test bundle job record to table");
            throw ce;
View Full Code Here

    private void _testPendingFalseCount(String jobId, int expected) throws Exception {
        JPAService jpaService = Services.get().get(JPAService.class);
        assertNotNull(jpaService);
        CoordActionsPendingFalseCountGetJPAExecutor actionPendingFalseCmd = new CoordActionsPendingFalseCountGetJPAExecutor(jobId);
        int cnt = jpaService.execute(actionPendingFalseCmd);
        assertEquals(expected, cnt);
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.