Updated to call PartitionCollector regardless of if the partition completes successfully

This commit is contained in:
Michael Minella
2013-12-16 15:40:36 -06:00
parent bfd6bccd72
commit 2f63bd0664
2 changed files with 8 additions and 1 deletions

View File

@@ -64,5 +64,12 @@ public class PartitionCollectorAdapter implements ChunkListener {
@Override
public void afterChunkError(ChunkContext context) {
try {
synchronized (partitionQueue) {
partitionQueue.add(collector.collectPartitionData());
}
} catch (Throwable e) {
throw new BatchRuntimeException("An error occured while collecting data from the PartionCollector", e);
}
}
}

View File

@@ -44,7 +44,7 @@ public class PartitionCollectorAdapterTests {
});
adapter.afterChunk(null);
adapter.afterChunk(null);
adapter.afterChunkError(null);
adapter.afterChunk(null);
assertEquals(3, dataQueue.size());