Examples of StepExecutionImpl


Examples of org.jberet.runtime.StepExecutionImpl

        }
    }

    @Override
    public StepExecutionImpl findOriginalStepExecutionForRestart(final String stepName, final JobExecutionImpl jobExecutionToRestart) {
        final StepExecutionImpl result = super.findOriginalStepExecutionForRestart(stepName, jobExecutionToRestart);
        if (result != null) {
            return result;
        }
        final String select = sqls.getProperty(FIND_ORIGINAL_STEP_EXECUTION);
        final Connection connection = getConnection();
View Full Code Here

Examples of org.jberet.runtime.StepExecutionImpl

    }

    private void createStepExecutionsFromResultSet(final ResultSet rs, final List<StepExecution> result, final boolean top1)
            throws SQLException, ClassNotFoundException, IOException {
        while (rs.next()) {
            final StepExecutionImpl e = new StepExecutionImpl(
                    rs.getLong(TableColumns.STEPEXECUTIONID),
                    rs.getString(TableColumns.STEPNAME),
                    rs.getTimestamp(TableColumns.STARTTIME),
                    rs.getTimestamp(TableColumns.ENDTIME),
                    rs.getString(TableColumns.BATCHSTATUS),
View Full Code Here

Examples of org.jberet.runtime.StepExecutionImpl

        }
        final boolean isRestartNotOverride = isRestart && !isOverride;
        List<PartitionExecutionImpl> abortedPartitionExecutionsFromPrevious = null;
        if (isRestartNotOverride) {
            //need to carry over partition execution data from previous run of the same step
            final StepExecutionImpl originalStepExecution = batchContext.getOriginalStepExecution();
            abortedPartitionExecutionsFromPrevious =
                    jobContext.getJobRepository().getPartitionExecutions(originalStepExecution.getStepExecutionId(), originalStepExecution, true);
            numOfPartitions = abortedPartitionExecutionsFromPrevious.size();
        }
        if (numOfPartitions > numOfThreads) {
            completedPartitionThreads = new ArrayBlockingQueue<Boolean>(numOfPartitions);
        }
View Full Code Here

Examples of org.jberet.runtime.StepExecutionImpl

        this.classLoader = getJobContext().getClassLoader();
        this.stepExecution = getJobContext().jobRepository.createStepExecution(id);

        JobExecutionImpl originalToRestart = getJobContext().originalToRestart;
        if (originalToRestart != null) {  //currently in a restarted execution
            StepExecutionImpl originalStepExecution = findOriginalStepExecution(originalToRestart);
            if (originalStepExecution != null) {
                if (originalStepExecution.getBatchStatus() == BatchStatus.COMPLETED) {
                    allowStartIfComplete = Boolean.valueOf(step.getAllowStartIfComplete());
                    if (allowStartIfComplete == Boolean.FALSE) {
                        setBatchStatus(BatchStatus.COMPLETED);
                        setExitStatus(originalStepExecution.getExitStatus());
                        return;
                    }
                }
                if (originalStepExecution.getPersistentUserData() != null) {
                    this.stepExecution.setPersistentUserData(originalStepExecution.getPersistentUserData());
                }
                this.stepExecution.setReaderCheckpointInfo(originalStepExecution.getReaderCheckpointInfo());
                this.stepExecution.setWriterCheckpointInfo(originalStepExecution.getWriterCheckpointInfo());
                this.stepExecution.setStartCount((originalStepExecution).getStartCount());
                this.stepExecution.setNumOfPartitions(originalStepExecution.getNumOfPartitions());
                if (originalStepExecution.getPartitionPropertiesIndex() != null) {
                    for (Integer i : originalStepExecution.getPartitionPropertiesIndex()) {
                        this.stepExecution.addPartitionPropertiesIndex(i);
                    }
                }
                if (originalStepExecution.getPartitionPersistentUserData() != null) {
                    for (Serializable d : originalStepExecution.getPartitionPersistentUserData()) {
                        this.stepExecution.addPartitionPersistentUserData(d);
                    }
                }
                if (originalStepExecution.getPartitionReaderCheckpointInfo() != null) {
                    for (Serializable d : originalStepExecution.getPartitionReaderCheckpointInfo()) {
                        this.stepExecution.addPartitionReaderCheckpointInfo(d);
                    }
                }
                if (originalStepExecution.getPartitionWriterCheckpointInfo() != null) {
                    for (Serializable d : originalStepExecution.getPartitionWriterCheckpointInfo()) {
                        this.stepExecution.addPartitionWriterCheckpointInfo(d);
                    }
                }
            }
        }
View Full Code Here

Examples of org.jberet.runtime.StepExecutionImpl

        this.classLoader = getJobContext().getClassLoader();
        this.stepExecution = getJobContext().jobRepository.createStepExecution(id);

        final JobExecutionImpl originalToRestart = getJobContext().originalToRestart;
        if (originalToRestart != null) {  //currently in a restarted execution
            final StepExecutionImpl originalStepExecution = findOriginalStepExecution(originalToRestart);
            if (originalStepExecution != null) {
                if (originalStepExecution.getBatchStatus() == BatchStatus.COMPLETED) {
                    allowStartIfComplete = Boolean.valueOf(step.getAllowStartIfComplete());
                    if (allowStartIfComplete == Boolean.FALSE) {
                        setBatchStatus(BatchStatus.COMPLETED);
                        setExitStatus(originalStepExecution.getExitStatus());
                        return;
                    }
                }
                if (originalStepExecution.getPersistentUserData() != null) {
                    this.stepExecution.setPersistentUserData(originalStepExecution.getPersistentUserData());
                }
                this.stepExecution.setReaderCheckpointInfo(originalStepExecution.getReaderCheckpointInfo());
                this.stepExecution.setWriterCheckpointInfo(originalStepExecution.getWriterCheckpointInfo());
                this.stepExecution.setStartCount((originalStepExecution).getStartCount());
                this.stepExecution.setNumOfPartitions(originalStepExecution.getNumOfPartitions());
                if (originalStepExecution.getPartitionPropertiesIndex() != null) {
                    for (final Integer i : originalStepExecution.getPartitionPropertiesIndex()) {
                        this.stepExecution.addPartitionPropertiesIndex(i);
                    }
                }
                if (originalStepExecution.getPartitionPersistentUserData() != null) {
                    for (final Serializable d : originalStepExecution.getPartitionPersistentUserData()) {
                        this.stepExecution.addPartitionPersistentUserData(d);
                    }
                }
                if (originalStepExecution.getPartitionReaderCheckpointInfo() != null) {
                    for (final Serializable d : originalStepExecution.getPartitionReaderCheckpointInfo()) {
                        this.stepExecution.addPartitionReaderCheckpointInfo(d);
                    }
                }
                if (originalStepExecution.getPartitionWriterCheckpointInfo() != null) {
                    for (final Serializable d : originalStepExecution.getPartitionWriterCheckpointInfo()) {
                        this.stepExecution.addPartitionWriterCheckpointInfo(d);
                    }
                }
            }
        }
View Full Code Here

Examples of org.jberet.runtime.StepExecutionImpl

        ut.begin();
        try {
            while (fromAllPartitions.size() < numOfPartitions) {
                final Serializable data = collectorDataQueue.take();
                if (data instanceof StepExecutionImpl) {
                    final StepExecutionImpl s = (StepExecutionImpl) data;
                    fromAllPartitions.add(s);
                    final BatchStatus bs = s.getBatchStatus();

                    if (bs == BatchStatus.FAILED || bs == BatchStatus.STOPPED) {
                        final List<Integer> idxes = s.getPartitionPropertiesIndex();
                        Integer idx = null;
                        if (idxes != null && idxes.size() > 0) {
                            idx = idxes.get(0);
                        }
                        stepExecution.addPartitionPropertiesIndex(idx);
                        stepExecution.setNumOfPartitions(stepExecution.getNumOfPartitions() + 1);
                        stepExecution.addPartitionPersistentUserData(s.getPersistentUserData());
                        stepExecution.addPartitionReaderCheckpointInfo(s.getReaderCheckpointInfo());
                        stepExecution.addPartitionWriterCheckpointInfo(s.getWriterCheckpointInfo());
                        if(consolidatedBatchStatus != BatchStatus.FAILED) {
                            consolidatedBatchStatus = bs;
                        }
                    }

                    if (analyzer != null) {
                        analyzer.analyzeStatus(bs, s.getExitStatus());
                    }
                } else if (analyzer != null) {
                    analyzer.analyzeCollectorData(data);
                }
            }
View Full Code Here

Examples of org.jberet.runtime.StepExecutionImpl

    @Override
    public StepExecutionImpl createStepExecution(final String stepName) {
//        this stepExecution will be added to jobExecution later, after determining restart-if-complete, so that
//        completed steps are not added to the enclosing JobExecution
//        jobExecution.addStepExecution(stepExecution);
        return new StepExecutionImpl(stepName);
    }
View Full Code Here

Examples of org.jberet.runtime.StepExecutionImpl

        }
        final boolean isRestartNotOverride = isRestart && !isOverride;
        List<PartitionExecutionImpl> abortedPartitionExecutionsFromPrevious = null;
        if (isRestartNotOverride) {
            //need to carry over partition execution data from previous run of the same step
            final StepExecutionImpl originalStepExecution = batchContext.getOriginalStepExecution();
            abortedPartitionExecutionsFromPrevious =
                    jobContext.getJobRepository().getPartitionExecutions(originalStepExecution.getStepExecutionId(), originalStepExecution, true);
            numOfPartitions = abortedPartitionExecutionsFromPrevious.size();
        }
        if (numOfPartitions > numOfThreads) {
            completedPartitionThreads = new ArrayBlockingQueue<Boolean>(numOfPartitions);
        }
View Full Code Here

Examples of org.jberet.runtime.StepExecutionImpl

        ut.begin();
        try {
            while (fromAllPartitions.size() < numOfPartitions) {
                Serializable data = collectorDataQueue.take();
                if (data instanceof StepExecutionImpl) {
                    StepExecutionImpl s = (StepExecutionImpl) data;
                    fromAllPartitions.add(s);
                    BatchStatus bs = s.getBatchStatus();

                    if (bs == BatchStatus.FAILED || bs == BatchStatus.STOPPED) {
                        List<Integer> idxes = s.getPartitionPropertiesIndex();
                        Integer idx = null;
                        if (idxes != null && idxes.size() > 0) {
                            idx = idxes.get(0);
                        }
                        stepExecution.addPartitionPropertiesIndex(idx);
                        stepExecution.setNumOfPartitions(stepExecution.getNumOfPartitions() + 1);
                        stepExecution.addPartitionPersistentUserData(s.getPersistentUserData());
                        stepExecution.addPartitionReaderCheckpointInfo(s.getReaderCheckpointInfo());
                        stepExecution.addPartitionWriterCheckpointInfo(s.getWriterCheckpointInfo());
                        if(consolidatedBatchStatus != BatchStatus.FAILED) {
                            consolidatedBatchStatus = bs;
                        }
                    }

                    if (analyzer != null) {
                        analyzer.analyzeStatus(bs, s.getExitStatus());
                    }
                } else if (analyzer != null) {
                    analyzer.analyzeCollectorData(data);
                }
            }
View Full Code Here

Examples of org.jberet.runtime.StepExecutionImpl

        return result;
    }

    @Override
    public StepExecutionImpl createStepExecution(String stepName) {
        StepExecutionImpl stepExecution = new StepExecutionImpl(stepName);

//        this stepExecution will be added to jobExecution later, after determining restart-if-complete, so that
//        completed steps are not added to the enclosing JobExecution
//        jobExecution.addStepExecution(stepExecution);
        return stepExecution;
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.