dennishuo commented on code in PR #4269: URL: https://github.com/apache/polaris/pull/4269#discussion_r3243082105
########## persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/idempotency/RelationalJdbcIdempotencyStore.java: ########## @@ -1,250 +0,0 @@ -/* - * 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.relational.jdbc.idempotency; - -import jakarta.annotation.Nonnull; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.time.Instant; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import javax.sql.DataSource; -import org.apache.polaris.core.entity.IdempotencyRecord; -import org.apache.polaris.core.persistence.IdempotencyPersistenceException; -import org.apache.polaris.core.persistence.IdempotencyStore; -import org.apache.polaris.persistence.relational.jdbc.DatasourceOperations; -import org.apache.polaris.persistence.relational.jdbc.QueryGenerator; -import org.apache.polaris.persistence.relational.jdbc.RelationalJdbcConfiguration; -import org.apache.polaris.persistence.relational.jdbc.models.Converter; -import org.apache.polaris.persistence.relational.jdbc.models.ModelIdempotencyRecord; - -public class RelationalJdbcIdempotencyStore implements IdempotencyStore { Review Comment: For easy discoverability/posterity, here's the link to the mailing list discussion that included discussion about the SPI: https://lists.apache.org/thread/nk49rfgbzt2nsvplny14wrp98occ61w4 (and specifically that's the link to my stance). The TL;DR of my stance was that I agree with wanting to keep `IdempotencyPersistence` split out of `BasePersistence`, and basically we can follow the pattern of how `IntegrationPersistence` was mixed in, still allowing expressing a concrete implementation that explicitly relies on transactions across the persistence interfaces -- today that's expressed via `TransactionalPersistence extends BasePersistence, IntegrationPersistence[, IdempotencyPersistence]`. Specifically, we wanted the ability for implementors to choose their cross-concern transactionality semantics. So, if they write a `MyBasicPersistenceOnDynamo implements BasePersistence` and YoloPersistenceAddonsOnRedis implements IntegrationPersistence, IdempotencyPersistence` that's still possible. On this line of code though it would mean we're allowing JDBC to have one conceptual *concrete implementation* which intentionally simultaneously implements the different persistences at once. I suppose we could always still refactor into different JdbcIdempotencyStoreImpl, JdbcIntegrationStoreImpl, etc., but that'd need to have some more complex wiring/shared-state nonetheless if the intent *for JDBC specifically* is indeed to say that we're intentionally putting them all in the same underlying store. -- 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]
