Akash3121 commented on code in PR #938: URL: https://github.com/apache/incubator-xtable/pull/938#discussion_r4052394048
########## xtable-core/src/main/java/org/apache/xtable/delta/DeltaDeletionVectorHandler.java: ########## @@ -0,0 +1,65 @@ +/* + * 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.xtable.delta; + +import java.util.function.Consumer; + +import lombok.extern.log4j.Log4j2; + +import com.google.common.annotations.VisibleForTesting; + +import org.apache.xtable.exception.NotSupportedException; + +@Log4j2 +public final class DeltaDeletionVectorHandler { + private final boolean allowUnsupportedDeletionVectors; + private final Consumer<String> warningLogger; + + public DeltaDeletionVectorHandler(boolean allowUnsupportedDeletionVectors) { + this(allowUnsupportedDeletionVectors, log::warn); + } + + @VisibleForTesting + DeltaDeletionVectorHandler( + boolean allowUnsupportedDeletionVectors, Consumer<String> warningLogger) { + this.allowUnsupportedDeletionVectors = allowUnsupportedDeletionVectors; + this.warningLogger = warningLogger; + } + + public void handle(String dataFilePath) { Review Comment: Agreed. I renamed the policy entry point to `onDeletionVectorFound(dataFilePath)` and updated the call sites so it is clear that the handler is invoked after detecting a deletion vector on an affected data file. I also removed the unused two-argument `DeltaDataFileExtractor.iterator` overload and its nullable-handler path, so callers can no longer bypass deletion-vector validation accidentally. I renamed the related local path variables for consistency as well. -- 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]
