amogh-jahagirdar commented on a change in pull request #4071:
URL: https://github.com/apache/iceberg/pull/4071#discussion_r816139142



##########
File path: api/src/main/java/org/apache/iceberg/ManageSnapshots.java
##########
@@ -80,4 +80,72 @@
    * wapId
    */
   ManageSnapshots cherrypick(long snapshotId);
+
+  /**
+   * Create a new branch where the snapshot with the given id will be the head 
of the branch.
+   *
+   * @param name branch name
+   * @param snapshotId id of the snapshot which will be the head of the branch
+   * @return this for method chaining
+   * @throws IllegalArgumentException if a branch with the given name already 
exists
+   */
+  ManageSnapshots createBranch(String name, long snapshotId);
+
+  /**
+   * Remove the branch with the given name.
+   *
+   * @param name branch name
+   * @return this for method chaining
+   * @throws IllegalArgumentException if the branch does not exist
+   */
+  ManageSnapshots removeBranch(String name);
+
+  /**
+   * Replace the current head snapshot of the given branch with the snapshot 
with the given id.
+   * If the branch with the given name does not exist, a new branch will be 
created.

Review comment:
       Yeah (so sorry for the late reply on this), I  also missed out on 
defining APIs for updating reference retention properties. I definitely agree 
with creating/updating the branch after writing. If someone wants to do an 
operation to reset an existing branch to a new snapshot they would have to do a 
drop + create. which is slightly more cumbersome. Perhaps this is not really a 
meaningful metadata operation and also the explicit drop + create is better for 
safety (a user who wants to do this know explicitly that they are removing a 
reference and then creating a new one) to avoid unintentionally clobbering.
   
   @jackye1995 @rdblue let me know what your thoughts are here.




-- 
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]

Reply via email to