diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/ChangelogMergeTreeRewriter.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/ChangelogMergeTreeRewriter.java index 4c45d238773d..7be5fc74119e 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/ChangelogMergeTreeRewriter.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/ChangelogMergeTreeRewriter.java @@ -68,7 +68,7 @@ public ChangelogMergeTreeRewriter( protected abstract boolean rewriteChangelog( int outputLevel, boolean dropDelete, List> sections); - protected abstract UpgradeChangelog upgradeChangelog(int outputLevel, DataFileMeta file); + protected abstract UpgradeStrategy upgradeChangelog(int outputLevel, DataFileMeta file); protected abstract MergeFunctionWrapper createMergeWrapper(int outputLevel); @@ -164,7 +164,7 @@ private CompactResult rewriteChangelogCompaction( @Override public CompactResult upgrade(int outputLevel, DataFileMeta file) throws Exception { - UpgradeChangelog strategy = upgradeChangelog(outputLevel, file); + UpgradeStrategy strategy = upgradeChangelog(outputLevel, file); if (strategy.changelog) { return rewriteChangelogCompaction( outputLevel, @@ -177,7 +177,7 @@ public CompactResult upgrade(int outputLevel, DataFileMeta file) throws Exceptio } /** Strategy for upgrade. */ - protected enum UpgradeChangelog { + protected enum UpgradeStrategy { NO_CHANGELOG(false, false), CHANGELOG_NO_REWRITE(true, false), CHANGELOG_WITH_REWRITE(true, true); @@ -185,7 +185,7 @@ protected enum UpgradeChangelog { private final boolean changelog; private final boolean rewrite; - UpgradeChangelog(boolean changelog, boolean rewrite) { + UpgradeStrategy(boolean changelog, boolean rewrite) { this.changelog = changelog; this.rewrite = rewrite; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/FirstRowMergeTreeCompactRewriter.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/FirstRowMergeTreeCompactRewriter.java index b2b6ccada944..24f872da1188 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/FirstRowMergeTreeCompactRewriter.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/FirstRowMergeTreeCompactRewriter.java @@ -36,9 +36,9 @@ import java.util.Comparator; import java.util.List; -import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeChangelog.CHANGELOG_NO_REWRITE; -import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeChangelog.CHANGELOG_WITH_REWRITE; -import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeChangelog.NO_CHANGELOG; +import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeStrategy.CHANGELOG_NO_REWRITE; +import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeStrategy.CHANGELOG_WITH_REWRITE; +import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeStrategy.NO_CHANGELOG; import static org.apache.paimon.utils.Preconditions.checkArgument; /** @@ -80,7 +80,7 @@ protected boolean rewriteChangelog( } @Override - protected UpgradeChangelog upgradeChangelog(int outputLevel, DataFileMeta file) { + protected UpgradeStrategy upgradeChangelog(int outputLevel, DataFileMeta file) { if (file.level() != 0) { return NO_CHANGELOG; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/FullChangelogMergeTreeCompactRewriter.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/FullChangelogMergeTreeCompactRewriter.java index 5420493fdb75..b8d64fa869ac 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/FullChangelogMergeTreeCompactRewriter.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/FullChangelogMergeTreeCompactRewriter.java @@ -33,8 +33,8 @@ import java.util.Comparator; import java.util.List; -import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeChangelog.CHANGELOG_NO_REWRITE; -import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeChangelog.NO_CHANGELOG; +import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeStrategy.CHANGELOG_NO_REWRITE; +import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeStrategy.NO_CHANGELOG; /** A {@link MergeTreeCompactRewriter} which produces changelog files for each full compaction. */ public class FullChangelogMergeTreeCompactRewriter extends ChangelogMergeTreeRewriter { @@ -74,7 +74,7 @@ protected boolean rewriteChangelog( } @Override - protected UpgradeChangelog upgradeChangelog(int outputLevel, DataFileMeta file) { + protected UpgradeStrategy upgradeChangelog(int outputLevel, DataFileMeta file) { return outputLevel == maxLevel ? CHANGELOG_NO_REWRITE : NO_CHANGELOG; } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/LookupMergeTreeCompactRewriter.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/LookupMergeTreeCompactRewriter.java index 764d2324bb82..c78ded5ff0b1 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/LookupMergeTreeCompactRewriter.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/LookupMergeTreeCompactRewriter.java @@ -34,9 +34,9 @@ import java.util.Comparator; import java.util.List; -import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeChangelog.CHANGELOG_NO_REWRITE; -import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeChangelog.CHANGELOG_WITH_REWRITE; -import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeChangelog.NO_CHANGELOG; +import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeStrategy.CHANGELOG_NO_REWRITE; +import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeStrategy.CHANGELOG_WITH_REWRITE; +import static org.apache.paimon.mergetree.compact.ChangelogMergeTreeRewriter.UpgradeStrategy.NO_CHANGELOG; /** * A {@link MergeTreeCompactRewriter} which produces changelog files by lookup for the compaction @@ -77,7 +77,7 @@ protected boolean rewriteChangelog( } @Override - protected UpgradeChangelog upgradeChangelog(int outputLevel, DataFileMeta file) { + protected UpgradeStrategy upgradeChangelog(int outputLevel, DataFileMeta file) { if (file.level() != 0) { return NO_CHANGELOG; }