the-other-tim-brown commented on code in PR #13307: URL: https://github.com/apache/hudi/pull/13307#discussion_r2129946836
########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/callback/common/WriteStatusValidator.java: ########## @@ -0,0 +1,44 @@ +/* + * 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.hudi.callback.common; + +import org.apache.hudi.client.WriteStatus; +import org.apache.hudi.common.data.HoodieData; +import org.apache.hudi.common.util.Option; + +/** + * WriteStatus validator to assist caller to process errors if any. Caller can dictate if to proceed with the commit or not by means of the return + * value of the method {@link WriteStatusValidator#validate}. + * + * <p>Sometimes callers invoke the dag just to process if there are any errors before proceeding with the commit. + * This hook function is introduced for avoiding additional dag triggers from the callers side. + */ +public interface WriteStatusValidator { + + /** + * Validates the given write status. + * + * @param totalRecords Total records in this inflight commit. + * @param totalErroredRecords Total error records in this inflight commit. + * @param writeStatusesOpt List of {@link WriteStatus} for the data table writes for this inflight commit. + * + * @return True if the commit can proceed Review Comment: Can you update the comment with what that old flow is then? The expected behavior is not clear since it only mentions the `true` case. Is it possible this returns false? -- 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]
