BATCH-2151: Clean up ChunkMonitor offset on chunk boundries

This commit is contained in:
Michael Minella
2013-12-27 11:46:39 -06:00
parent 6edc91fcea
commit 874b92d4b2
2 changed files with 5 additions and 0 deletions

View File

@@ -140,6 +140,7 @@ public class ChunkMonitor extends ItemStreamSupport {
// Only call the underlying update method if we are on a chunk
// boundary
stream.update(executionContext);
executionContext.remove(getExecutionContextKey(OFFSET));
}
else {
executionContext.putInt(getExecutionContextKey(OFFSET), data.offset);

View File

@@ -128,6 +128,10 @@ public class ChunkMonitorTests {
ExecutionContext executionContext = new ExecutionContext();
monitor.update(executionContext);
assertEquals(0, executionContext.size());
executionContext.put(ChunkMonitor.class.getName() + ".OFFSET", 3);
monitor.update(executionContext);
assertEquals(0, executionContext.size());
}
@Test