@Override public void stop() { stepContext.setBatchStatus(BatchStatus.STOPPING); // we don't need to call stop on the chunk implementation here since a // chunk always returns control to // the batch container after every item. }
@Override public Serializable getPersistentUserData() { if (stepContext != null){ return this.stepContext.getPersistentUserData(); } else { return this.persistentUserData; } }
@Override public String getExitStatus() { if (stepContext != null){ return this.stepContext.getExitStatus(); } else { return exitStatus; } }
private void updateNormalMetrics(int writeCount) { int readCount = currentChunkStatus.getItemsTouchedInCurrentChunk(); int filterCount = readCount - writeCount; if (readCount < 0 || filterCount < 0 || writeCount < 0) { throw new IllegalStateException("Somehow one of the metrics was zero. Read count: " + readCount + ", Filter count: " + filterCount + ", Write count: " + writeCount); } stepContext.getMetric(MetricImpl.MetricType.COMMIT_COUNT).incValue(); stepContext.getMetric(MetricImpl.MetricType.READ_COUNT).incValueBy(readCount); stepContext.getMetric(MetricImpl.MetricType.FILTER_COUNT).incValueBy(filterCount); stepContext.getMetric(MetricImpl.MetricType.WRITE_COUNT).incValueBy(writeCount); }
@Override public Metric[] getMetrics() { if (stepContext != null) { return stepContext.getMetrics(); } else { Metric[] metrics = new MetricImpl[8]; metrics[0] = new MetricImpl(MetricImpl.MetricType.READ_COUNT, readCount); metrics[1] = new MetricImpl(MetricImpl.MetricType.WRITE_COUNT, writeCount); metrics[2] = new MetricImpl(MetricImpl.MetricType.COMMIT_COUNT, commitCount); metrics[3] = new MetricImpl(MetricImpl.MetricType.ROLLBACK_COUNT, rollbackCount); metrics[4] = new MetricImpl(MetricImpl.MetricType.READ_SKIP_COUNT, readSkipCount); metrics[5] = new MetricImpl(MetricImpl.MetricType.PROCESS_SKIP_COUNT, processSkipCount); metrics[6] = new MetricImpl(MetricImpl.MetricType.FILTER_COUNT, filterCount); metrics[7] = new MetricImpl(MetricImpl.MetricType.WRITE_SKIP_COUNT, writeSkipCount); return metrics; } }
protected synchronized boolean wasStopIssued() { // Might only be set to stopping at the job level. Use the lock for this object on this // method along with the stop() method if (jobExecutionImpl.getJobContext().getBatchStatus().equals(BatchStatus.STOPPING)){ stepContext.setBatchStatus(BatchStatus.STOPPING); return true; } else { return false; } } @Override
@Override public Metric[] getMetrics() { Metric[] metrics = new MetricImpl[8]; metrics[0] = new MetricImpl(MetricImpl.MetricType.READ_COUNT, readCount); metrics[1] = new MetricImpl(MetricImpl.MetricType.WRITE_COUNT, writeCount); metrics[2] = new MetricImpl(MetricImpl.MetricType.COMMIT_COUNT, commitCount); metrics[3] = new MetricImpl(MetricImpl.MetricType.ROLLBACK_COUNT, rollbackCount); metrics[4] = new MetricImpl(MetricImpl.MetricType.READ_SKIP_COUNT, readSkipCount); metrics[5] = new MetricImpl(MetricImpl.MetricType.PROCESS_SKIP_COUNT, processSkipCount); metrics[6] = new MetricImpl(MetricImpl.MetricType.FILTER_COUNT, filterCount); metrics[7] = new MetricImpl(MetricImpl.MetricType.WRITE_SKIP_COUNT, writeSkipCount); return metrics; }
@Override public BatchStatus getBatchStatus() { if (stepContext != null) { return this.stepContext.getBatchStatus(); } else { return batchStatus; } }
@Override public String getStepName() { if (stepContext != null) { return this.stepContext.getStepName(); } else { return stepName; } }
public String getExitStatus() { return this.jobContext.getExitStatus(); }
public BatchStatus getBatchStatus() { return this.jobContext.getBatchStatus(); }
@Override public Metric[] getMetrics() { if (stepContext != null){ return stepContext.getMetrics(); } else { Metric[] metrics = new MetricImpl[8]; metrics[0] = new MetricImpl(MetricImpl.MetricType.READ_COUNT, readCount); metrics[1] = new MetricImpl(MetricImpl.MetricType.WRITE_COUNT, writeCount); metrics[2] = new MetricImpl(MetricImpl.MetricType.COMMIT_COUNT, commitCount); metrics[3] = new MetricImpl(MetricImpl.MetricType.ROLLBACK_COUNT, rollbackCount); metrics[4] = new MetricImpl(MetricImpl.MetricType.READ_SKIP_COUNT, readSkipCount); metrics[5] = new MetricImpl(MetricImpl.MetricType.PROCESS_SKIP_COUNT, processSkipCount); metrics[6] = new MetricImpl(MetricImpl.MetricType.FILTER_COUNT, filterCount); metrics[7] = new MetricImpl(MetricImpl.MetricType.WRITE_SKIP_COUNT, writeSkipCount); return metrics; } }
protected synchronized boolean wasStopIssued() { // Might only be set to stopping at the job level. Use the lock for this object on this // method along with the stop() method if (jobExecutionImpl.getJobContext().getBatchStatus().equals(BatchStatus.STOPPING)){ stepContext.setBatchStatus(BatchStatus.STOPPING); return true; } else { return false; } } @Override
@Override public void stop() { stepContext.setBatchStatus(BatchStatus.STOPPING); // we don't need to call stop on the chunk implementation here since a // chunk always returns control to // the batch container after every item. }
@Override public Serializable getPersistentUserData() { if (stepContext != null) { return this.stepContext.getPersistentUserData(); } else { return this.persistentUserData; } }
@Override public String getExitStatus() { if (stepContext != null){ return this.stepContext.getExitStatus(); } else { return exitStatus; } }
@Override public BatchStatus getBatchStatus() { if (stepContext != null){ return this.stepContext.getBatchStatus(); } else { return batchStatus; } }
@Override public String getStepName() { if (stepContext != null){ return this.stepContext.getStepName(); } else { return stepName; } }
public String getExitStatus() { return this.jobContext.getExitStatus(); }
public BatchStatus getBatchStatus() { return this.jobContext.getBatchStatus(); }