Added synchronization to the setting of partition data
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user