For IntelliJ IDEA and
Android Studio


public static StepExecutionEntity create(final StepExecution stepExecution) { final StepExecutionEntity result = new StepExecutionEntity(); result.id = stepExecution.getStepExecutionId(); result.name = stepExecution.getStepName(); result.status = stepExecution.getBatchStatus(); result.exitStatus = stepExecution.getExitStatus(); result.endTime = stepExecution.getEndTime(); result.startTime = stepExecution.getStartTime(); // metrics result.metrics = new HashMap<>(); final Metric[] metricArr = stepExecution.getMetrics(); for (Metric m : metricArr) { result.metrics.put(m.getType().name().toLowerCase(), m.getValue()); } if (stepExecution.getPersistentUserData() != null) { result.setPersistentUserData(stepExecution.getPersistentUserData().toString()); } return result; }
@Override public void updateStepExecution(final StepExecution stepExecution) { final StepExecutionImpl stepExecutionImpl = (StepExecutionImpl) stepExecution; try { final DBObject update = new BasicDBObject(TableColumns.ENDTIME, stepExecution.getEndTime()); update.put(TableColumns.BATCHSTATUS, stepExecution.getBatchStatus().name()); update.put(TableColumns.EXITSTATUS, stepExecution.getExitStatus()); update.put(TableColumns.EXECUTIONEXCEPTION, TableColumns.formatException(stepExecutionImpl.getException())); update.put(TableColumns.PERSISTENTUSERDATA, BatchUtil.objectToBytes(stepExecution.getPersistentUserData())); update.put(TableColumns.READCOUNT, stepExecutionImpl.getStepMetrics().get(Metric.MetricType.READ_COUNT)); update.put(TableColumns.WRITECOUNT, stepExecutionImpl.getStepMetrics().get(Metric.MetricType.WRITE_COUNT)); update.put(TableColumns.COMMITCOUNT, stepExecutionImpl.getStepMetrics().get(Metric.MetricType.COMMIT_COUNT)); update.put(TableColumns.ROLLBACKCOUNT, stepExecutionImpl.getStepMetrics().get(Metric.MetricType.ROLLBACK_COUNT)); update.put(TableColumns.READSKIPCOUNT, stepExecutionImpl.getStepMetrics().get(Metric.MetricType.READ_SKIP_COUNT)); update.put(TableColumns.PROCESSSKIPCOUNT, stepExecutionImpl.getStepMetrics().get(Metric.MetricType.PROCESS_SKIP_COUNT)); update.put(TableColumns.FILTERCOUNT, stepExecutionImpl.getStepMetrics().get(Metric.MetricType.FILTER_COUNT)); update.put(TableColumns.WRITESKIPCOUNT, stepExecutionImpl.getStepMetrics().get(Metric.MetricType.WRITE_SKIP_COUNT)); update.put(TableColumns.READERCHECKPOINTINFO, BatchUtil.objectToBytes(stepExecutionImpl.getReaderCheckpointInfo())); update.put(TableColumns.WRITERCHECKPOINTINFO, BatchUtil.objectToBytes(stepExecutionImpl.getWriterCheckpointInfo())); db.getCollection(TableColumns.STEP_EXECUTION).update( new BasicDBObject(TableColumns.STEPEXECUTIONID, stepExecution.getStepExecutionId()), new BasicDBObject("$set", update)); } catch (final Exception e) { throw BatchMessages.MESSAGES.failToRunQuery(e, "updateStepExecution"); } }
StepExecution step = jobOperator.getStepExecutions(jobContext.getInstanceId()).get(0); getJobLogger().log(Level.INFO, "Job start = " + step.getStartTime()); getJobLogger().log(Level.INFO, "Job end = " + step.getEndTime()); getJobLogger().log(Level.INFO, "Job exit status = " + step.getExitStatus());
if (stepExecution.getEndTime() != null) { data = stepExecution.getEndTime().getTime(); cfData[index] = stepExecution.getEndTime().toString(); } else { data = "";
try { preparedStatement = connection.prepareStatement(update); preparedStatement.setTimestamp(1, createTimestamp(stepExecution.getEndTime())); preparedStatement.setString(2, stepExecution.getBatchStatus().name()); preparedStatement.setString(3, stepExecution.getExitStatus());
if (stepExecution.getEndTime() != null) { data = stepExecution.getEndTime().getTime(); cfData[index] = stepExecution.getEndTime().toString(); } else { data = "";