Skip to content

Commit

Permalink
[Optimize][Flink]Optimize DInky without Flink dependency, unable to s…
Browse files Browse the repository at this point in the history
…tart, etc (#3955)
  • Loading branch information
zackyoungh authored Nov 26, 2024
1 parent c667c5f commit 117e1a6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.springframework.web.bind.annotation.RestController;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.hutool.core.lang.Singleton;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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
36 changes: 23 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,30 @@ 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 117e1a6

Please sign in to comment.