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;