Package org.qzerver.model.domain.entities.job

Examples of org.qzerver.model.domain.entities.job.ScheduleExecution


    protected ScheduleExecution executeJob(long scheduleJobId, StartExecutionParameters parameters) {
        BeanValidationUtils.checkValidity(parameters, beanValidator);

        // Compose execution descriptor
        ScheduleExecution scheduleExecution = executionManagementService.startExecution(scheduleJobId, parameters);

        // The only reason the status is not assigned is that exception occurs in executeJobNodes*() call
        ScheduleExecutionStatus status = ScheduleExecutionStatus.EXCEPTION;

        // Try to execute action on a node from the cluster
        try {
            try {
                if (scheduleExecution.isAllNodes() && (scheduleExecution.getAllNodesPool() > 0)) {
                    status = executeJobNodesParallel(scheduleExecution);
                } else {
                    status = executeJobNodesSequentially(scheduleExecution);
                }
            } catch (Exception e) {
                LOGGER.error("Internal error while executing the job : " + scheduleExecution.getJob().getId(), e);
            } finally {
                scheduleExecution = executionManagementService.finishExecution(scheduleExecution.getId(), status);
            }
        } catch (AbstractServiceException e) {
            throw new SystemIntegrityException("Fail to finish execution", e);
        }

View Full Code Here


        Iterator<ScheduleExecutionNode> nodeIterator = scheduleExecution.getNodes().iterator();

        // Start loop throught all execution nodes
        while (nodeIterator.hasNext()) {
            // Get fresh copy of execution and check the cancellation flag
            ScheduleExecution scheduleExecutionReloaded =
                executionManagementService.findExecution(scheduleExecution.getId());
            if (scheduleExecutionReloaded.isCancelled()) {
                LOGGER.debug("Execution [{}] is cancelled", scheduleExecution.getId());
                return ScheduleExecutionStatus.CANCELED;
            }

            // Current node
View Full Code Here

TOP

Related Classes of org.qzerver.model.domain.entities.job.ScheduleExecution

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.