dimas-b commented on code in PR #1707: URL: https://github.com/apache/polaris/pull/1707#discussion_r2114249784
########## 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: Quarkus CDI is able to figure out bean dependencies. When a producer method is needed for a bean, its inputs are automatically injected, I suppose. -- 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: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org