zhuanshenbsj1 commented on code in PR #9680:
URL: https://github.com/apache/hudi/pull/9680#discussion_r1325254285


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/utils/Pipelines.java:
##########
@@ -81,8 +81,8 @@
  */
 public class Pipelines {
 
-  // The map of operator uids, avoiding duplicate caused by the same operator
-  private static ConcurrentHashMap<String,ArrayList<String>> operatorUidMap = 
new ConcurrentHashMap<>();
+  // The counter of operators, avoiding duplicate uids caused by the same 
operator
+  private static ConcurrentHashMap<String,Integer> operatorCounter  = new 
ConcurrentHashMap<>();

Review Comment:
   done.



##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/utils/Pipelines.java:
##########
@@ -486,19 +486,8 @@ public static String opName(String operatorN, 
Configuration conf) {
   }
 
   public static String opUID(String operatorN, Configuration conf) {
-    String uid = "uid_" + operatorN + "_" + getTablePath(conf);
-    String finalUid = uid;
-    synchronized (Pipelines.class) {
-      ArrayList<String> operators = operatorUidMap.get(uid);
-      if (operators != null) {
-        finalUid = uid + "_" + operators.size();
-        operators.add(finalUid);
-        operatorUidMap.put(uid, operators);
-      } else {
-        operatorUidMap.put(uid, new ArrayList<>(Arrays.asList(uid)));
-      }
-    }
-    return finalUid;
+    Integer operatorCount = operatorCounter.merge(operatorN,1, (oldValue, 
value) -> oldValue + value);

Review Comment:
   done.



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