nastra commented on code in PR #6513: URL: https://github.com/apache/iceberg/pull/6513#discussion_r1135673187
########## 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: I think it would make more sense to name this `validate(..)` maybe? RevAPI is probably getting confused because we deprecated and then removed the method in https://github.com/apache/iceberg/commit/5a9eb3c20a3867d6ca5ba0d4bea87e1760bab84c#diff-736caed551a388d34b08f223954ae7ecb2fdac9d90a4098ceedd95207d7efd4dR323-R325 -- 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]
