feat(command): 增加启动同步任务的并发数
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.lanyuanxiaoyao.service.command.commands;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.lanyuanxiaoyao.service.command.entity.TableMetaJob;
|
||||
@@ -235,11 +234,13 @@ public class YarnCommand extends AbstractUtilShellComponent {
|
||||
.collect(TableMetaJob::getFlinkJobId)
|
||||
.distinct();
|
||||
try (ProgressBar pb = CommandLineUtils.progressbarBuilder("Run jobs", ids.size()).build()) {
|
||||
ids.forEach(id -> {
|
||||
launcherService.syncStart(id);
|
||||
pb.setExtraMessage(id.toString());
|
||||
pb.step();
|
||||
});
|
||||
ids
|
||||
.asParallel(ExecutorProvider.EXECUTORS_2, 1)
|
||||
.forEach(id -> {
|
||||
launcherService.syncStart(id);
|
||||
pb.setExtraMessage(id.toString());
|
||||
pb.step();
|
||||
});
|
||||
}
|
||||
return Constants.OPERATION_DONE;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user