dimas-b commented on code in PR #3960: URL: https://github.com/apache/polaris/pull/3960#discussion_r2931472760
########## persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DefaultDataSourceResolver.java: ########## @@ -0,0 +1,57 @@ +/* + * 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.quarkus.common.config.jdbc; + +import io.quarkus.arc.DefaultBean; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Instance; +import jakarta.inject.Inject; +import javax.sql.DataSource; +import org.apache.polaris.core.context.RealmContext; +import org.apache.polaris.persistence.relational.jdbc.DataSourceResolver; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Default implementation of {@link DataSourceResolver} that routes all realms and store types to a + * single default {@link DataSource}. This implementation acts as a fallback; downstream users can + * provide their own {@link DataSourceResolver} bean to implement custom routing logic. + */ +@ApplicationScoped +@DefaultBean +public class DefaultDataSourceResolver implements DataSourceResolver { Review Comment: How about we add a new module like `polaris-relational-jdbc-runtime` with Quarkus + Agroal dependencies? The idea is for `polaris-relational-jdbc` to remain free from Quarkus-specific dependencies (Jakarta annotations are ok). IIRC, we tried doing something like that with JDBC persistence initially, but it probably did not materialize completely :sweat_smile: -- 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]
