diff --git a/dinky-admin/src/main/java/org/dinky/controller/FlinkController.java b/dinky-admin/src/main/java/org/dinky/controller/FlinkController.java index f50e2178f2..1273366e43 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/FlinkController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/FlinkController.java @@ -19,6 +19,7 @@ package org.dinky.controller; +import cn.hutool.core.lang.Singleton; import org.dinky.data.model.CheckPointReadTable; import org.dinky.data.result.Result; import org.dinky.data.vo.CascaderVO; @@ -45,14 +46,13 @@ @SaCheckLogin @RequiredArgsConstructor public class FlinkController { - - protected static final CheckpointRead INSTANCE = new CheckpointRead(); private final FlinkService flinkService; @GetMapping("/readCheckPoint") @ApiOperation("Read Checkpoint") public Result>> readCheckPoint(String path, String operatorId) { - return Result.data(INSTANCE.readCheckpoint(path, operatorId)); + CheckpointRead checkpointRead = Singleton.get(CheckpointRead.class); + return Result.data(checkpointRead.readCheckpoint(path, operatorId)); } @GetMapping("/configOptions") diff --git a/dinky-admin/src/main/java/org/dinky/controller/TaskController.java b/dinky-admin/src/main/java/org/dinky/controller/TaskController.java index bed837eca8..3f728781eb 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/TaskController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/TaskController.java @@ -313,7 +313,7 @@ public Result flinkJarSqlConvertForm(@RequestBody TaskDTO } Integer lastExecuteJarSqlStatementIndex = null; for (int i = 0; i < statements.length; i++) { - if (ExecuteJarParseStrategyUtil.match(statements[i])) { + if (ExecuteJarParseStrategyUtil.match(statements[i])) { lastExecuteJarSqlStatementIndex = i; } } diff --git a/dinky-admin/src/main/java/org/dinky/init/FlinkHistoryServer.java b/dinky-admin/src/main/java/org/dinky/init/FlinkHistoryServer.java index 6aaf689bb4..c7a6169a73 100644 --- a/dinky-admin/src/main/java/org/dinky/init/FlinkHistoryServer.java +++ b/dinky-admin/src/main/java/org/dinky/init/FlinkHistoryServer.java @@ -58,6 +58,8 @@ public class FlinkHistoryServer implements ApplicationRunner { private final SystemConfiguration systemConfiguration = SystemConfiguration.getInstances(); private final SysConfigService sysConfigService; + + public FlinkHistoryServer(JobInstanceService jobInstanceService, SysConfigService sysConfigService) { this.sysConfigService = sysConfigService; this.historyRunnable = () -> { diff --git a/dinky-admin/src/main/java/org/dinky/init/SystemInit.java b/dinky-admin/src/main/java/org/dinky/init/SystemInit.java index 2ac2720263..ebc1d433bc 100644 --- a/dinky-admin/src/main/java/org/dinky/init/SystemInit.java +++ b/dinky-admin/src/main/java/org/dinky/init/SystemInit.java @@ -93,20 +93,28 @@ public class SystemInit implements ApplicationRunner { @Override public void run(ApplicationArguments args) { - TenantContextHolder.ignoreTenant(); - initResources(); - List tenants = tenantService.list(); - sysConfigService.initSysConfig(); - sysConfigService.initExpressionVariables(); - - for (Tenant tenant : tenants) { - taskService.initDefaultFlinkSQLEnv(tenant.getId()); + try { + TenantContextHolder.ignoreTenant(); + initResources(); + List tenants = tenantService.list(); + sysConfigService.initSysConfig(); + sysConfigService.initExpressionVariables(); + + for (Tenant tenant : tenants) { + taskService.initDefaultFlinkSQLEnv(tenant.getId()); + } + initDaemon(); + initDolphinScheduler(); + registerUDF(); + updateGitBuildState(); + registerURL(); + } catch (NoClassDefFoundError e) { + if (e.getMessage().contains("org/apache/flink")){ + log.error("No Flink Jar dependency detected, please put the Flink Jar dependency into the DInky program first. (未检测到有 Flink Jar依赖,请先放入 Flink Jar 依赖到 DInky程序里)",e); + }else { + log.error("",e); + } } - initDaemon(); - initDolphinScheduler(); - registerUDF(); - updateGitBuildState(); - registerURL(); } private void registerURL() {