Added synchronization to the setting of partition data

This commit is contained in:
Michael Minella
2013-12-16 14:33:24 -06:00
parent b9b23e639d
commit bfd6bccd72

View File

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