dimas-b commented on code in PR #2555:
URL: https://github.com/apache/polaris/pull/2555#discussion_r2415219019


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/InMemoryEntityCache.java:
##########
@@ -43,19 +42,12 @@
 public class InMemoryEntityCache implements EntityCache {
 
   private final PolarisDiagnostics diagnostics;
-  private final PolarisMetaStoreManager polarisMetaStoreManager;

Review Comment:
   I suppose InMemoryEntityCache must use a PolarisMetaStoreManager from the 
same realm. If `PolarisMetaStoreManager` is a method parameter it become not so 
obvious. WDYT about keeping this field?



##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java:
##########
@@ -196,52 +188,46 @@ public Map<String, BaseResult> 
purgeRealms(Iterable<String> realms) {
 
     for (String realm : realms) {
       RealmContext realmContext = () -> realm;
-      PolarisMetaStoreManager metaStoreManager = 
getOrCreateMetaStoreManager(realmContext);
-      BasePersistence session = getOrCreateSession(realmContext);
+      PolarisMetaStoreManager metaStoreManager = 
createMetaStoreManager(realmContext, null);
 
-      PolarisCallContext callContext = new PolarisCallContext(realmContext, 
session);
-      BaseResult result = metaStoreManager.purge(callContext);
+      BaseResult result = metaStoreManager.purge();
       results.put(realm, result);
 
       sessionSupplierMap.remove(realm);
-      metaStoreManagerMap.remove(realm);
     }
 
     return Map.copyOf(results);
   }
 
   @Override
-  public synchronized PolarisMetaStoreManager getOrCreateMetaStoreManager(
-      RealmContext realmContext) {
-    if (!metaStoreManagerMap.containsKey(realmContext.getRealmIdentifier())) {
-      DatasourceOperations datasourceOperations = getDatasourceOperations();
-      initializeForRealm(datasourceOperations, realmContext, null);
-      checkPolarisServiceBootstrappedForRealm(realmContext);
+  public PolarisMetaStoreManager createMetaStoreManager(
+      RealmContext realmContext, @Nullable RealmConfig realmConfig) {
+    if (realmConfig == null) {
+      realmConfig = new RealmConfigImpl(configurationStore, realmContext);

Review Comment:
   Do we need the `realmConfig` parameter at all?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to