Examples of KillXCommand


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

    public void kill(String jobId) throws DagEngineException {
        // Changing to synchronous call from asynchronous queuing to prevent the
        // loss of command if the queue is full or the queue is lost in case of
        // failure.
        try {
      new KillXCommand(jobId).call();
      LOG.info("User " + user + " killed the WF job " + jobId);
        }
        catch (CommandException e) {
            throw new DagEngineException(e);
        }
View Full Code Here

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

                                        + caction.getId());
                            }
                        }
                        else if (caction.getStatus() == CoordinatorActionBean.Status.KILLED) {
                            if (caction.getExternalId() != null) {
                                queueCallable(new KillXCommand(caction.getExternalId()));
                                log.debug("Recover a KILLED coord action and resubmit KillXCommand :" + caction.getId());
                            }
                        }
                        else if (caction.getStatus() == CoordinatorActionBean.Status.RUNNING) {
                            if (caction.getExternalId() != null) {
View Full Code Here

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

    public void killChildren() throws CommandException {
        if (actionList != null) {
            for (CoordinatorActionBean action : actionList) {
                // queue a WorkflowKillXCommand to delete the workflow job and actions
                if (action.getExternalId() != null) {
                    queue(new KillXCommand(action.getExternalId()));
                    // As the kill command for children is queued, set pending flag for coord action to be true
                    updateCoordAction(action, true);
                    LOG.debug(
                            "Killed coord action = [{0}], new status = [{1}], pending = [{2}] and queue KillXCommand for [{3}]",
                            action.getId(), action.getStatus(), action.getPending(), action.getExternalId());
View Full Code Here

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

        String nominalTime = DateUtils.formatDateOozieTZ(nominal);
        conf.set("nominal_time", nominalTime);

        // test that sla processes the Job Event from Kill command
        String jobId = new SubmitXCommand(conf).call(); //submit new job
        new KillXCommand(jobId).call();
        waitForEventGeneration(200); //wait for wf-action kill event to generate
        ehs.new EventWorker().run();
        waitForEventGeneration(300); // time for listeners to run
        SLACalcStatus slaEvent = skipToSLAEvent();
        assertEquals(jobId, slaEvent.getId());
View Full Code Here

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

        assertEquals(job.getAppName(), event.getAppName());
        assertEquals(job.getStartTime(), event.getStartTime());
        assertEquals(0, queue.size());

        // Killing job
        new KillXCommand(job.getId()).call();
        job = jpaService.execute(wfJobGetCmd);
        assertEquals(WorkflowJob.Status.KILLED, job.getStatus());
        assertEquals(1, queue.size());
        event = (JobEvent) queue.poll();
        assertNotNull(event);
View Full Code Here

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

    @Test
    public void testWorkflowJobEventError() throws Exception {
        final WorkflowJobBean job = addRecordToWfJobTable(WorkflowJob.Status.FAILED, WorkflowInstance.Status.FAILED);
        // create event with error code and message
        WorkflowXCommand<Void> myCmd = new KillXCommand(job.getId()) {
            @Override
            protected Void execute() {
                WorkflowXCommand.generateEvent(job, "errorCode", "errorMsg");
                return null;
            }
        };
        myCmd.call();
        WorkflowJobEvent event = (WorkflowJobEvent) queue.poll();
        assertNotNull(event);
        assertEquals("errorCode", event.getErrorCode());
        assertEquals("errorMsg", event.getErrorMessage());
        assertEquals(EventStatus.FAILURE, event.getEventStatus());
View Full Code Here

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

    public void killChildren() throws CommandException {
        if (actionList != null) {
            for (CoordinatorActionBean action : actionList) {
                // queue a WorkflowKillXCommand to delete the workflow job and actions
                if (action.getExternalId() != null) {
                    queue(new KillXCommand(action.getExternalId()));
                    // As the kill command for children is queued, set pending flag for coord action to be true
                    updateCoordAction(action, true);
                    LOG.debug(
                            "Killed coord action = [{0}], new status = [{1}], pending = [{2}] and queue KillXCommand for [{3}]",
                            action.getId(), action.getStatus(), action.getPending(), action.getExternalId());
View Full Code Here

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

    public void kill(String jobId) throws DagEngineException {
        // Changing to synchronous call from asynchronous queuing to prevent the
        // loss of command if the queue is full or the queue is lost in case of
        // failure.
        try {
      new KillXCommand(jobId).call();
      LOG.info("User " + user + " killed the WF job " + jobId);
        }
        catch (CommandException e) {
            throw new DagEngineException(e);
        }
View Full Code Here

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

        assertEquals(job.getAppName(), event.getAppName());
        assertEquals(job.getStartTime(), event.getStartTime());
        assertEquals(0, queue.size());

        // Killing job
        new KillXCommand(job.getId()).call();
        job = jpaService.execute(wfJobGetCmd);
        assertEquals(WorkflowJob.Status.KILLED, job.getStatus());
        assertEquals(1, queue.size());
        event = (JobEvent) queue.poll();
        assertNotNull(event);
View Full Code Here

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

    @Test
    public void testWorkflowJobEventError() throws Exception {
        final WorkflowJobBean job = addRecordToWfJobTable(WorkflowJob.Status.FAILED, WorkflowInstance.Status.FAILED);
        // create event with error code and message
        WorkflowXCommand<Void> myCmd = new KillXCommand(job.getId()) {
            @Override
            protected Void execute() {
                WorkflowXCommand.generateEvent(job, "errorCode", "errorMsg");
                return null;
            }
        };
        myCmd.call();
        WorkflowJobEvent event = (WorkflowJobEvent) queue.poll();
        assertNotNull(event);
        assertEquals("errorCode", event.getErrorCode());
        assertEquals("errorMsg", event.getErrorMessage());
        assertEquals(EventStatus.FAILURE, event.getEventStatus());
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.