Skip to content

Commit

Permalink
optimize_no_flink_deps_no_start_dinky
Browse files Browse the repository at this point in the history
  • Loading branch information
zackyoungh committed Nov 26, 2024
1 parent bb55f4a commit 6995769
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Map<String, Map<String, CheckPointReadTable>>> 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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public Result<FlinkJarSqlConvertVO> 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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () -> {
Expand Down
34 changes: 21 additions & 13 deletions dinky-admin/src/main/java/org/dinky/init/SystemInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,28 @@ public class SystemInit implements ApplicationRunner {

@Override
public void run(ApplicationArguments args) {
TenantContextHolder.ignoreTenant();
initResources();
List<Tenant> tenants = tenantService.list();
sysConfigService.initSysConfig();
sysConfigService.initExpressionVariables();

for (Tenant tenant : tenants) {
taskService.initDefaultFlinkSQLEnv(tenant.getId());
try {
TenantContextHolder.ignoreTenant();
initResources();
List<Tenant> 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() {
Expand Down

0 comments on commit 6995769

Please sign in to comment.