ARTEMIS-4406: update LocalCache persisted entry tracking to use a ConcurrentHashMap

This commit is contained in:
Robbie Gemmell 2023-08-29 10:07:32 +01:00
parent df410da7ae
commit c1648d5917
1 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import java.lang.invoke.MethodHandles;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
public class LocalCache implements Cache, RemovalListener<String, String> {
@ -70,7 +71,7 @@ public class LocalCache implements Cache, RemovalListener<String, String> {
@Override
public void start() {
if (persisted) {
persistedCacheEntries = storageManager.getPersistedKeyValuePairs(id);
persistedCacheEntries = new ConcurrentHashMap<>(storageManager.getPersistedKeyValuePairs(id));
if (persistedCacheEntries != null) {
for (Map.Entry<String, PersistedKeyValuePair> cacheEntry : persistedCacheEntries.entrySet()) {