Package org.apache.oozie.store

Examples of org.apache.oozie.store.WorkflowStore.beginTrx()


        new PurgeCommand(1, 10000).call();
        Thread.sleep(1000);

        final WorkflowStore store = Services.get().get(
                WorkflowStoreService.class).create();
        store.beginTrx();
        WorkflowJobBean wfBean = store.getWorkflow(jobId, true);
        Date endDate = new Date(System.currentTimeMillis() - 2 * 24 * 60 * 60
                * 1000);
        wfBean.setEndTime(endDate);
        store.updateWorkflow(wfBean);
View Full Code Here


            if (jobId.endsWith("-W")) {
                WorkflowJobBean jobBean = null;
                WorkflowStore store = null;
                try {
                    store = Services.get().get(WorkflowStoreService.class).create();
                    store.beginTrx();
                    jobBean = store.getWorkflow(jobId, false);
                    store.commitTrx();
                }
                catch (StoreException ex) {
                    incrCounter(INSTR_FAILED_AUTH_COUNTER, 1);
View Full Code Here

            else {
                CoordinatorJobBean jobBean = null;
                CoordinatorStore store = null;
                try {
                    store = Services.get().get(CoordinatorStoreService.class).create();
                    store.beginTrx();
                    jobBean = store.getCoordinatorJob(jobId, false);
                    store.commitTrx();
                }
                catch (StoreException ex) {
                    incrCounter(INSTR_FAILED_AUTH_COUNTER, 1);
View Full Code Here

            }
        });

        Thread.sleep(1000);
        final WorkflowStore store = Services.get().get(WorkflowStoreService.class).create();
        store.beginTrx();
        List<WorkflowActionBean> actions = store.getActionsForWorkflow(jobId, false);
        WorkflowActionBean action = actions.get(0);
        final String actionId = action.getId();
        assertEquals(WorkflowActionBean.Status.RUNNING, action.getStatus());
        String actionConf = action.getConf();
View Full Code Here

        recoveryRunnable.run();
        Thread.sleep(3000);

        final WorkflowStore store2 = Services.get().get(WorkflowStoreService.class).create();
        assertEquals(WorkflowJob.Status.RUNNING, engine.getJob(jobId).getStatus());
        store2.beginTrx();
        WorkflowActionBean action2 = store2.getAction(actionId, false);
        assertEquals(WorkflowActionBean.Status.RUNNING, action2.getStatus());
        action2.setStatus(WorkflowActionBean.Status.PREP);
        action2.setPending();
        store2.updateAction(action2);
View Full Code Here

        });

        // getPendingActions works correctly only with MYSQL - following assertsfail with hsql - to be investigated
        // assertEquals(WorkflowJob.Status.SUCCEEDED, engine.getJob(jobId).getStatus());
        final WorkflowStore store3 = Services.get().get(WorkflowStoreService.class).create();
        store3.beginTrx();
        WorkflowActionBean action3 = store3.getAction(actionId, false);
        assertEquals(WorkflowActionBean.Status.OK, action3.getStatus());
        store3.commitTrx();
        store3.closeTrx();
    }
View Full Code Here

            }
        });
        Thread.sleep(2000);

        final WorkflowStore store = Services.get().get(WorkflowStoreService.class).create();
        store.beginTrx();
        List<WorkflowActionBean> actions = store.getActionsForWorkflow(jobId, false);
        WorkflowActionBean action = actions.get(0);
        assertEquals(WorkflowActionBean.Status.RUNNING, action.getStatus());
        store.commitTrx();
        store.closeTrx();
View Full Code Here

                return (engine.getJob(jobId).getStatus() == WorkflowJob.Status.SUCCEEDED);
            }
        });

        final WorkflowStore store2 = Services.get().get(WorkflowStoreService.class).create();
        store2.beginTrx();
        List<WorkflowActionBean> actions2 = store2.getActionsForWorkflow(jobId, false);
        WorkflowActionBean action2 = actions2.get(0);
        assertEquals(WorkflowActionBean.Status.OK, action2.getStatus());
        store2.commitTrx();
        store2.closeTrx();
View Full Code Here

            }
        });

        Thread.sleep(100);
        final WorkflowStore store = Services.get().get(WorkflowStoreService.class).create();
        store.beginTrx();
        List<WorkflowActionBean> actions = store.getActionsForWorkflow(jobId, true);
        WorkflowActionBean action = actions.get(0);
        assertEquals(WorkflowActionBean.Status.RUNNING, action.getStatus());

        action.setLastCheckTime(new Date());
View Full Code Here

        Runnable actionCheckRunnable = new ActionCheckRunnable(actionCheckDelay);
        actionCheckRunnable.run();

        Thread.sleep(3000);
        final WorkflowStore store2 = Services.get().get(WorkflowStoreService.class).create();
        store2.beginTrx();
        List<WorkflowActionBean> actions2 = store2.getActionsForWorkflow(jobId, false);
        WorkflowActionBean action2 = actions2.get(0);
        assertEquals(WorkflowActionBean.Status.RUNNING, action2.getStatus());
        store2.commitTrx();
        store2.closeTrx();
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.