gaborkaszab commented on code in PR #16936:
URL: https://github.com/apache/iceberg/pull/16936#discussion_r3465585496


##########
core/src/main/java/org/apache/iceberg/TrackedFileBuilder.java:
##########
@@ -179,6 +183,46 @@ TrackedFileBuilder writerFormatVersion(int 
newWriterFormatVersion) {
     return this;
   }
 
+  TrackedFileBuilder firstRowId(Long newFirstRowId) {
+    this.firstRowId = newFirstRowId;
+    return this;
+  }
+
+  /**
+   * Sets an explicit {@link EntryStatus} for the tracking row, bypassing the 
{@link
+   * TrackingBuilder#added(long)} / {@link TrackingBuilder#from(Tracking, 
long)} status-derivation
+   * path. Required when paired with {@link #dataSequenceNumber(Long)} / {@link
+   * #fileSequenceNumber(Long)} for manifest references and non-ADDED 
transitions whose tracking
+   * values can't be derived from a source.
+   *
+   * <p>When this setter is used, {@link #build()} constructs the {@link 
Tracking} directly from the
+   * accumulated field values and bypasses {@link TrackingBuilder}. Cannot be 
combined with the
+   * source-tracking path ({@link #from(TrackedFile, long)}).
+   */
+  TrackedFileBuilder status(EntryStatus newStatus) {

Review Comment:
   I wouldn't allow the user explicitly setting these fields in any form. They 
could easily break internal invariants of TrackedFile if we do so. We currently 
have mechanism in the builder to prevent breaking invariants like replaced 
state for manifest entries and many others. This won't guard against these, or 
we have to duplicate all these checks here.
   I'd look for existing methods on the builder/TrackedFile API to achieve what 
we need 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