Java Code Examples for org.springframework.batch.core.StepExecution#setCommitCount()
The following examples show how to use
org.springframework.batch.core.StepExecution#setCommitCount() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JdbcSearchableStepExecutionDao.java From spring-cloud-dataflow with Apache License 2.0 | 6 votes |
public StepExecution mapRow(ResultSet rs, int rowNum) throws SQLException { StepExecution stepExecution = new StepExecution(rs.getString(2), null); stepExecution.setId(rs.getLong(1)); stepExecution.setStartTime(rs.getTimestamp(3)); stepExecution.setEndTime(rs.getTimestamp(4)); stepExecution.setStatus(BatchStatus.valueOf(rs.getString(5))); stepExecution.setCommitCount(rs.getInt(6)); stepExecution.setReadCount(rs.getInt(7)); stepExecution.setFilterCount(rs.getInt(8)); stepExecution.setWriteCount(rs.getInt(9)); stepExecution.setExitStatus(new ExitStatus(rs.getString(10), rs.getString(11))); stepExecution.setReadSkipCount(rs.getInt(12)); stepExecution.setWriteSkipCount(rs.getInt(13)); stepExecution.setProcessSkipCount(rs.getInt(14)); stepExecution.setRollbackCount(rs.getInt(15)); stepExecution.setLastUpdated(rs.getTimestamp(16)); stepExecution.setVersion(rs.getInt(17)); return stepExecution; }
Example 2
Source File: StepExecutionEventTests.java From spring-cloud-task with Apache License 2.0 | 5 votes |
@Test public void testBasic() { StepExecution stepExecution = getBasicStepExecution(); stepExecution.setCommitCount(1); stepExecution.setReadCount(2); stepExecution.setWriteCount(3); stepExecution.setReadSkipCount(4); stepExecution.setWriteSkipCount(5); StepExecutionEvent stepExecutionEvent = new StepExecutionEvent(stepExecution); assertThat(stepExecutionEvent.getStepName()) .as("stepName result was not as expected").isEqualTo(STEP_NAME); assertThat(stepExecutionEvent.getStartTime()) .as("startTime result was not as expected") .isEqualTo(stepExecution.getStartTime()); assertThat(stepExecutionEvent.getEndTime()) .as("endTime result was not as expected") .isEqualTo(stepExecution.getEndTime()); assertThat(stepExecutionEvent.getLastUpdated()) .as("lastUpdated result was not as expected") .isEqualTo(stepExecution.getLastUpdated()); assertThat(stepExecutionEvent.getCommitCount()) .as("commitCount result was not as expected") .isEqualTo(stepExecution.getCommitCount()); assertThat(stepExecutionEvent.getReadCount()) .as("readCount result was not as expected") .isEqualTo(stepExecution.getReadCount()); assertThat(stepExecutionEvent.getReadSkipCount()) .as("readSkipCount result was not as expected") .isEqualTo(stepExecution.getReadSkipCount()); assertThat(stepExecutionEvent.getWriteCount()) .as("writeCount result was not as expected") .isEqualTo(stepExecution.getWriteCount()); assertThat(stepExecutionEvent.getWriteSkipCount()) .as("writeSkipCount result was not as expected") .isEqualTo(stepExecution.getWriteSkipCount()); assertThat(stepExecutionEvent.getSkipCount()) .as("skipCount result was not as expected") .isEqualTo(stepExecution.getSkipCount()); }