singhpk234 commented on code in PR #1707:
URL: https://github.com/apache/polaris/pull/1707#discussion_r2114165720


##########
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkProductionReadinessChecks.java:
##########
@@ -20,23 +20,37 @@
 
 import static 
org.eclipse.persistence.config.PersistenceUnitProperties.JDBC_URL;
 
+import io.smallrye.common.annotation.Identifier;
 import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.Any;
+import jakarta.enterprise.inject.Instance;
 import jakarta.enterprise.inject.Produces;
 import java.io.IOException;
 import java.nio.file.Path;
 import org.apache.polaris.core.config.ProductionReadinessCheck;
 import org.apache.polaris.core.config.ProductionReadinessCheck.Error;
+import org.apache.polaris.core.persistence.MetaStoreManagerFactory;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @ApplicationScoped
 public class EclipseLinkProductionReadinessChecks {
-
   private static final Logger LOGGER =
       LoggerFactory.getLogger(EclipseLinkProductionReadinessChecks.class);
 
   @Produces
-  public ProductionReadinessCheck checkJdbcUrl(EclipseLinkConfiguration 
eclipseLinkConfiguration) {
+  public ProductionReadinessCheck checkEclipseLink(
+      @ConfigProperty(name = "polaris.persistence.type") String 
persistenceType,
+      @Any Instance<MetaStoreManagerFactory> metaStoreManagerFactories,
+      EclipseLinkConfiguration eclipseLinkConfiguration) {
+    // This check should only be applicable when persistence uses EclipseLink.
+    MetaStoreManagerFactory metaStoreManagerFactory =
+        
metaStoreManagerFactories.select(Identifier.Literal.of(persistenceType)).get();

Review Comment:
   This is because both @Inject as a member of this class as well as using @Any 
Instance<MetastoreManager> and then doing .get() letter was giving ambigous 
bean, I wonder if these checks run before the bean is actually created from 
QuarkusProducers, this is the only approach worked for me.



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