Skip to content

Commit

Permalink
Make RealmEntityManagerFactory thread-safe (apache#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra authored Dec 11, 2024
1 parent b9d16eb commit 3dad7d8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

import jakarta.inject.Inject;
import jakarta.inject.Provider;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.polaris.core.context.RealmContext;
import org.apache.polaris.core.persistence.MetaStoreManagerFactory;
import org.apache.polaris.core.persistence.PolarisEntityManager;
Expand All @@ -35,7 +35,7 @@ public class RealmEntityManagerFactory {
private final MetaStoreManagerFactory metaStoreManagerFactory;

// Key: realmIdentifier
private final Map<String, PolarisEntityManager> cachedEntityManagers = new HashMap<>();
private final Map<String, PolarisEntityManager> cachedEntityManagers = new ConcurrentHashMap<>();
private final Provider<EntityCache> entityCache;

// Subclasses for test injection.
Expand Down

0 comments on commit 3dad7d8

Please sign in to comment.