fqaiser94 commented on code in PR #6513: URL: https://github.com/apache/iceberg/pull/6513#discussion_r1142708846
########## core/src/main/java/org/apache/iceberg/BasePendingUpdate.java: ########## @@ -0,0 +1,59 @@ +/* + * 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.iceberg; + +import com.google.errorprone.annotations.FormatMethod; +import java.util.List; +import java.util.function.Predicate; +import org.apache.iceberg.exceptions.ValidationException; +import org.apache.iceberg.relocated.com.google.common.collect.Lists; + +abstract class BasePendingUpdate<T> implements PendingUpdate<T> { + + private static class Validation { + private final Predicate<Table> predicate; + private final String message; + private final Object[] args; + + @FormatMethod + Validation(Predicate<Table> predicate, String message, Object... args) { + this.predicate = predicate; + this.message = message; + this.args = args; + } + } + + private final List<Validation> validations = Lists.newArrayList(); + + @Override + @FormatMethod + public final void validateCurrentTable( + Predicate<Table> predicate, String message, Object... args) { + this.validations.add(new Validation(predicate, message, args)); + } + + @SuppressWarnings("FormatStringAnnotation") + protected final void validateCurrentTableMetadata(TableMetadata base) { Review Comment: We still can't do this even after rebasing on latest master: ``` Execution failed for task ':iceberg-core:revapi'. > There were Java public API/ABI breaks reported by revapi: java.method.visibilityReduced: visibility reduced old: method void org.apache.iceberg.BaseReplacePartitions::validate(org.apache.iceberg.TableMetadata) new: method void org.apache.iceberg.BasePendingUpdate<T>::validate(org.apache.iceberg.TableMetadata) @ org.apache.iceberg.BaseReplacePartitions SOURCE: BREAKING, BINARY: BREAKING From old archive: iceberg-core-1.1.0.jar From new archive: iceberg-core-1.3.0-SNAPSHOT.jar If this is an acceptable break that will not harm your users, you can ignore it in future runs like so for: * Just this break: ./gradlew :iceberg-core:revapiAcceptBreak --justification "{why this break is ok}" \ --code "java.method.visibilityReduced" \ --old "method void org.apache.iceberg.BaseReplacePartitions::validate(org.apache.iceberg.TableMetadata)" \ --new "method void org.apache.iceberg.BasePendingUpdate<T>::validate(org.apache.iceberg.TableMetadata) @ org.apache.iceberg.BaseReplacePartitions" * All breaks in this project: ./gradlew :iceberg-core:revapiAcceptAllBreaks --justification "{why this break is ok}" * All breaks in all projects: ./gradlew revapiAcceptAllBreaks --justification "{why this break is ok}" ---------------------------------------------------------------------------------------------------- java.method.movedToSuperClass: The method used to be declared in class 'org.apache.iceberg.BaseReplacePartitions' but is now declared in superclass 'org.apache.iceberg.BasePendingUpdate<T extends java.lang.Object>'. old: method void org.apache.iceberg.BaseReplacePartitions::validate(org.apache.iceberg.TableMetadata) new: method void org.apache.iceberg.BasePendingUpdate<T>::validate(org.apache.iceberg.TableMetadata) @ org.apache.iceberg.BaseReplacePartitions SOURCE: EQUIVALENT, BINARY: EQUIVALENT From old archive: iceberg-core-1.1.0.jar From new archive: iceberg-core-1.3.0-SNAPSHOT.jar If this is an acceptable break that will not harm your users, you can ignore it in future runs like so for: * Just this break: ./gradlew :iceberg-core:revapiAcceptBreak --justification "{why this break is ok}" \ --code "java.method.movedToSuperClass" \ --old "method void org.apache.iceberg.BaseReplacePartitions::validate(org.apache.iceberg.TableMetadata)" \ --new "method void org.apache.iceberg.BasePendingUpdate<T>::validate(org.apache.iceberg.TableMetadata) @ org.apache.iceberg.BaseReplacePartitions" * All breaks in this project: ./gradlew :iceberg-core:revapiAcceptAllBreaks --justification "{why this break is ok}" * All breaks in all projects: ./gradlew revapiAcceptAllBreaks --justification "{why this break is ok}" ---------------------------------------------------------------------------------------------------- java.element.noLongerDeprecated: The element is no longer deprecated. old: method void org.apache.iceberg.BaseReplacePartitions::validate(org.apache.iceberg.TableMetadata) new: method void org.apache.iceberg.BasePendingUpdate<T>::validate(org.apache.iceberg.TableMetadata) @ org.apache.iceberg.BaseReplacePartitions SOURCE: EQUIVALENT, BINARY: EQUIVALENT From old archive: iceberg-core-1.1.0.jar From new archive: iceberg-core-1.3.0-SNAPSHOT.jar If this is an acceptable break that will not harm your users, you can ignore it in future runs like so for: * Just this break: ./gradlew :iceberg-core:revapiAcceptBreak --justification "{why this break is ok}" \ --code "java.element.noLongerDeprecated" \ --old "method void org.apache.iceberg.BaseReplacePartitions::validate(org.apache.iceberg.TableMetadata)" \ --new "method void org.apache.iceberg.BasePendingUpdate<T>::validate(org.apache.iceberg.TableMetadata) @ org.apache.iceberg.BaseReplacePartitions" * All breaks in this project: ./gradlew :iceberg-core:revapiAcceptAllBreaks --justification "{why this break is ok}" * All breaks in all projects: ./gradlew revapiAcceptAllBreaks --justification "{why this break is ok}" ---------------------------------------------------------------------------------------------------- ``` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
