Skip to content

Commit

Permalink
change ledgersCopied to non concurrent map
Browse files Browse the repository at this point in the history
  • Loading branch information
gavingaozhangmin committed Aug 10, 2021
1 parent d2722eb commit dd10a62
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -48,12 +48,12 @@
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ConcurrentNavigableMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
Expand Down Expand Up @@ -3203,7 +3203,7 @@ public PositionImpl getPreviousPosition(PositionImpl position) {
return PositionImpl.get(position.getLedgerId(), position.getEntryId() - 1);
}

final ConcurrentNavigableMap<Long, LedgerInfo> ledgersCopied = new ConcurrentSkipListMap<>(ledgers);
final NavigableMap<Long, LedgerInfo> ledgersCopied = new TreeMap<>(ledgers);
// The previous position will be the last position of an earlier ledgers
NavigableMap<Long, LedgerInfo> headMap = ledgersCopied.headMap(position.getLedgerId(), false);

Expand Down

0 comments on commit dd10a62

Please sign in to comment.