Examples of SLACalculationInsertUpdateJPAExecutor


Examples of org.apache.oozie.executor.jpa.sla.SLACalculationInsertUpdateJPAExecutor

        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            assertNotNull(jpaService);
            List<JsonBean> insert = new ArrayList<JsonBean>();
            insert.add(reg);
            SLACalculationInsertUpdateJPAExecutor slaInsertCmd = new SLACalculationInsertUpdateJPAExecutor(insert, null);
            jpaService.execute(slaInsertCmd);
        }
        catch (JPAExecutorException je) {
            fail("Unable to insert the test sla registration record to table");
            throw je;
View Full Code Here

Examples of org.apache.oozie.executor.jpa.sla.SLACalculationInsertUpdateJPAExecutor

        SLASummaryBean bean2 = _createSLASummaryBean(wfId, "RUNNING", EventStatus.START_MISS, expStart, expEnd, 1000,
                actStart, actEnd, 2000, (byte) 1, actEnd);

        List<JsonBean> list = new ArrayList<JsonBean>();
        list.add(bean2);
        SLACalculationInsertUpdateJPAExecutor writeCmd = new SLACalculationInsertUpdateJPAExecutor();
        writeCmd.setInsertList(list);
        jpaService.execute(writeCmd);

        SLASummaryGetJPAExecutor readCmd2 = new SLASummaryGetJPAExecutor(wfId);
        SLASummaryBean sBean = jpaService.execute(readCmd2);
        assertEquals(wfId, sBean.getId());
View Full Code Here

Examples of org.apache.oozie.executor.jpa.sla.SLACalculationInsertUpdateJPAExecutor

        Date actStart = new Date();
        SLASummaryBean bean2 = _createSLASummaryBean(wfId, "RUNNING", EventStatus.START_MISS, expStart, expEnd, 1000,
                actStart, null, 2000, (byte) 0, actStart);
        List<JsonBean> list = new ArrayList<JsonBean>();
        list.add(bean2);
        SLACalculationInsertUpdateJPAExecutor writeCmd = new SLACalculationInsertUpdateJPAExecutor();
        writeCmd.setInsertList(list);
        jpaService.execute(writeCmd);

        // update existing record
        Date newDate = new Date();
        bean2 = _createSLASummaryBean(wfId, "RUNNING", EventStatus.DURATION_MISS, expStart, expEnd, 1000, actStart,
                newDate, 2000, (byte) 1, newDate);
        list = new ArrayList<JsonBean>();
        list.add(bean2);
        writeCmd.setUpdateList(list);
        writeCmd.setInsertList(null);
        jpaService.execute(writeCmd);

        SLASummaryGetJPAExecutor readCmd2 = new SLASummaryGetJPAExecutor(wfId);
        SLASummaryBean sBean = jpaService.execute(readCmd2);
        // check updated + original fields
View Full Code Here

Examples of org.apache.oozie.executor.jpa.sla.SLACalculationInsertUpdateJPAExecutor

        // initial insert
        SLASummaryBean bean1 = _createSLASummaryBean(wfId1, "RUNNING", EventStatus.START_MISS, new Date(), new Date(),
                1000, null, null, 2000, 0, null);
        List<JsonBean> list = new ArrayList<JsonBean>();
        list.add(bean1);
        SLACalculationInsertUpdateJPAExecutor writeCmd = new SLACalculationInsertUpdateJPAExecutor(list, null);
        jpaService.execute(writeCmd);

        // update existing record and insert another
        Date newDate = new Date();
        bean1 = new SLASummaryBean();
        bean1.setId(wfId1);
        bean1.setActualEnd(newDate);
        List<JsonBean> updateList = new ArrayList<JsonBean>();
        updateList.add(bean1);

        SLASummaryBean bean2 = _createSLASummaryBean(wfId2, "RUNNING", EventStatus.END_MISS, new Date(), new Date(),
                1000, null, null, 2000, 0, null);
        List<JsonBean> insertList = new ArrayList<JsonBean>();
        insertList.add(bean2);
        writeCmd = new SLACalculationInsertUpdateJPAExecutor(insertList, updateList);

        // set fault injection to true, so transaction is roll backed
        setSystemProperty(FaultInjection.FAULT_INJECTION, "true");
        setSystemProperty(SkipCommitFaultInjection.ACTION_FAILOVER_FAULT_INJECTION, "true");
        try {
View Full Code Here

Examples of org.apache.oozie.executor.jpa.sla.SLACalculationInsertUpdateJPAExecutor

        sla2.setLastModifiedTime(sdf.parse("2009-06-03"));

        List<JsonBean> insert = new ArrayList<JsonBean>();
        insert.add(sla1);
        insert.add(sla2);
        SLACalculationInsertUpdateJPAExecutor slaInsertCmd = new SLACalculationInsertUpdateJPAExecutor(insert, null);
        jpaService.execute(slaInsertCmd);
        // get all records modified in last 7 days
        SLASummaryGetRecordsOnRestartJPAExecutor slaGetOnRestart = new SLASummaryGetRecordsOnRestartJPAExecutor(7);
        List<SLASummaryBean> beans = jpaService.execute(slaGetOnRestart);
        assertEquals(1, beans.size());
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.