From 59acf837ad44c1322c8c85942415de3f86caeb65 Mon Sep 17 00:00:00 2001 From: v-zhangjc9 Date: Tue, 19 Mar 2024 16:33:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(command):=20=E4=BF=AE=E5=A4=8D=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=BD=BF=E7=94=A8=E6=8E=A8=E9=80=81=E9=98=9F=E5=88=97?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E5=BC=8F=E5=90=AF=E5=8A=A8=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/command/commands/CompactionCommand.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/service-command/src/main/java/com/lanyuanxiaoyao/service/command/commands/CompactionCommand.java b/service-command/src/main/java/com/lanyuanxiaoyao/service/command/commands/CompactionCommand.java index 7ec4c78..2c7c252 100644 --- a/service-command/src/main/java/com/lanyuanxiaoyao/service/command/commands/CompactionCommand.java +++ b/service-command/src/main/java/com/lanyuanxiaoyao/service/command/commands/CompactionCommand.java @@ -5,10 +5,8 @@ import com.lanyuanxiaoyao.service.command.utils.CommandLineUtils; import com.lanyuanxiaoyao.service.command.utils.TableUtils; import com.lanyuanxiaoyao.service.common.Constants; import com.lanyuanxiaoyao.service.common.entity.TableMeta; -import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnClusters; import com.lanyuanxiaoyao.service.forest.service.InfoService; -import com.lanyuanxiaoyao.service.forest.service.launcher.LauncherService; -import com.lanyuanxiaoyao.service.forest.service.launcher.LaunchersService; +import com.lanyuanxiaoyao.service.forest.service.ScheduleService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.shell.standard.ShellComponent; @@ -28,12 +26,11 @@ public class CompactionCommand extends AbstractUtilShellComponent { private final static String RUN_CONFIRMATION_MESSAGE = "操作将会提交压缩任务, 请再次确认操作"; private final InfoService infoService; - private final LauncherService launcherService; + private final ScheduleService scheduleService; - public CompactionCommand(InfoService infoService, YarnClusters yarnClusters, LaunchersService launchersService) { + public CompactionCommand(InfoService infoService, ScheduleService scheduleService) { this.infoService = infoService; - logger.info("Default sync cluster: {}", yarnClusters.getDefaultSyncCluster()); - this.launcherService = launchersService.getService(yarnClusters.getDefaultSyncCluster()); + this.scheduleService = scheduleService; } @ShellMethod("启动表压缩任务") @@ -53,7 +50,7 @@ public class CompactionCommand extends AbstractUtilShellComponent { } else { System.out.println(TableUtils.makeTableMeta(meta)); if (doubleCheck(RUN_CONFIRMATION_MESSAGE, ignoreCheck)) { - launcherService.compactionStop(meta.getJob().getId(), meta.getAlias()); + scheduleService.scheduleTable(meta.getJob().getId(), meta.getAlias()); return Constants.OPERATION_DONE; } else { return Constants.OPERATION_CANCEL;