rdblue commented on code in PR #16408:
URL: https://github.com/apache/iceberg/pull/16408#discussion_r3307321978


##########
core/src/main/java/org/apache/iceberg/TrackingStruct.java:
##########
@@ -249,8 +254,27 @@ protected <T> void internalSet(int pos, T value) {
     }
   }
 
-  static Builder builder() {
-    return new Builder();
+  /** Creates a builder for a newly added file in the given snapshot. */
+  static Builder added(long snapshotId) {
+    return new Builder(snapshotId);
+  }
+
+  /** Creates a builder for an existing file based on tracking read from a 
manifest. */
+  static Builder existing(Tracking source) {
+    Preconditions.checkArgument(source != null, "Invalid source tracking: 
null");

Review Comment:
   Some source validation is done here and some is done in the constructors. 
I'd prefer to co-locate it in the constructors.



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