Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxiaojian committed Mar 6, 2024
1 parent db3e615 commit fd9027e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ public TagManager tagManager() {

@Override
public BranchManager branchManager() {
return new BranchManager(fileIO, path, snapshotManager(), tagManager(), schemaManager());
return new BranchManager(
fileIO, path, snapshotManager(), tagManager(), schemaManager(), rollbackHelper());
}

private RollbackHelper rollbackHelper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.paimon.schema.TableSchema;
import org.apache.paimon.table.FileStoreTable;
import org.apache.paimon.table.FileStoreTableFactory;
import org.apache.paimon.table.RollbackHelper;
import org.apache.paimon.tag.TableTag;

import org.slf4j.Logger;
Expand Down Expand Up @@ -57,18 +58,21 @@ public class BranchManager {
private final SnapshotManager snapshotManager;
private final TagManager tagManager;
private final SchemaManager schemaManager;
private final RollbackHelper rollbackHelper;

public BranchManager(
FileIO fileIO,
Path path,
SnapshotManager snapshotManager,
TagManager tagManager,
SchemaManager schemaManager) {
SchemaManager schemaManager,
RollbackHelper rollbackHelper) {
this.fileIO = fileIO;
this.tablePath = path;
this.snapshotManager = snapshotManager;
this.tagManager = tagManager;
this.schemaManager = schemaManager;
this.rollbackHelper = rollbackHelper;
}

/** Commit specify branch to main. */
Expand Down Expand Up @@ -214,6 +218,9 @@ private void calculateCopyMainBranchToTargetBranch(String branchName) throws IOE
fileIO.copyFileUtf8(
snapshotManager.snapshotPath(snapshot.id()),
snapshotManager.snapshotPath(branchName, snapshot.id()));
} else {
// clear useless files
rollbackHelper.cleanLargerThan(snapshot);
}
}

Expand Down

0 comments on commit fd9027e

Please sign in to comment.