From 10a5c20edbdfc871d83c7d5117a0ce0c23e7c60c Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 2 Mar 2023 12:40:36 +0100 Subject: [PATCH] Use ConcurrentNavigableMap Make sure we mark the map as concurrent, as that is the implementation we use and it seems we rely on it being concurrent. JIRA: CONTROLLER-2071 Change-Id: I1deb9e42978fbc6373085e8280822f61541f1066 Signed-off-by: Robert Varga --- .../main/java/io/atomix/storage/journal/SegmentedJournal.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third-party/atomix/storage/src/main/java/io/atomix/storage/journal/SegmentedJournal.java b/third-party/atomix/storage/src/main/java/io/atomix/storage/journal/SegmentedJournal.java index 45490757f8..a452587b76 100644 --- a/third-party/atomix/storage/src/main/java/io/atomix/storage/journal/SegmentedJournal.java +++ b/third-party/atomix/storage/src/main/java/io/atomix/storage/journal/SegmentedJournal.java @@ -24,9 +24,9 @@ import java.nio.file.StandardOpenOption; import java.util.Collection; import java.util.Iterator; import java.util.Map; -import java.util.NavigableMap; import java.util.SortedMap; import java.util.TreeMap; +import java.util.concurrent.ConcurrentNavigableMap; import java.util.concurrent.ConcurrentSkipListMap; import com.google.common.collect.Sets; @@ -67,7 +67,7 @@ public final class SegmentedJournal implements Journal { private final SegmentedJournalWriter writer; private volatile long commitIndex; - private final NavigableMap> segments = new ConcurrentSkipListMap<>(); + private final ConcurrentNavigableMap> segments = new ConcurrentSkipListMap<>(); private final Collection> readers = Sets.newConcurrentHashSet(); private JournalSegment currentSegment; -- 2.36.6