schnappi17 commented on code in PR #2911:
URL: https://github.com/apache/incubator-paimon/pull/2911#discussion_r1515646563
##########
paimon-core/src/main/java/org/apache/paimon/utils/BranchManager.java:
##########
@@ -65,19 +71,33 @@ public BranchManager(
this.schemaManager = schemaManager;
}
+ /** Commit specify branch to main. */
+ public void commitMainBranch(String branchName) throws IOException {
+ Path mainBranchFile = new Path(tablePath, MAIN_BRANCH_FILE);
+ fileIO.delete(mainBranchFile, false);
+ fileIO.overwriteFileUtf8(mainBranchFile, branchName);
+ }
+
/** Return the root Directory of branch. */
public Path branchDirectory() {
return new Path(tablePath + "/branch");
}
/** Return the path string of a branch. */
- public static String getBranchPath(Path tablePath, String branchName) {
+ public static String getBranchPath(FileIO fileIO, Path tablePath, String
branchName) {
+ if (branchName.equals(DEFAULT_MAIN_BRANCH)) {
Review Comment:
Why this condition should be verified twice?
--
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]