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


##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/sink/TestStreamWriteOperatorCoordinator.java:
##########
@@ -776,6 +789,16 @@ private void assertError(Runnable runnable, String 
message) {
     assertTrue(context.isJobFailed(), message);
   }
 
+  private static boolean 
getRecordLevelIndexFlag(StreamWriteOperatorCoordinator coordinator) throws 
Exception {
+    Field tableStateField = 
StreamWriteOperatorCoordinator.class.getDeclaredField("tableState");

Review Comment:
   πŸ€– nit: this helper reaches into private fields via reflection, which means a 
rename of `tableState` or `isRecordLevelIndex` would silently break the test at 
runtime rather than compile time. Could you expose a package-private getter on 
`TableState` (or a method on the coordinator) instead? The coding guide calls 
this out explicitly: "Don't use reflection in tests β€” construct objects 
properly."
   
   <sub><i>- AI-generated; verify before applying. React πŸ‘/πŸ‘Ž to flag 
quality.</i></sub>



##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/sink/utils/InsertFunctionWrapper.java:
##########
@@ -70,6 +72,7 @@ public class InsertFunctionWrapper<I> implements 
TestFunctionWrapper<I> {
 
   private final boolean asyncClustering;
   private ClusteringFunctionWrapper clusteringFunctionWrapper;
+  private final TreeMap<Long, byte[]> coordinatorStateStore;

Review Comment:
   πŸ€– nit: could you type this as `NavigableMap<Long, byte[]>` instead of 
`TreeMap`? The only capability needed beyond `Map` is `lastEntry()`, which 
`NavigableMap` captures precisely β€” and it leaves the implementation free to 
change.
   
   <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