Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Optimize][Flink]Optimize DInky without Flink dependency, unable to start, etc #3955

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading