dimas-b commented on code in PR #3135: URL: https://github.com/apache/polaris/pull/3135#discussion_r2565883860
########## persistence/nosql/persistence/cdi/quarkus/src/main/java/org/apache/polaris/persistence/nosql/quarkus/backend/BackendProvider.java: ########## @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.polaris.persistence.nosql.quarkus.backend; + +import static java.lang.String.format; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Any; +import jakarta.enterprise.inject.Instance; +import jakarta.enterprise.inject.Produces; +import java.util.Optional; +import org.apache.polaris.persistence.nosql.api.backend.Backend; +import org.apache.polaris.persistence.nosql.api.backend.BackendConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@ApplicationScoped +class BackendProvider { + private static final Logger LOGGER = LoggerFactory.getLogger(BackendProvider.class); + + @Produces + @ApplicationScoped + @NotObserved + Backend backend( + BackendConfiguration backendConfiguration, @Any Instance<BackendBuilder> backendBuilders) { + + var backendName = + backendConfiguration + .type() + .orElseThrow( + () -> + new IllegalStateException( + "Mandatory configuration option polaris.persistence.backend.type is missing!")); Review Comment: @singhpk234 : I agree with your point in general, but this particular config is already in use in our downstream projects (from where we're contributing NoSQL code). Changing the config name is possible, but very inconvenient at this point (recall the very long NoSQL persistence discussion process). If you do not mind, I'd prefer to merge with the existing config names. As @snazy pointed out, config namespaces do not overlap, so there's no technical ambiguity. End users in most cases do not need to rationalize config names, IMHO, they'd mostly follow documentation, which will instruct they what exact config names to set depending on the use case. -- 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]
