wzhero1 commented on code in PR #7027:
URL: https://github.com/apache/paimon/pull/7027#discussion_r2973198787
##########
paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java:
##########
@@ -18,49 +18,43 @@
package org.apache.paimon.table;
-import org.apache.paimon.Changelog;
-import org.apache.paimon.Snapshot;
import org.apache.paimon.annotation.VisibleForTesting;
import org.apache.paimon.consumer.ConsumerManager;
-import org.apache.paimon.manifest.ExpireFileEntry;
import org.apache.paimon.operation.SnapshotDeletion;
+import org.apache.paimon.operation.expire.ExpireSnapshotsExecutor;
+import org.apache.paimon.operation.expire.ExpireSnapshotsPlan;
+import org.apache.paimon.operation.expire.ExpireSnapshotsPlanner;
+import org.apache.paimon.operation.expire.SnapshotExpireTask;
import org.apache.paimon.options.ExpireConfig;
import org.apache.paimon.utils.ChangelogManager;
-import org.apache.paimon.utils.Preconditions;
import org.apache.paimon.utils.SnapshotManager;
import org.apache.paimon.utils.TagManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.util.ArrayList;
import java.util.HashSet;
-import java.util.List;
-import java.util.Optional;
import java.util.Set;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executor;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-import static
org.apache.paimon.utils.SnapshotManager.findPreviousOrEqualSnapshot;
-import static org.apache.paimon.utils.SnapshotManager.findPreviousSnapshot;
-
-/** An implementation for {@link ExpireSnapshots}. */
+/**
+ * An implementation for {@link ExpireSnapshots}.
+ *
+ * <p>This implementation uses serial execution mode, which is suitable for
local execution. The
+ * execution follows four phases:
+ *
+ * <ul>
+ * <li>Phase 1a: Delete all data files (using dataFileTasks)
+ * <li>Phase 1b: Delete all changelog files (using changelogFileTasks)
+ * <li>Phase 2a: Delete all manifests (using manifestTasks)
+ * <li>Phase 2b: Delete all snapshot files (using snapshotFileTasks)
+ * </ul>
+ */
public class ExpireSnapshotsImpl implements ExpireSnapshots {
Review Comment:
done, remove the complete re-structure to ExpireSnapshotsImpl.
--
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]