mirror of https://github.com/apache/nifi.git
NIFI-3689: Fixed threading bug in TestWriteAheadStorePartition - multiple threads were simultaneously attempting to update HashMap. Changed impl to ConcurrentHashMap.
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #2214.
This commit is contained in:
parent
fb839fff56
commit
2acf6bdf7a
|
@ -22,10 +22,10 @@ import static org.junit.Assert.assertEquals;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -72,7 +72,7 @@ public class TestWriteAheadStorePartition {
|
|||
partition.addEvents(Collections.singleton(TestUtil.createEvent()));
|
||||
}
|
||||
|
||||
final Map<ProvenanceEventRecord, StorageSummary> reindexedEvents = new HashMap<>();
|
||||
final Map<ProvenanceEventRecord, StorageSummary> reindexedEvents = new ConcurrentHashMap<>();
|
||||
final EventIndex eventIndex = Mockito.mock(EventIndex.class);
|
||||
Mockito.doAnswer(new Answer<Object>() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue