Package org.apache.oozie.command.wf

Examples of org.apache.oozie.command.wf.ActionStartXCommand


        assertEquals(WorkflowAction.Status.PREP, action.getStatus());

        setSystemProperty(FaultInjection.FAULT_INJECTION, "false");
        setSystemProperty(SkipCommitFaultInjection.ACTION_FAILOVER_FAULT_INJECTION, "false");

        ActionStartXCommand actionStartCommand = new ActionStartXCommand(action.getId(), action.getType());
        actionStartCommand.call();

        store = Services.get().get(WorkflowStoreService.class).create();
        actions = store.getActionsForWorkflow(jobId1, false);
        action = actions.get(0);
        assertEquals(WorkflowAction.Status.DONE, action.getStatus());
View Full Code Here


                for (WorkflowActionBean action : actions) {
                    Services.get().get(InstrumentationService.class).get().incr(INSTRUMENTATION_GROUP,
                            INSTR_RECOVERED_ACTIONS_COUNTER, 1);
                    if (action.getStatus() == WorkflowActionBean.Status.PREP
                            || action.getStatus() == WorkflowActionBean.Status.START_MANUAL) {
            queueCallable(new ActionStartXCommand(action.getId(),
                action.getType()));
                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.START_RETRY) {
                        Date nextRunTime = action.getPendingAge();
                            queueCallable(new ActionStartXCommand(action.getId(), action.getType()), nextRunTime.getTime()
                                    - System.currentTimeMillis());
                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.DONE
                            || action.getStatus() == WorkflowActionBean.Status.END_MANUAL) {
                            queueCallable(new ActionEndXCommand(action.getId(), action.getType()));
                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.END_RETRY) {
                        Date nextRunTime = action.getPendingAge();
            queueCallable(new ActionEndXCommand(action.getId(),
                action.getType()), nextRunTime.getTime()
                - System.currentTimeMillis());

                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.OK
                            || action.getStatus() == WorkflowActionBean.Status.ERROR) {
            queueCallable(new SignalXCommand(action.getJobId(),
                action.getId()));
                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.USER_RETRY) {
            queueCallable(new ActionStartXCommand(action.getId(),
                action.getType()));
                    }
                }
            }
            catch (Exception ex) {
View Full Code Here

                            INSTR_RECOVERED_ACTIONS_COUNTER, 1);
                    if (action.getStatus() == WorkflowActionBean.Status.PREP
                            || action.getStatus() == WorkflowActionBean.Status.START_MANUAL) {

                        if (useXCommand) {
                            queueCallable(new ActionStartXCommand(action.getId(), action.getType()));
                        } else {
                            queueCallable(new ActionStartCommand(action.getId(), action.getType()));
                        }

                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.START_RETRY) {
                        Date nextRunTime = action.getPendingAge();
                        if (useXCommand) {
                            queueCallable(new ActionStartXCommand(action.getId(), action.getType()), nextRunTime.getTime()
                                    - System.currentTimeMillis());
                        } else {
                            queueCallable(new ActionStartCommand(action.getId(), action.getType()), nextRunTime.getTime()
                                    - System.currentTimeMillis());
                        }

                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.DONE
                            || action.getStatus() == WorkflowActionBean.Status.END_MANUAL) {
                        if (useXCommand) {
                            queueCallable(new ActionEndXCommand(action.getId(), action.getType()));
                        } else {
                            queueCallable(new ActionEndCommand(action.getId(), action.getType()));
                        }

                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.END_RETRY) {
                        Date nextRunTime = action.getPendingAge();
                        if (useXCommand) {
                            queueCallable(new ActionEndXCommand(action.getId(), action.getType()), nextRunTime.getTime()
                                    - System.currentTimeMillis());
                        } else {
                            queueCallable(new ActionEndCommand(action.getId(), action.getType()), nextRunTime.getTime()
                                    - System.currentTimeMillis());
                        }

                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.OK
                            || action.getStatus() == WorkflowActionBean.Status.ERROR) {
                        if (useXCommand) {
                            queueCallable(new SignalXCommand(action.getJobId(), action.getId()));
                        } else {
                            queueCallable(new SignalCommand(action.getJobId(), action.getId()));
                        }

                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.USER_RETRY) {
                      queueCallable(new ActionStartXCommand(action.getId(), action.getType()));
                    }
                }
            }
            catch (Exception ex) {
                log.error("Exception, {0}", ex.getMessage(), ex);
View Full Code Here

                try {
                    Services.get().get(InstrumentationService.class).get()
                            .incr(INSTRUMENTATION_GROUP, INSTR_RECOVERED_ACTIONS_COUNTER, 1);
                    if (action.getStatus() == WorkflowActionBean.Status.PREP
                            || action.getStatus() == WorkflowActionBean.Status.START_MANUAL) {
                        queueCallable(new ActionStartXCommand(action.getId(), action.getType()));
                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.START_RETRY) {
                        Date nextRunTime = action.getPendingAge();
                        queueCallable(new ActionStartXCommand(action.getId(), action.getType()), nextRunTime.getTime()
                                - System.currentTimeMillis());
                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.DONE
                            || action.getStatus() == WorkflowActionBean.Status.END_MANUAL) {
                        queueCallable(new ActionEndXCommand(action.getId(), action.getType()));
                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.END_RETRY) {
                        Date nextRunTime = action.getPendingAge();
                        queueCallable(new ActionEndXCommand(action.getId(), action.getType()), nextRunTime.getTime()
                                - System.currentTimeMillis());

                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.OK
                            || action.getStatus() == WorkflowActionBean.Status.ERROR) {
                        queueCallable(new SignalXCommand(action.getJobId(), action.getId()));
                    }
                    else if (action.getStatus() == WorkflowActionBean.Status.USER_RETRY) {
                        queueCallable(new ActionStartXCommand(action.getId(), action.getType()));
                    }
                }
                catch (Exception ex) {
                    log.error("Exception, {0}", ex.getMessage(), ex);
                }
View Full Code Here

        assertEquals(StartActionExecutor.TYPE, action.getType());

        setSystemProperty(FaultInjection.FAULT_INJECTION, "false");
        setSystemProperty(SkipCommitFaultInjection.ACTION_FAILOVER_FAULT_INJECTION, "false");

        ActionStartXCommand actionStartCommand = new ActionStartXCommand(action.getId(), action.getType());
        actionStartCommand.call();

        store = Services.get().get(WorkflowStoreService.class).create();
        actions = store.getActionsForWorkflow(jobId1, false);
        action = actions.get(0);
        assertEquals(WorkflowAction.Status.DONE, action.getStatus());
View Full Code Here

                    if (Services.get().get(JobsConcurrencyService.class).isJobIdForThisServer(action.getId())) {
                        Services.get().get(InstrumentationService.class).get()
                                .incr(INSTRUMENTATION_GROUP, INSTR_RECOVERED_ACTIONS_COUNTER, 1);
                        if (action.getStatus() == WorkflowActionBean.Status.PREP
                                || action.getStatus() == WorkflowActionBean.Status.START_MANUAL) {
                            queueCallable(new ActionStartXCommand(action.getId(), action.getType()));
                        }
                        else if (action.getStatus() == WorkflowActionBean.Status.START_RETRY) {
                            Date nextRunTime = action.getPendingAge();
                            queueCallable(new ActionStartXCommand(action.getId(), action.getType()), nextRunTime.getTime()
                                    - System.currentTimeMillis());
                        }
                        else if (action.getStatus() == WorkflowActionBean.Status.DONE
                                || action.getStatus() == WorkflowActionBean.Status.END_MANUAL) {
                            queueCallable(new ActionEndXCommand(action.getId(), action.getType()));
                        }
                        else if (action.getStatus() == WorkflowActionBean.Status.END_RETRY) {
                            Date nextRunTime = action.getPendingAge();
                            queueCallable(new ActionEndXCommand(action.getId(), action.getType()), nextRunTime.getTime()
                                    - System.currentTimeMillis());

                        }
                        else if (action.getStatus() == WorkflowActionBean.Status.OK
                                || action.getStatus() == WorkflowActionBean.Status.ERROR) {
                            queueCallable(new SignalXCommand(action.getJobId(), action.getId()));
                        }
                        else if (action.getStatus() == WorkflowActionBean.Status.USER_RETRY) {
                            queueCallable(new ActionStartXCommand(action.getId(), action.getType()));
                        }
                    }
                }
                catch (Exception ex) {
                    log.error("Exception, {0}", ex.getMessage(), ex);
View Full Code Here

        // adding record sets externalChildID to dummy workflow-id so resetting it
        action.setExternalChildIDs(null);
        WorkflowActionQueryExecutor.getInstance().executeUpdate(WorkflowActionQuery.UPDATE_ACTION_START, action);

        // Starting job
        new ActionStartXCommand(action.getId(), "map-reduce").call();
        WorkflowActionGetJPAExecutor wfActionGetCmd = new WorkflowActionGetJPAExecutor(action.getId());
        action = jpaService.execute(wfActionGetCmd);
        assertEquals(WorkflowAction.Status.RUNNING, action.getStatus());
        assertEquals(1, queue.size());
        WorkflowActionEvent event = (WorkflowActionEvent) queue.poll();
View Full Code Here

                action.getId());
        action.setExternalId(wf.getId());
        CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION, action);

        String waId = _createWorkflowAction(wf.getId(), "wf-action");
        new ActionStartXCommand(waId, action.getType()).call();

        final WorkflowJobGetJPAExecutor readCmd2 = new WorkflowJobGetJPAExecutor(jobId1);
        waitFor(1 * 100, new Predicate() {
            @Override
            public boolean evaluate() throws Exception {
View Full Code Here

        assertEquals(StartActionExecutor.TYPE, action.getType());

        setSystemProperty(FaultInjection.FAULT_INJECTION, "false");
        setSystemProperty(SkipCommitFaultInjection.ACTION_FAILOVER_FAULT_INJECTION, "false");

        ActionStartXCommand actionStartCommand = new ActionStartXCommand(action.getId(), action.getType());
        actionStartCommand.call();
        sleep(500);

        store = Services.get().get(WorkflowStoreService.class).create();
        actions = store.getActionsForWorkflow(jobId1, false);
        action = actions.get(0);
View Full Code Here

        WorkflowJobBean job = this.addRecordToWfJobTable(WorkflowJob.Status.RUNNING, WorkflowInstance.Status.RUNNING);
        WorkflowActionBean action = this.addRecordToWfActionTable(job.getId(), "1", WorkflowAction.Status.PREP, true);
        WorkflowActionGetJPAExecutor wfActionGetCmd = new WorkflowActionGetJPAExecutor(action.getId());

        // Starting job
        new ActionStartXCommand(action.getId(), "map-reduce").call();
        action = jpaService.execute(wfActionGetCmd);
        assertEquals(WorkflowAction.Status.RUNNING, action.getStatus());
        assertEquals(1, queue.size());
        WorkflowActionEvent event = (WorkflowActionEvent) queue.poll();
        assertNotNull(event);
View Full Code Here

TOP

Related Classes of org.apache.oozie.command.wf.ActionStartXCommand

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.