Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra committed Feb 1, 2025
1 parent 84d3a9d commit 7eac58a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public abstract class LocalPolarisMetaStoreManagerFactory<StoreType>
private static final Logger LOGGER =
LoggerFactory.getLogger(LocalPolarisMetaStoreManagerFactory.class);

// These maps are all keyed by RealmId.id(); we avoid keying by RealmId to avoid using a CDI proxy
// as a key
private final Map<String, PolarisMetaStoreManager> metaStoreManagerMap = new HashMap<>();
private final Map<String, StorageCredentialCache> storageCredentialCacheMap = new HashMap<>();
private final Map<String, EntityCache> entityCacheMap = new HashMap<>();
Expand Down Expand Up @@ -107,6 +109,7 @@ public synchronized Map<RealmId, PrincipalSecretsResult> bootstrapRealms(
PrincipalSecretsResult secretsResult =
bootstrapServiceAndCreatePolarisPrincipalForRealm(
realm, metaStoreManagerMap.get(realm.id()));
// copy to avoid using a CDI proxy as a key
results.put(ImmutableRealmId.copyOf(realm), secretsResult);
}
}
Expand All @@ -123,6 +126,7 @@ public synchronized Map<RealmId, BaseResult> purgeRealms(List<RealmId> realms) {
PolarisMetaStoreSession session = getOrCreateSessionSupplier(realm).get();

BaseResult result = metaStoreManager.purge(session);
// copy to avoid using a CDI proxy as a key
results.put(ImmutableRealmId.copyOf(realm), result);

storageCredentialCacheMap.remove(realm.id());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public class InMemoryPolarisMetaStoreManagerFactory
extends LocalPolarisMetaStoreManagerFactory<PolarisTreeMapStore> {

private final PolarisStorageIntegrationProvider storageIntegration;

// This set contains RealmId.id() values; we avoid using RealmId to avoid putting CDI beans in
// the set.
private final Set<String> bootstrappedRealms = new CopyOnWriteArraySet<>();

public InMemoryPolarisMetaStoreManagerFactory() {
Expand Down

0 comments on commit 7eac58a

Please sign in to comment.