huaxingao commented on code in PR #15727: URL: https://github.com/apache/iceberg/pull/15727#discussion_r3918743884
########## core/src/main/java/org/apache/iceberg/actions/RemoveDanglingDeleteFilesAction.java: ########## @@ -0,0 +1,141 @@ +/* + * 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.actions; + +import java.io.IOException; +import java.util.List; +import org.apache.iceberg.DeleteFile; +import org.apache.iceberg.FileScanTask; +import org.apache.iceberg.ManifestFile; +import org.apache.iceberg.ManifestFiles; +import org.apache.iceberg.ManifestReader; +import org.apache.iceberg.RewriteFiles; +import org.apache.iceberg.Snapshot; +import org.apache.iceberg.SnapshotRef; +import org.apache.iceberg.Table; +import org.apache.iceberg.TableScan; +import org.apache.iceberg.exceptions.RuntimeIOException; +import org.apache.iceberg.io.CloseableIterable; +import org.apache.iceberg.relocated.com.google.common.base.Preconditions; +import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList; +import org.apache.iceberg.util.DeleteFileSet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RemoveDanglingDeleteFilesAction + extends BaseSnapshotUpdateAction<RemoveDanglingDeleteFiles, RemoveDanglingDeleteFiles.Result> + implements RemoveDanglingDeleteFiles { + + private static final Logger LOG = LoggerFactory.getLogger(RemoveDanglingDeleteFilesAction.class); + private static final List<String> DELETE_COLUMNS = + ImmutableList.of("file_path", "content_offset", "content_size_in_bytes"); + + private final Table table; + private String branch = SnapshotRef.MAIN_BRANCH; + private Snapshot snapshot; + + public RemoveDanglingDeleteFilesAction(Table table) { + this.table = table; + } + + @Override + protected RemoveDanglingDeleteFilesAction self() { + return this; + } + + @Override + public Table table() { Review Comment: `table()` is `protected` in `BaseAction` and this widens it to `public`. It looks like that's only so the Spark wrapper can build its job description via `action.table().name()`. Could the wrapper keep its own `table` field instead and leave this `protected`? -- 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]
