hstdream commented on code in PR #10376:
URL: https://github.com/apache/dolphinscheduler/pull/10376#discussion_r893694879
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java:
##########
@@ -740,45 +729,24 @@ protected int createComplementCommandList(Date start,
Date end, RunMode runMode,
}
}
logger.info("In parallel mode, current
expectedParallelismNumber:{}", createCount);
-
// Distribute the number of tasks equally to each command.
// The last command with insufficient quantity will be
assigned to the remaining tasks.
- int itemsPerCommand = (listDateSize / createCount);
- int remainingItems = (listDateSize % createCount);
- int startDateIndex = 0;
- int endDateIndex = 0;
-
- for (int i = 1; i <= createCount; i++) {
- int extra = (i <= remainingItems) ? 1 : 0;
- int singleCommandItems = (itemsPerCommand + extra);
-
- if (i == 1) {
- endDateIndex += singleCommandItems - 1;
- } else {
- startDateIndex = endDateIndex + 1;
- endDateIndex += singleCommandItems;
+ for(List<String> stringDate :
Lists.partition(listDate,createCount)){
+ String tempDate = "";
+ for(String date : stringDate){
+ tempDate += date +",";
Review Comment:
1
--
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]