nastra commented on code in PR #6074:
URL: https://github.com/apache/iceberg/pull/6074#discussion_r1073585094


##########
core/src/main/java/org/apache/iceberg/SnapshotManager.java:
##########
@@ -30,6 +31,13 @@ public class SnapshotManager implements ManageSnapshots {
         ops.current() != null, "Cannot manage snapshots: table %s does not 
exist", tableName);
     this.transaction =
         new BaseTransaction(tableName, ops, 
BaseTransaction.TransactionType.SIMPLE, ops.refresh());
+    this.isExternalTransaction = false;
+  }
+
+  SnapshotManager(BaseTransaction transaction) {
+    Preconditions.checkNotNull(transaction, "Input transaction cannot be 
null");

Review Comment:
   ```suggestion
       Preconditions.checkArgument(transaction != null, "Invalid input 
transaction: null");
   ```



##########
core/src/main/java/org/apache/iceberg/CommitCallbackTransaction.java:
##########
@@ -111,6 +111,12 @@ public ExpireSnapshots expireSnapshots() {
     return wrapped.expireSnapshots();
   }
 
+  @Override
+  public ManageSnapshots manageSnapshots() {
+    throw new UnsupportedOperationException(

Review Comment:
   alternatively to throwing, does anything speak against just returning 
`wrapped.manageSnapshots()` here?



##########
api/src/main/java/org/apache/iceberg/Transaction.java:
##########
@@ -155,6 +155,13 @@ default UpdateStatistics updateStatistics() {
    */
   ExpireSnapshots expireSnapshots();
 
+  /**
+   * Create a new {@link ManageSnapshots manage snapshot API} to manage 
snapshots in this table.
+   *
+   * @return a new {@link ManageSnapshots}
+   */
+  ManageSnapshots manageSnapshots();

Review Comment:
   rather than introducing an API-breaking change, we should probably make this 
a `default` method that throws an UOE (similar to `updateStatistics()`). Then 
we wouldn't need the revapi changes



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to