obelix74 commented on code in PR #3385:
URL: https://github.com/apache/polaris/pull/3385#discussion_r2775965658
##########
runtime/service/src/main/java/org/apache/polaris/service/config/ServiceProducers.java:
##########
@@ -224,6 +225,29 @@ public PolarisMetaStoreManager polarisMetaStoreManager(
return metaStoreManagerFactory.getOrCreateMetaStoreManager(realmContext);
}
+ /**
+ * Produces a {@link MetricsPersistence} bean for the current request.
+ *
+ * <p>This method selects a MetricsPersistence implementation based on the
configured persistence
+ * type. If a backend-specific implementation is available (e.g., JDBC with
metrics schema), it
+ * will be used. Otherwise, falls back to the no-op implementation.
+ *
+ * @param config the persistence configuration
+ * @param metricsPersistenceImpls all available MetricsPersistence
implementations
+ * @return a MetricsPersistence implementation for the current realm
+ */
+ @Produces
+ @RequestScoped
+ public MetricsPersistence metricsPersistence(
+ PersistenceConfiguration config, @Any Instance<MetricsPersistence>
metricsPersistenceImpls) {
+ Instance<MetricsPersistence> selected =
+ metricsPersistenceImpls.select(Identifier.Literal.of(config.type()));
Review Comment:
Created `MetricsPersistenceConfiguration` for this.
--
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]