hudi-agent commented on code in PR #18988:
URL: https://github.com/apache/hudi/pull/18988#discussion_r3684559971


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/callback/common/HoodieWriteCommitCallbackMessage.java:
##########
@@ -69,10 +73,91 @@ public class HoodieWriteCommitCallbackMessage implements 
Serializable {
    */
   private final Option<Map<String, String>> extraMetadata;
 
+  /**
+   * Previous base file paths keyed by fileId, derived lazily from {@link 
#hoodieWriteStat} and
+   * the {@link BaseFileOnlyView} handed over by the write client, so that 
callback
+   * implementations don't have to rebuild a view themselves. Empty for 
inserts and for
+   * callers that don't supply a view.
+   *
+   * <p>Resolution is deferred until the first {@link #getPrevFilePaths()} 
call: a callback
+   * that never reads the previous paths pays nothing (no FileSystemView 
access). Transient
+   * because it captures a FileSystemView supplier, which is not serializable 
- these paths
+   * are JVM-local derived state, so a message restored from Java 
serialization reports none.
+   * Excluded from the generated getters so the {@link Lazy} wrapper never 
leaks into JSON.
+   */
+  @Getter(AccessLevel.NONE)
+  private final transient Lazy<Map<String, PrevFilePaths>> prevFilePaths;
+
+  /**
+   * Free-form context that producers can attach for downstream callback 
consumers.
+   * The OSS write client populates this as empty; specialized callsites or 
wrappers
+   * may populate it with whatever context their callbacks need.
+   */
+  private final Map<String, String> extraContext;
+
+  public HoodieWriteCommitCallbackMessage(String commitTime,

Review Comment:
   🤖 nit: `extraContext` and `extraMetadata` are two same-typed maps whose 
distinction isn't obvious at a callsite — could you make the name more specific 
(e.g. `callbackContext`) so the two aren't easily confused?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/callback/common/HoodieWriteCommitCallbackMessage.java:
##########
@@ -69,10 +73,91 @@ public class HoodieWriteCommitCallbackMessage implements 
Serializable {
    */
   private final Option<Map<String, String>> extraMetadata;
 
+  /**
+   * Previous base file paths keyed by fileId, derived lazily from {@link 
#hoodieWriteStat} and
+   * the {@link BaseFileOnlyView} handed over by the write client, so that 
callback
+   * implementations don't have to rebuild a view themselves. Empty for 
inserts and for
+   * callers that don't supply a view.
+   *
+   * <p>Resolution is deferred until the first {@link #getPrevFilePaths()} 
call: a callback
+   * that never reads the previous paths pays nothing (no FileSystemView 
access). Transient
+   * because it captures a FileSystemView supplier, which is not serializable 
- these paths
+   * are JVM-local derived state, so a message restored from Java 
serialization reports none.
+   * Excluded from the generated getters so the {@link Lazy} wrapper never 
leaks into JSON.
+   */
+  @Getter(AccessLevel.NONE)
+  private final transient Lazy<Map<String, PrevFilePaths>> prevFilePaths;
+
+  /**
+   * Free-form context that producers can attach for downstream callback 
consumers.
+   * The OSS write client populates this as empty; specialized callsites or 
wrappers
+   * may populate it with whatever context their callbacks need.
+   */
+  private final Map<String, String> extraContext;
+
+  public HoodieWriteCommitCallbackMessage(String commitTime,
+                                          String tableName,

Review Comment:
   🤖 nit: this public-API constructor now takes 8 positional args including two 
`Option`s, a nullable `Supplier`, and two `Map`s that are easy to transpose — 
have you considered adding a builder to make callsites self-documenting and 
harder to get wrong?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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

Reply via email to