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


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/MetaStoreManagerFactory.java:
##########
@@ -26,13 +26,25 @@
 import org.apache.polaris.core.persistence.cache.EntityCache;
 import org.apache.polaris.core.persistence.dao.entity.BaseResult;
 import org.apache.polaris.core.persistence.dao.entity.PrincipalSecretsResult;
+import org.apache.polaris.core.persistence.metrics.MetricsPersistence;
+import org.apache.polaris.core.policy.PolicyMappingPersistence;
 
 /** Configuration interface for configuring the {@link 
PolarisMetaStoreManager}. */
 public interface MetaStoreManagerFactory {
 
   PolarisMetaStoreManager getOrCreateMetaStoreManager(RealmContext 
realmContext);
 
-  BasePersistence getOrCreateSession(RealmContext realmContext);
+  /** Returns the per-realm {@link BasePersistence}. */
+  BasePersistence getOrCreateBasePersistence(RealmContext realmContext);
+
+  /** Returns the per-realm {@link PolicyMappingPersistence}. */
+  PolicyMappingPersistence getOrCreatePolicyMappingPersistence(RealmContext 
realmContext);
+
+  /** Returns the per-realm {@link MetricsPersistence}. */
+  MetricsPersistence getOrCreateMetricsPersistence(RealmContext realmContext);

Review Comment:
   * Metrics are submitted out-of-band compared to Catalog Entity changes. 
There is no implicit requirement for Metrics to be submitted strictly for 
existing entities (clients cannot know what happens to the catalog while the 
process data).
   * Metrics are effectively a time series, while "meta store" represents a 
"state" at a particular point in time.
   * Metrics retention does not have to be bound to the retention of the 
related catalog entities.
   * Metrics are likely queried outside the context of mainstream catalog 
operations (like loading a table).
   
   With that in mind, I believe, it is quite natural that Metrics may have a 
different persistence impl. than the "meta store", hence my point about using 
separate factories for them.



-- 
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