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



##########
File path: core/src/main/java/org/apache/iceberg/SnapshotManager.java
##########
@@ -54,6 +55,57 @@ public ManageSnapshots rollbackTo(long snapshotId) {
     return this;
   }
 
+  @Override
+  public ManageSnapshots createBranch(String name, long snapshotId) {
+    updateSnapshotReferencesOperation()
+        .createBranch(name, snapshotId)
+        .commit();
+    return this;
+  }
+
+  @Override
+  public ManageSnapshots createTag(String name, long snapshotId) {
+    updateSnapshotReferencesOperation().createTag(name, snapshotId).commit();
+    return this;
+  }
+
+  @Override
+  public ManageSnapshots removeBranch(String name) {
+    updateSnapshotReferencesOperation().removeBranch(name).commit();
+    return this;
+  }
+
+  @Override
+  public ManageSnapshots removeTag(String name) {
+    updateSnapshotReferencesOperation().removeTag(name).commit();
+    return this;
+  }
+
+  @Override
+  public ManageSnapshots setMinSnapshotsToKeep(String name, int 
minSnapshotsToKeep) {
+    updateSnapshotReferencesOperation().setMinSnapshotsToKeep(name, 
minSnapshotsToKeep);
+    return this;
+  }
+
+  @Override
+  public ManageSnapshots setTagRetention(String name, Long maxRefAgeMs) {
+    updateSnapshotReferencesOperation().setTagRetention(name, maxRefAgeMs);
+    return this;
+  }
+
+  @Override
+  public ManageSnapshots renameBranch(String name, String newName) {
+    updateSnapshotReferencesOperation().renameBranch(name, newName);
+    return this;
+  }
+
+  private UpdateSnapshotReferencesOperation 
updateSnapshotReferencesOperation() {

Review comment:
       This is good, but it also needs to commit this if there are `cherrypick` 
or `rollback` calls. Table modifications need to be kept in order, but we want 
to make as many ref changes as we can simultaneously.




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