RESOLVED - issue BATCH-744: restart.count is always 0 in FlatFileItemWriter
This commit is contained in:
@@ -72,8 +72,6 @@ public class FlatFileItemWriter<T> extends ExecutionContextUserSupport implement
|
||||
|
||||
private static final String WRITTEN_STATISTICS_NAME = "written";
|
||||
|
||||
private static final String RESTART_COUNT_STATISTICS_NAME = "restart.count";
|
||||
|
||||
private static final String RESTART_DATA_NAME = "current.count";
|
||||
|
||||
private Resource resource;
|
||||
@@ -281,7 +279,6 @@ public class FlatFileItemWriter<T> extends ExecutionContextUserSupport implement
|
||||
}
|
||||
|
||||
executionContext.putLong(getKey(WRITTEN_STATISTICS_NAME), state.linesWritten);
|
||||
executionContext.putLong(getKey(RESTART_COUNT_STATISTICS_NAME), state.restartCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,8 +342,6 @@ public class FlatFileItemWriter<T> extends ExecutionContextUserSupport implement
|
||||
|
||||
long linesWritten = 0;
|
||||
|
||||
long restartCount = 0;
|
||||
|
||||
boolean shouldDeleteIfExists = true;
|
||||
|
||||
boolean initialized = false;
|
||||
|
||||
@@ -223,6 +223,7 @@ public class FlatFileItemWriterTests extends TestCase {
|
||||
public void testRestart() throws Exception {
|
||||
|
||||
writer.open(executionContext);
|
||||
|
||||
// write some lines
|
||||
writer.write("testLine1");
|
||||
writer.write("testLine2");
|
||||
@@ -251,7 +252,7 @@ public class FlatFileItemWriterTests extends TestCase {
|
||||
|
||||
// init with correct data
|
||||
writer.open(executionContext);
|
||||
|
||||
|
||||
// write more lines
|
||||
writer.write("testLine6");
|
||||
writer.write("testLine7");
|
||||
@@ -312,7 +313,7 @@ public class FlatFileItemWriterTests extends TestCase {
|
||||
writer.open(executionContext);
|
||||
writer.update(executionContext);
|
||||
assertNotNull(executionContext);
|
||||
assertEquals(3, executionContext.entrySet().size());
|
||||
assertEquals(2, executionContext.entrySet().size());
|
||||
assertEquals(0, executionContext.getLong(ClassUtils.getShortName(FlatFileItemWriter.class) + ".current.count"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user