rdblue commented on a change in pull request #4071:
URL: https://github.com/apache/iceberg/pull/4071#discussion_r825200270



##########
File path: api/src/main/java/org/apache/iceberg/ManageSnapshots.java
##########
@@ -80,4 +80,107 @@
    * wapId
    */
   ManageSnapshots cherrypick(long snapshotId);
+
+  /**
+   * Create a new branch pointing to the given snapshot id.
+   *
+   * @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);
+
+  /**
+   * Create a new branch pointing to the given snapshot id with the given 
retention properties.
+   *
+   * @param name branch name
+   * @param snapshotId id of the snapshot which will be the head of the branch
+   * @param maxRefAgeMs retention age in milliseconds of the branch reference 
itself
+   * @param minSnapshotsToKeep minimum number of snapshots to retain on the 
branch
+   * @param maxSnapshotAgeMs max age in milliseconds of a snapshot that should 
be retained on the branch
+   * @return this for method chaining
+   * @throws IllegalArgumentException if a branch with the given name already 
exists
+   */
+  ManageSnapshots createBranch(
+      String name,
+      long snapshotId,
+      Long maxRefAgeMs,
+      Integer minSnapshotsToKeep,
+      Long maxSnapshotAgeMs);
+
+  /**
+   * Create a new tag pointing to the given snapshot id
+   *
+   * @param name tag name
+   * @param snapshotId snapshotId for the head of the new branch.
+   * @return this for method chaining
+   * @throws ValidationException if a tag with the given name already exists
+   */
+  ManageSnapshots createTag(String name, long snapshotId);
+
+  /**
+   * Create a new tag pointing to the given snapshot id with the given 
retention properties.
+   *
+   * @param name tag name
+   * @param snapshotId snapshotId for the head of the new branch.
+   * @param maxRefAgeMs retention age in milliseconds of the tag reference 
itself
+   * @return this for method chaining
+   * @throws ValidationException if a tag with the given name already exists
+   */
+  ManageSnapshots createTag(String name, long snapshotId, Long maxRefAgeMs);
+
+  /**
+   * Remove a branch by name
+   *
+   * @param name branch name
+   * @return this for method chaining
+   * @throws ValidationException if the branch does not exist
+   */
+  ManageSnapshots removeBranch(String name);
+
+  /**
+   * Updates the retention policy for a branch.
+   *
+   * @param name branch name
+   * @param maxRefAgeMs retention age in milliseconds of the branch reference 
itself
+   * @param minSnapshotsToKeep minimum number of snapshots to retain on the 
branch
+   * @param maxSnapshotAgeMs max age in milliseconds of a snapshot that should 
be retained on the branch
+   * @return this for method chaining
+   * @throws ValidationException if the branch does not exist
+   */
+  ManageSnapshots setBranchRetention(
+      String name,
+      int minSnapshotsToKeep,
+      Long maxRefAgeMs,
+      Long maxSnapshotAgeMs);
+
+  /**
+   * Updates the retention policy for a tag.
+   *
+   * @param name branch name
+   * @param maxRefAgeMs retention age in milliseconds of the tag reference 
itself
+   * @return this for method chaining
+   * @throws ValidationException if the tag does not exist
+   */
+  ManageSnapshots setTagRetention(String name, Long maxRefAgeMs);
+
+  /**
+   * Rename a branch
+   *
+   * @param name name of branch to rename
+   * @param newName the desired new name of the branch
+   * @throws ValidationException if the branch to rename does not exist or if 
there is already a branch
+   * with the same name as the desired new name.
+   */
+  ManageSnapshots renameBranch(String name, String newName);
+
+  /**
+   * Remove the tag with the given name.
+   *
+   * @param name tag name
+   * @return this for method chaining
+   * @throws IllegalArgumentException if the branch does not exist
+   */
+  ManageSnapshots removeTag(String name);

Review comment:
       What about `replaceTag(name, snapshotId)` to update a tag to a new 
snapshot? We should probably also have replace for branches.
   
   Should we also have methods that reference other branches or tags? For 
example, `createTag("test-2022-03-11", "test")` where "test" is a branch name?




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