PeterZh6 commented on code in PR #10916:
URL: https://github.com/apache/inlong/pull/10916#discussion_r1737802253


##########
inlong-manager/manager-plugins/base/src/main/java/org/apache/inlong/manager/plugin/flink/FlinkService.java:
##########
@@ -213,6 +218,22 @@ private String submitJobBySavepoint(FlinkInfo flinkInfo, 
SavepointRestoreSetting
         }).filter(Objects::nonNull).collect(Collectors.toList());
 
         Configuration configuration = 
getFlinkConfiguration(flinkInfo.getEndpoint());
+        log.debug("flink info: {}", flinkInfo);
+        if (flinkConfig.getDynamicParallelismEnable()) {
+            
flinkParallelismOptimizer.setMaximumMessagePerSecondPerCore(flinkConfig.getMaxMsgRatePerCore());
+            // get stream info list for auditing
+            int recommendedParallelism =
+                    
flinkParallelismOptimizer.calculateRecommendedParallelism(flinkInfo.getInlongStreamInfoList());
+            // Ensure parallelism is at least the default value
+            if (recommendedParallelism < parallelism) {
+                recommendedParallelism = parallelism;
+            }
+            if (recommendedParallelism != parallelism) {
+                log.info("switched to recommended parallelism: {}", 
recommendedParallelism);
+                parallelism = recommendedParallelism;
+            }
+        }
+        log.info("current parallelism: {}", parallelism);

Review Comment:
   Thanks a lot for your extremely rigorous review. However, I believe with the 
comparison in the red rectangle, the minimum parallelism is ensured, unless the 
parallelsim itself in `flink-sort-plugin.properties` is illegal.
   
   
![image](https://github.com/user-attachments/assets/ad39ce48-3d53-4767-98e5-4ecd4a911c48)
    



-- 
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: commits-unsubscr...@inlong.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to