twalthr commented on code in PR #29353:
URL: https://github.com/apache/flink/pull/29353#discussion_r4163742511


##########
flink-table/flink-table-code-splitter/src/main/java/org/apache/flink/table/codesplit/CodeSplitUtil.java:
##########
@@ -29,14 +29,20 @@
 @Internal
 public class CodeSplitUtil {
 
-    private static final AtomicLong COUNTER = new AtomicLong(0L);
+    // Per-thread, reset per split() run, so identical input yields identical 
names.
+    private static final ThreadLocal<AtomicLong> COUNTER =
+            ThreadLocal.withInitial(() -> new AtomicLong(0L));

Review Comment:
   Another question: Why does CodeSplitter needs to be static at all. Could be 
a regular object instance with context.



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