Package org.apache.oozie.executor.jpa

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


                    SLADbXOperations.writeStausEvent(action.getSlaXml(), action.getId(), Status.KILLED,
                            SlaAppType.WORKFLOW_ACTION);
                    jpaService.execute(new WorkflowActionUpdateJPAExecutor(action));
                }
            }
            jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfJob));
            queue(new NotificationXCommand(wfJob));
        }
        catch (JPAExecutorException je) {
            throw new CommandException(je);
        }
View Full Code Here


                    wfAction.resetPending();
                    wfAction.setStatus(WorkflowActionBean.Status.KILLED);

                    jpaService.execute(new WorkflowActionUpdateJPAExecutor(wfAction));
                    jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfJob));
                    // Add SLA status event (KILLED) for WF_ACTION
                    SLADbXOperations.writeStausEvent(wfAction.getSlaXml(), wfAction.getId(), Status.KILLED,
                            SlaAppType.WORKFLOW_ACTION);
                    queue(new NotificationXCommand(wfJob, wfAction));
                }
                catch (ActionExecutorException ex) {
                    wfAction.resetPending();
                    wfAction.setStatus(WorkflowActionBean.Status.FAILED);
                    wfAction.setErrorInfo(ex.getErrorCode().toString(),
                            "KILL COMMAND FAILED - exception while executing job kill");
                    wfJob.setStatus(WorkflowJobBean.Status.KILLED);
                    try {
                        jpaService.execute(new WorkflowActionUpdateJPAExecutor(wfAction));
                        jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfJob));
                    }
                    catch (JPAExecutorException je) {
                        throw new CommandException(je);
                    }
                    // What will happen to WF and COORD_ACTION, NOTIFICATION?
View Full Code Here

            wfBean.setExternalId(conf.get(OozieClient.EXTERNAL_ID));
            wfBean.setEndTime(null);
            wfBean.setRun(wfBean.getRun() + 1);
            wfBean.setStatus(WorkflowJob.Status.PREP);
            wfBean.setWorkflowInstance(newWfInstance);
            jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfBean));
        }
        catch (JPAExecutorException e) {
            throw new CommandException(e);
        }
View Full Code Here

                JPAService jpaService = Services.get().get(JPAService.class);
                if (jpaService != null) {
                    log.debug("Updating WF record for WFID :" + wfId + " with parent id: " + actionId);
                    WorkflowJobBean wfJob = jpaService.execute(new WorkflowJobGetJPAExecutor(wfId));
                    wfJob.setParentId(actionId);
                    jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfJob));
                    jpaService.execute(new org.apache.oozie.executor.jpa.CoordActionUpdateJPAExecutor(coordAction));
                }
                else {
                    log.error(ErrorCode.E0610);
                }
View Full Code Here

                        }

                    }
                }

                jpaService.execute(new WorkflowJobUpdateJPAExecutor(workflow));
                queue(new NotificationXCommand(workflow));
            }
            return null;
        }
        catch (WorkflowException ex) {
View Full Code Here

        JPAService jpaService = Services.get().get(JPAService.class);
        WorkflowJobGetJPAExecutor wfJobGetCmd = new WorkflowJobGetJPAExecutor(jobId);
        WorkflowJobBean wfBean = jpaService.execute(wfJobGetCmd);
        Date endDate = new Date(System.currentTimeMillis() - 2 * 24 * 60 * 60 * 1000);
        wfBean.setEndTime(endDate);
        WorkflowJobUpdateJPAExecutor wfUpdateCmd = new WorkflowJobUpdateJPAExecutor(wfBean);
        jpaService.execute(wfUpdateCmd);

        Runnable purgeRunnable = new PurgeRunnable(1, 1, 1, 100);
        purgeRunnable.run();

View Full Code Here

        WorkflowJobGetJPAExecutor wfGetCmd = new WorkflowJobGetJPAExecutor(job.getId());
        WorkflowJobBean wfBean = jpaService.execute(wfGetCmd);

        // first update;
        wfBean.setStatus(WorkflowJob.Status.SUCCEEDED);
        WorkflowJobUpdateJPAExecutor wfUpdateCmd1 = new WorkflowJobUpdateJPAExecutor(wfBean);
        jpaService.execute(wfUpdateCmd1);
        WorkflowJobBean wfBean1 = jpaService.execute(wfGetCmd);
        assertEquals(wfBean1.getId(), job.getId());
        assertEquals(wfBean1.getStatusStr(), "SUCCEEDED");

        // second update;
        wfBean.setAppName("test");
        wfBean.setStatus(WorkflowJob.Status.RUNNING);
        WorkflowJobUpdateJPAExecutor wfUpdateCmd2 = new WorkflowJobUpdateJPAExecutor(wfBean);
        jpaService.execute(wfUpdateCmd2);
        WorkflowJobBean wfBean2 = jpaService.execute(wfGetCmd);
        assertEquals(wfBean2.getId(), job.getId());
        assertEquals(wfBean2.getStatusStr(), "RUNNING");
    }
View Full Code Here

        assertEquals(sdf.parse("2013-02-07").getTime() - sdf.parse("2012-02-07").getTime(),
                slaSummary.getActualDuration());

        // Simulate a lost failed event
        wjb.setStatus(WorkflowJob.Status.FAILED);
        jpaService.execute(new WorkflowJobUpdateJPAExecutor(wjb));

        // Reset the summary Bean
        calc1.setEventProcessed(1);
        calc1.setSLAStatus(SLAEvent.SLAStatus.IN_PROCESS);
        calc1.setJobStatus(WorkflowJob.Status.RUNNING.name());
        slaSummaryBean = new SLASummaryBean(calc1);

        list = new ArrayList<JsonBean>();
        list.add(slaSummaryBean);
        jpaService.execute(new SLACalculationInsertUpdateJPAExecutor(null, list));

        slaCalcMemory = new SLACalculatorMemory();
        slaCalcMemory.init(new Configuration(false));

        assertEquals(0, slaCalcMemory.size());
        slaSummary = jpaService.execute(new SLASummaryGetJPAExecutor(jobId1));
        assertEquals("FAILED", slaSummary.getJobStatus());
        assertEquals(8, slaSummary.getEventProcessed());
        assertEquals(sdf.parse("2012-02-07"), slaSummary.getActualStart());
        assertEquals(sdf.parse("2013-02-07"), slaSummary.getActualEnd());
        assertEquals(SLAEvent.SLAStatus.MISS, slaSummary.getSLAStatus());

        // Simulate a lost RUNNING event
        wjb.setStatus(WorkflowJob.Status.RUNNING);
        jpaService.execute(new WorkflowJobUpdateJPAExecutor(wjb));

        // Reset the summary Bean
        calc1.setEventProcessed(0);
        calc1.setSLAStatus(SLAEvent.SLAStatus.NOT_STARTED);
        calc1.setJobStatus(null);
View Full Code Here

        CoordActionInsertJPAExecutor caInsertCmd = new CoordActionInsertJPAExecutor(cab);
        jpaService.execute(caInsertCmd);
        WorkflowJobBean wjb = new WorkflowJobBean();
        wjb.setId("wf_job");
        wjb.setStartTime(sdf.parse("2012-02-07"));
        jpaService.execute(new WorkflowJobUpdateJPAExecutor(wjb));

        slaCalcMemory = new SLACalculatorMemory();
        slaCalcMemory.init(new Configuration(false));

        // As job succeeded, it should not be in memory
View Full Code Here

            jpaService.execute(coordActionInsertExecutor);

            if (wfId != null) {
                WorkflowJobBean wfJob = jpaService.execute(new WorkflowJobGetJPAExecutor(wfId));
                wfJob.setParentId(jobId);
                jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfJob));
            }
        }
        catch (JPAExecutorException je) {
            je.printStackTrace();
            fail("Unable to insert the test coord action record to table");
View Full Code Here

TOP

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

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.