diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/APIExplainSqlDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/APIExplainSqlDTO.java index df361e6383..6f3013ba21 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/APIExplainSqlDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/APIExplainSqlDTO.java @@ -19,7 +19,7 @@ package org.dinky.data.dto; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import org.dinky.job.JobConfig; import java.util.Map; diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/StudioMetaStoreDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/StudioMetaStoreDTO.java index ee934e0cb0..d238764fe1 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/StudioMetaStoreDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/StudioMetaStoreDTO.java @@ -19,7 +19,7 @@ package org.dinky.data.dto; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import org.dinky.job.JobConfig; import io.swagger.annotations.ApiModel; diff --git a/dinky-admin/src/main/java/org/dinky/init/EnvInit.java b/dinky-admin/src/main/java/org/dinky/init/EnvInit.java index 4873761069..63bd5b1064 100644 --- a/dinky-admin/src/main/java/org/dinky/init/EnvInit.java +++ b/dinky-admin/src/main/java/org/dinky/init/EnvInit.java @@ -41,7 +41,7 @@ public void run(ApplicationArguments args) throws Exception { ApplicationContext application = SpringUtil.getApplicationContext(); Environment env = application.getEnvironment(); String port = env.getProperty("server.port"); - System.setProperty("dinkyAddr", ipAddress + ":" + port); + System.setProperty("dinkyAddr", "http://" + ipAddress + ":" + port); log.info( "\n----------------------------------------------------------\n\t" + "Application 'Dinky' is running! Access URLs:\n\t" diff --git a/dinky-admin/src/main/java/org/dinky/job/handler/Job2MysqlHandler.java b/dinky-admin/src/main/java/org/dinky/job/handler/Job2MysqlHandler.java index b30f667cf0..ea474b121d 100644 --- a/dinky-admin/src/main/java/org/dinky/job/handler/Job2MysqlHandler.java +++ b/dinky-admin/src/main/java/org/dinky/job/handler/Job2MysqlHandler.java @@ -25,6 +25,7 @@ import org.dinky.daemon.task.DaemonTask; import org.dinky.daemon.task.DaemonTaskConfig; import org.dinky.data.dto.ClusterInstanceDTO; +import org.dinky.data.enums.GatewayType; import org.dinky.data.enums.JobStatus; import org.dinky.data.model.ClusterInstance; import org.dinky.data.model.Task; @@ -33,7 +34,6 @@ import org.dinky.data.model.job.JobInstance; import org.dinky.data.model.mapping.ClusterConfigurationMapping; import org.dinky.data.model.mapping.ClusterInstanceMapping; -import org.dinky.gateway.enums.GatewayType; import org.dinky.job.FlinkJobTask; import org.dinky.job.Job; import org.dinky.service.ClusterConfigurationService; diff --git a/dinky-admin/src/main/java/org/dinky/job/handler/JobRefreshHandler.java b/dinky-admin/src/main/java/org/dinky/job/handler/JobRefreshHandler.java index 0f7026146b..9a1057dd12 100644 --- a/dinky-admin/src/main/java/org/dinky/job/handler/JobRefreshHandler.java +++ b/dinky-admin/src/main/java/org/dinky/job/handler/JobRefreshHandler.java @@ -25,6 +25,7 @@ import org.dinky.data.constant.FlinkRestResultConstant; import org.dinky.data.dto.ClusterConfigurationDTO; import org.dinky.data.dto.JobDataDto; +import org.dinky.data.enums.GatewayType; import org.dinky.data.enums.JobStatus; import org.dinky.data.flink.backpressure.FlinkJobNodeBackPressure; import org.dinky.data.flink.checkpoint.CheckPointOverView; @@ -37,7 +38,6 @@ import org.dinky.data.model.job.JobInstance; import org.dinky.gateway.Gateway; import org.dinky.gateway.config.GatewayConfig; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.exception.NotSupportGetStatusException; import org.dinky.gateway.model.FlinkClusterConfig; import org.dinky.job.JobConfig; diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/CatalogueServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/CatalogueServiceImpl.java index 5cab6f6538..02b545fd8f 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/CatalogueServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/CatalogueServiceImpl.java @@ -24,6 +24,7 @@ import org.dinky.assertion.Asserts; import org.dinky.config.Dialect; import org.dinky.data.dto.CatalogueTaskDTO; +import org.dinky.data.enums.GatewayType; import org.dinky.data.enums.JobLifeCycle; import org.dinky.data.enums.JobStatus; import org.dinky.data.enums.Status; @@ -36,7 +37,6 @@ import org.dinky.data.model.job.JobHistory; import org.dinky.data.model.job.JobInstance; import org.dinky.data.result.Result; -import org.dinky.gateway.enums.GatewayType; import org.dinky.mapper.CatalogueMapper; import org.dinky.mybatis.service.impl.SuperServiceImpl; import org.dinky.service.CatalogueService; diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/ClusterConfigurationServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/ClusterConfigurationServiceImpl.java index cf73eb1b07..c814bb44f7 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/ClusterConfigurationServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/ClusterConfigurationServiceImpl.java @@ -21,12 +21,12 @@ import org.dinky.assertion.DinkyAssert; import org.dinky.data.dto.ClusterConfigurationDTO; +import org.dinky.data.enums.GatewayType; import org.dinky.data.enums.Status; import org.dinky.data.exception.BusException; import org.dinky.data.model.ClusterConfiguration; import org.dinky.data.model.Task; import org.dinky.gateway.config.GatewayConfig; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.model.FlinkClusterConfig; import org.dinky.gateway.result.TestResult; import org.dinky.job.JobManager; diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/ClusterInstanceServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/ClusterInstanceServiceImpl.java index 71b89816f0..a23df8d312 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/ClusterInstanceServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/ClusterInstanceServiceImpl.java @@ -24,6 +24,7 @@ import org.dinky.cluster.FlinkCluster; import org.dinky.cluster.FlinkClusterInfo; import org.dinky.data.dto.ClusterInstanceDTO; +import org.dinky.data.enums.GatewayType; import org.dinky.data.enums.Status; import org.dinky.data.exception.BusException; import org.dinky.data.exception.DinkyException; @@ -31,7 +32,6 @@ import org.dinky.data.model.ClusterInstance; import org.dinky.data.model.Task; import org.dinky.gateway.config.GatewayConfig; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.exception.GatewayException; import org.dinky.gateway.model.FlinkClusterConfig; import org.dinky.gateway.result.GatewayResult; diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java index e693e2ac47..bd145e58b9 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java @@ -31,6 +31,7 @@ import org.dinky.data.dto.TaskDTO; import org.dinky.data.dto.TaskRollbackVersionDTO; import org.dinky.data.dto.TaskSubmitDto; +import org.dinky.data.enums.GatewayType; import org.dinky.data.enums.JobLifeCycle; import org.dinky.data.enums.JobStatus; import org.dinky.data.enums.ProcessStepType; @@ -61,7 +62,6 @@ import org.dinky.function.compiler.CustomStringJavaCompiler; import org.dinky.function.pool.UdfCodePool; import org.dinky.function.util.UDFUtil; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.enums.SavePointStrategy; import org.dinky.gateway.enums.SavePointType; import org.dinky.gateway.model.FlinkClusterConfig; diff --git a/dinky-admin/src/main/java/org/dinky/service/task/FlinkSqlEnvTask.java b/dinky-admin/src/main/java/org/dinky/service/task/FlinkSqlEnvTask.java index d0aa860d47..6b0af4eaac 100644 --- a/dinky-admin/src/main/java/org/dinky/service/task/FlinkSqlEnvTask.java +++ b/dinky-admin/src/main/java/org/dinky/service/task/FlinkSqlEnvTask.java @@ -23,10 +23,10 @@ import org.dinky.config.Dialect; import org.dinky.data.annotations.SupportDialect; import org.dinky.data.dto.TaskDTO; +import org.dinky.data.enums.GatewayType; import org.dinky.data.exception.NotSupportExecuteExcepition; import org.dinky.data.exception.NotSupportExplainExcepition; import org.dinky.data.result.SqlExplainResult; -import org.dinky.gateway.enums.GatewayType; import org.dinky.job.JobManager; import org.dinky.job.JobResult; import org.dinky.service.TaskService; diff --git a/dinky-admin/src/main/java/org/dinky/service/task/FlinkSqlTask.java b/dinky-admin/src/main/java/org/dinky/service/task/FlinkSqlTask.java index c4f4d1ee1d..481f25fe41 100644 --- a/dinky-admin/src/main/java/org/dinky/service/task/FlinkSqlTask.java +++ b/dinky-admin/src/main/java/org/dinky/service/task/FlinkSqlTask.java @@ -23,8 +23,8 @@ import org.dinky.config.Dialect; import org.dinky.data.annotations.SupportDialect; import org.dinky.data.dto.TaskDTO; +import org.dinky.data.enums.GatewayType; import org.dinky.data.result.SqlExplainResult; -import org.dinky.gateway.enums.GatewayType; import org.dinky.job.JobManager; import org.dinky.job.JobResult; import org.dinky.service.TaskService; diff --git a/dinky-admin/src/main/java/org/dinky/utils/FlinkConfigOptionsUtils.java b/dinky-admin/src/main/java/org/dinky/utils/FlinkConfigOptionsUtils.java index 6543917aa0..4810400271 100644 --- a/dinky-admin/src/main/java/org/dinky/utils/FlinkConfigOptionsUtils.java +++ b/dinky-admin/src/main/java/org/dinky/utils/FlinkConfigOptionsUtils.java @@ -78,7 +78,6 @@ public static List loadOptionsByClassName(String name) { configList.add(config); } } catch (ClassNotFoundException ignored) { - logger.warning("Could not get config option, class not found: " + name); } return configList; } diff --git a/dinky-admin/src/main/resources/dinky-loader/FlinkConfClass b/dinky-admin/src/main/resources/dinky-loader/FlinkConfClass index 97f5036566..ed0e9a9adc 100644 --- a/dinky-admin/src/main/resources/dinky-loader/FlinkConfClass +++ b/dinky-admin/src/main/resources/dinky-loader/FlinkConfClass @@ -27,6 +27,8 @@ org.apache.flink.configuration.NettyShuffleEnvironmentOptions org.apache.flink.configuration.RestartStrategyOptions org.apache.flink.streaming.api.environment.ExecutionCheckpointingOptions org.apache.flink.yarn.configuration.YarnConfigOptions +org.apache.flink.configuration.YarnConfigOptions org.apache.flink.kubernetes.configuration.KubernetesConfigOptions +org.apache.flink.configuration.KubernetesConfigOptions org.apache.flink.python.PythonOptions -org.dinky.constant.CustomerConfigureOptions +org.dinky.constant.CustomerConfigureOptions \ No newline at end of file diff --git a/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java b/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java index ddc0ebb93f..a4a979fc3a 100644 --- a/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java +++ b/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java @@ -29,6 +29,7 @@ import org.dinky.constant.FlinkSQLConstant; import org.dinky.data.app.AppParamConfig; import org.dinky.data.app.AppTask; +import org.dinky.data.enums.GatewayType; import org.dinky.data.model.SystemConfiguration; import org.dinky.executor.Executor; import org.dinky.executor.ExecutorConfig; @@ -172,9 +173,9 @@ private static void loadDep(String type, Integer taskId, ExecutorConfig executor return; } - if ("kubernetes-application".equals(type)) { + if (GatewayType.get(type).isKubernetesApplicationMode()) { try { - String httpJar = "http://" + dinkyAddr + "/download/downloadDepJar/" + taskId; + String httpJar = dinkyAddr + "/download/downloadDepJar/" + taskId; log.info("下载依赖 http-url为:{}", httpJar); String flinkHome = System.getenv("FLINK_HOME"); String usrlib = flinkHome + "/usrlib"; @@ -214,7 +215,6 @@ private static void loadDep(String type, Integer taskId, ExecutorConfig executor } } } catch (IOException e) { - log.error(""); throw new RuntimeException(e); } } diff --git a/dinky-app/dinky-app-base/src/main/java/org/dinky/app/util/FlinkAppUtil.java b/dinky-app/dinky-app-base/src/main/java/org/dinky/app/util/FlinkAppUtil.java index 9ac3c9ffe7..6fcbc883cb 100644 --- a/dinky-app/dinky-app-base/src/main/java/org/dinky/app/util/FlinkAppUtil.java +++ b/dinky-app/dinky-app-base/src/main/java/org/dinky/app/util/FlinkAppUtil.java @@ -107,8 +107,8 @@ public static void monitorFlinkTask(JobClient jobClient, int taskId) { private static void sendHook(int taskId, String jobId, int reTryCount) { String dinkyAddr = SystemConfiguration.getInstances().getDinkyAddr().getValue(); try { - String url = StrFormatter.format( - "http://{}/api/jobInstance/hookJobDone?taskId={}&jobId={}", dinkyAddr, taskId, jobId); + String url = + StrFormatter.format("{}/api/jobInstance/hookJobDone?taskId={}&jobId={}", dinkyAddr, taskId, jobId); String resultStr = HttpUtil.get(url); // TODO 这里应该使用Result实体类,但是Result.class不在comm里,迁移改动太大,暂时不搞 String code = JsonUtils.parseObject(resultStr).get("code").toString(); diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/enums/GatewayType.java b/dinky-common/src/main/java/org/dinky/data/enums/GatewayType.java similarity index 92% rename from dinky-gateway/src/main/java/org/dinky/gateway/enums/GatewayType.java rename to dinky-common/src/main/java/org/dinky/data/enums/GatewayType.java index e207d94af7..3b095c489f 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/enums/GatewayType.java +++ b/dinky-common/src/main/java/org/dinky/data/enums/GatewayType.java @@ -17,7 +17,7 @@ * */ -package org.dinky.gateway.enums; +package org.dinky.data.enums; import org.dinky.assertion.Asserts; @@ -122,4 +122,14 @@ public boolean isApplicationMode() { return false; } } + + public boolean isKubernetesApplicationMode() { + switch (this) { + case KUBERNETES_APPLICATION: + case KUBERNETES_APPLICATION_OPERATOR: + return true; + default: + return false; + } + } } diff --git a/dinky-common/src/main/resources/i18n/messages_en_US.properties b/dinky-common/src/main/resources/i18n/messages_en_US.properties index 7938bec400..3552212a24 100644 --- a/dinky-common/src/main/resources/i18n/messages_en_US.properties +++ b/dinky-common/src/main/resources/i18n/messages_en_US.properties @@ -191,7 +191,7 @@ sys.maven.settings.repositoryPassword.note=Maven private server authentication p sys.env.settings.pythonHome=Python Env variables sys.env.settings.pythonHome.note=Python environment variables, used to submit Python tasks and build Python Udf sys.env.settings.dinkyAddr=Dinky Address -sys.env.settings.dinkyAddr.note=The address must be the same as the address configured in the Dinky Application background url +sys.env.settings.dinkyAddr.note=This address is an accessible Dinky address, such as http://127.0.0.1:8888 sys.env.settings.jobResendDiffSecond=Alert anti-resend interval sys.env.settings.jobResendDiffSecond.note=During this interval, when the Alert information sent reaches the configured value of [Maximum number of alarm resend prevention], after reaching the threshold, the Alert information will no longer be sent; unit: seconds sys.env.settings.diffMinuteMaxSendCount=Maximum number of alarms to prevent resending diff --git a/dinky-common/src/main/resources/i18n/messages_zh_CN.properties b/dinky-common/src/main/resources/i18n/messages_zh_CN.properties index 421b7206d2..c6f8a7cb68 100644 --- a/dinky-common/src/main/resources/i18n/messages_zh_CN.properties +++ b/dinky-common/src/main/resources/i18n/messages_zh_CN.properties @@ -191,7 +191,7 @@ sys.maven.settings.repositoryPassword.note=Maven 私服认证密码,如果需要 sys.env.settings.pythonHome=Python 环境变量 sys.env.settings.pythonHome.note=Python 环境变量,用于提交 Python 任务以及构建 Python Udf sys.env.settings.dinkyAddr=Dinky 地址 -sys.env.settings.dinkyAddr.note=该地址必须与Dinky Application后台url中配置的地址相同 +sys.env.settings.dinkyAddr.note=该地址为可访问的 Dinky 地址,如 http://127.0.0.1:8888 sys.env.settings.jobResendDiffSecond=告警防重发间隔 sys.env.settings.jobResendDiffSecond.note=在此间隔内,发送告警信息达到 [告警防重发最大条数] 配置的值时,达到阈值后,不再发送告警信息; 单位:秒 sys.env.settings.diffMinuteMaxSendCount=告警防重发最大条数 @@ -281,7 +281,7 @@ process.submit.checkSql=检查作业 process.submit.execute=执行作业 process.submit.buildConfig=构建配置信息 process.submit.execute.commSql=执行普通sql -process.submit.execute.flinkSql=执行flinkSql +process.submit.execute.flinkSql=执行FlinkSql process.register.exits=当前任务正在执行,请勿重复提交,如有问题请前往配置中心查看 # resource diff --git a/dinky-core/src/main/java/org/dinky/api/FlinkAPI.java b/dinky-core/src/main/java/org/dinky/api/FlinkAPI.java index 14d4aaef97..7d2bfa6e26 100644 --- a/dinky-core/src/main/java/org/dinky/api/FlinkAPI.java +++ b/dinky-core/src/main/java/org/dinky/api/FlinkAPI.java @@ -22,8 +22,8 @@ import org.dinky.assertion.Asserts; import org.dinky.data.constant.FlinkRestAPIConstant; import org.dinky.data.constant.NetConstant; +import org.dinky.data.enums.GatewayType; import org.dinky.data.exception.BusException; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.enums.SavePointType; import org.dinky.gateway.model.JobInfo; import org.dinky.gateway.result.SavePointResult; diff --git a/dinky-core/src/main/java/org/dinky/executor/ExecutorConfig.java b/dinky-core/src/main/java/org/dinky/executor/ExecutorConfig.java index d55a9ee37c..64471d44e8 100644 --- a/dinky-core/src/main/java/org/dinky/executor/ExecutorConfig.java +++ b/dinky-core/src/main/java/org/dinky/executor/ExecutorConfig.java @@ -20,7 +20,7 @@ package org.dinky.executor; import org.dinky.assertion.Asserts; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import java.util.ArrayList; import java.util.HashMap; diff --git a/dinky-core/src/main/java/org/dinky/explainer/Explainer.java b/dinky-core/src/main/java/org/dinky/explainer/Explainer.java index f151b84701..e0edce8091 100644 --- a/dinky-core/src/main/java/org/dinky/explainer/Explainer.java +++ b/dinky-core/src/main/java/org/dinky/explainer/Explainer.java @@ -20,6 +20,7 @@ package org.dinky.explainer; import org.dinky.assertion.Asserts; +import org.dinky.data.enums.GatewayType; import org.dinky.data.model.LineageRel; import org.dinky.data.result.ExplainResult; import org.dinky.data.result.SqlExplainResult; @@ -28,7 +29,6 @@ import org.dinky.explainer.print_table.PrintStatementExplainer; import org.dinky.function.data.model.UDF; import org.dinky.function.util.UDFUtil; -import org.dinky.gateway.enums.GatewayType; import org.dinky.interceptor.FlinkInterceptor; import org.dinky.job.JobConfig; import org.dinky.job.JobManager; diff --git a/dinky-core/src/main/java/org/dinky/job/Job.java b/dinky-core/src/main/java/org/dinky/job/Job.java index 7fd3c4db51..e352e6d8cc 100644 --- a/dinky-core/src/main/java/org/dinky/job/Job.java +++ b/dinky-core/src/main/java/org/dinky/job/Job.java @@ -19,10 +19,10 @@ package org.dinky.job; +import org.dinky.data.enums.GatewayType; import org.dinky.data.result.IResult; import org.dinky.executor.Executor; import org.dinky.executor.ExecutorConfig; -import org.dinky.gateway.enums.GatewayType; import java.time.LocalDateTime; import java.util.List; diff --git a/dinky-core/src/main/java/org/dinky/job/JobBuilder.java b/dinky-core/src/main/java/org/dinky/job/JobBuilder.java index ce529a2606..c31f33bd55 100644 --- a/dinky-core/src/main/java/org/dinky/job/JobBuilder.java +++ b/dinky-core/src/main/java/org/dinky/job/JobBuilder.java @@ -19,8 +19,8 @@ package org.dinky.job; +import org.dinky.data.enums.GatewayType; import org.dinky.executor.Executor; -import org.dinky.gateway.enums.GatewayType; public abstract class JobBuilder { diff --git a/dinky-core/src/main/java/org/dinky/job/JobConfig.java b/dinky-core/src/main/java/org/dinky/job/JobConfig.java index 96a8452c32..f5fd35a499 100644 --- a/dinky-core/src/main/java/org/dinky/job/JobConfig.java +++ b/dinky-core/src/main/java/org/dinky/job/JobConfig.java @@ -21,10 +21,10 @@ import org.dinky.assertion.Asserts; import org.dinky.data.constant.NetConstant; +import org.dinky.data.enums.GatewayType; import org.dinky.executor.ExecutorConfig; import org.dinky.gateway.config.FlinkConfig; import org.dinky.gateway.config.GatewayConfig; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.enums.SavePointStrategy; import org.dinky.gateway.model.FlinkClusterConfig; diff --git a/dinky-core/src/main/java/org/dinky/job/JobManager.java b/dinky-core/src/main/java/org/dinky/job/JobManager.java index ec7d8a1421..83dba4a242 100644 --- a/dinky-core/src/main/java/org/dinky/job/JobManager.java +++ b/dinky-core/src/main/java/org/dinky/job/JobManager.java @@ -26,6 +26,7 @@ import org.dinky.context.FlinkUdfPathContextHolder; import org.dinky.context.RowLevelPermissionsContext; import org.dinky.data.annotations.ProcessStep; +import org.dinky.data.enums.GatewayType; import org.dinky.data.enums.ProcessStepType; import org.dinky.data.exception.BusException; import org.dinky.data.model.SystemConfiguration; @@ -45,7 +46,6 @@ import org.dinky.gateway.config.FlinkConfig; import org.dinky.gateway.config.GatewayConfig; import org.dinky.gateway.enums.ActionType; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.enums.SavePointType; import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.SavePointResult; diff --git a/dinky-core/src/main/java/org/dinky/job/builder/JobTransBuilder.java b/dinky-core/src/main/java/org/dinky/job/builder/JobTransBuilder.java index dc729735e6..e983e85719 100644 --- a/dinky-core/src/main/java/org/dinky/job/builder/JobTransBuilder.java +++ b/dinky-core/src/main/java/org/dinky/job/builder/JobTransBuilder.java @@ -21,12 +21,12 @@ import org.dinky.assertion.Asserts; import org.dinky.constant.FlinkSQLConstant; +import org.dinky.data.enums.GatewayType; import org.dinky.data.result.IResult; import org.dinky.data.result.InsertResult; import org.dinky.data.result.ResultBuilder; import org.dinky.executor.Executor; import org.dinky.gateway.Gateway; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.result.GatewayResult; import org.dinky.interceptor.FlinkInterceptor; import org.dinky.interceptor.FlinkInterceptorResult; diff --git a/dinky-core/src/test/java/org/dinky/core/JobManagerTest.java b/dinky-core/src/test/java/org/dinky/core/JobManagerTest.java index 484756b00a..978a92024b 100644 --- a/dinky-core/src/test/java/org/dinky/core/JobManagerTest.java +++ b/dinky-core/src/test/java/org/dinky/core/JobManagerTest.java @@ -19,9 +19,9 @@ package org.dinky.core; +import org.dinky.data.enums.GatewayType; import org.dinky.data.result.ResultPool; import org.dinky.data.result.SelectResult; -import org.dinky.gateway.enums.GatewayType; import org.dinky.job.JobConfig; import org.dinky.job.JobManager; import org.dinky.job.JobResult; diff --git a/dinky-core/src/test/java/org/dinky/job/JobConfigTest.java b/dinky-core/src/test/java/org/dinky/job/JobConfigTest.java index e84507fd1b..7db2ea3caf 100644 --- a/dinky-core/src/test/java/org/dinky/job/JobConfigTest.java +++ b/dinky-core/src/test/java/org/dinky/job/JobConfigTest.java @@ -21,7 +21,7 @@ import static org.junit.jupiter.api.Assertions.*; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import org.apache.flink.configuration.RestOptions; diff --git a/dinky-function/src/main/java/org/dinky/function/util/UDFUtil.java b/dinky-function/src/main/java/org/dinky/function/util/UDFUtil.java index b4bc0c9712..3e54a9b75a 100644 --- a/dinky-function/src/main/java/org/dinky/function/util/UDFUtil.java +++ b/dinky-function/src/main/java/org/dinky/function/util/UDFUtil.java @@ -23,6 +23,7 @@ import org.dinky.classloader.DinkyClassLoader; import org.dinky.config.Dialect; import org.dinky.context.FlinkUdfPathContextHolder; +import org.dinky.data.enums.GatewayType; import org.dinky.data.exception.DinkyException; import org.dinky.data.model.FlinkUdfManifest; import org.dinky.data.model.SystemConfiguration; @@ -33,7 +34,6 @@ import org.dinky.function.constant.PathConstant; import org.dinky.function.data.model.UDF; import org.dinky.function.pool.UdfCodePool; -import org.dinky.gateway.enums.GatewayType; import org.dinky.pool.ClassEntity; import org.dinky.pool.ClassPool; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/AbstractGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/AbstractGateway.java index 33ca009512..9b74d7f257 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/AbstractGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/AbstractGateway.java @@ -21,10 +21,10 @@ import org.dinky.assertion.Asserts; import org.dinky.context.FlinkUdfPathContextHolder; +import org.dinky.data.enums.GatewayType; import org.dinky.data.enums.JobStatus; import org.dinky.gateway.config.GatewayConfig; import org.dinky.gateway.enums.ActionType; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.exception.GatewayException; import org.dinky.gateway.exception.NotSupportGetStatusException; import org.dinky.gateway.model.JobInfo; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/Gateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/Gateway.java index c99b99a361..3f7261f4d6 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/Gateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/Gateway.java @@ -21,9 +21,9 @@ import org.dinky.assertion.Asserts; import org.dinky.context.FlinkUdfPathContextHolder; +import org.dinky.data.enums.GatewayType; import org.dinky.data.enums.JobStatus; import org.dinky.gateway.config.GatewayConfig; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.exception.GatewayException; import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.SavePointResult; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/config/GatewayConfig.java b/dinky-gateway/src/main/java/org/dinky/gateway/config/GatewayConfig.java index 0258871774..27e33bb9f1 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/config/GatewayConfig.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/config/GatewayConfig.java @@ -19,7 +19,7 @@ package org.dinky.gateway.config; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import org.dinky.gateway.model.CustomConfig; import org.dinky.gateway.model.FlinkClusterConfig; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java index 92d4a31b7d..0c7faaa8fc 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java @@ -21,9 +21,9 @@ import org.dinky.assertion.Asserts; import org.dinky.context.FlinkUdfPathContextHolder; +import org.dinky.data.enums.GatewayType; import org.dinky.data.model.SystemConfiguration; import org.dinky.gateway.config.AppConfig; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.exception.GatewayException; import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.KubernetesResult; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesSessionGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesSessionGateway.java index 1f4b4c96b6..8bbea1d8c2 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesSessionGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesSessionGateway.java @@ -21,7 +21,7 @@ import org.dinky.assertion.Asserts; import org.dinky.context.FlinkUdfPathContextHolder; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.KubernetesResult; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/operator/KubetnetsApplicationOperatorGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/operator/KubetnetsApplicationOperatorGateway.java index c504bda204..e6137a643b 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/operator/KubetnetsApplicationOperatorGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/operator/KubetnetsApplicationOperatorGateway.java @@ -21,7 +21,7 @@ import org.dinky.assertion.Asserts; import org.dinky.context.FlinkUdfPathContextHolder; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import org.dinky.gateway.kubernetes.operator.api.FlinkDeployment; import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.KubernetesResult; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/model/FlinkClusterConfig.java b/dinky-gateway/src/main/java/org/dinky/gateway/model/FlinkClusterConfig.java index 8f5721250a..d7f55233a7 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/model/FlinkClusterConfig.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/model/FlinkClusterConfig.java @@ -19,11 +19,11 @@ package org.dinky.gateway.model; +import org.dinky.data.enums.GatewayType; import org.dinky.gateway.config.AppConfig; import org.dinky.gateway.config.ClusterConfig; import org.dinky.gateway.config.FlinkConfig; import org.dinky.gateway.config.K8sConfig; -import org.dinky.gateway.enums.GatewayType; import java.util.Optional; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/result/AbstractGatewayResult.java b/dinky-gateway/src/main/java/org/dinky/gateway/result/AbstractGatewayResult.java index 0c2151a1e1..be61ec2e5b 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/result/AbstractGatewayResult.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/result/AbstractGatewayResult.java @@ -19,7 +19,7 @@ package org.dinky.gateway.result; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import java.time.LocalDateTime; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/result/KubernetesResult.java b/dinky-gateway/src/main/java/org/dinky/gateway/result/KubernetesResult.java index 8a79bdc04a..502acddb4c 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/result/KubernetesResult.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/result/KubernetesResult.java @@ -19,7 +19,7 @@ package org.dinky.gateway.result; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import java.time.LocalDateTime; import java.util.List; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/result/SavePointResult.java b/dinky-gateway/src/main/java/org/dinky/gateway/result/SavePointResult.java index fb30e9aed6..7e30cc8e00 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/result/SavePointResult.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/result/SavePointResult.java @@ -19,7 +19,7 @@ package org.dinky.gateway.result; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import org.dinky.gateway.model.JobInfo; import java.time.LocalDateTime; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/result/YarnResult.java b/dinky-gateway/src/main/java/org/dinky/gateway/result/YarnResult.java index 0e89fa6df0..eebdbf9cd8 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/result/YarnResult.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/result/YarnResult.java @@ -19,7 +19,7 @@ package org.dinky.gateway.result; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import java.time.LocalDateTime; import java.util.List; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnApplicationGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnApplicationGateway.java index 5d7d12d72e..7c094a03d4 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnApplicationGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnApplicationGateway.java @@ -21,8 +21,8 @@ import org.dinky.assertion.Asserts; import org.dinky.context.FlinkUdfPathContextHolder; +import org.dinky.data.enums.GatewayType; import org.dinky.gateway.config.AppConfig; -import org.dinky.gateway.enums.GatewayType; import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.YarnResult; import org.dinky.utils.LogUtil; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnPerJobGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnPerJobGateway.java index 12840cdddc..aa25ff0af7 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnPerJobGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnPerJobGateway.java @@ -20,7 +20,7 @@ package org.dinky.gateway.yarn; import org.dinky.assertion.Asserts; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.YarnResult; diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnSessionGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnSessionGateway.java index 248749fd5f..0bea0652c2 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnSessionGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnSessionGateway.java @@ -21,7 +21,7 @@ import org.dinky.assertion.Asserts; import org.dinky.context.FlinkUdfPathContextHolder; -import org.dinky.gateway.enums.GatewayType; +import org.dinky.data.enums.GatewayType; import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.YarnResult; diff --git a/dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx b/dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx index 720d89e77c..a140a8bd25 100644 --- a/dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx +++ b/dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx @@ -46,7 +46,7 @@ import { TaskDataType, VIEW } from '@/pages/DataStudio/model'; -import { JOB_LIFE_CYCLE, JOB_STATUS } from '@/pages/DevOps/constants'; +import {JOB_LIFE_CYCLE, JOB_STATUS, JOB_SUBMIT_STATUS} from '@/pages/DevOps/constants'; import { isStatusDone } from '@/pages/DevOps/function'; import { SysConfigStateType } from '@/pages/SettingCenter/GlobalSetting/model'; import { SettingConfigKeyEnum } from '@/pages/SettingCenter/GlobalSetting/SettingOverView/constants'; @@ -231,13 +231,9 @@ const HeaderContainer = (props: connect) => { currentData.status = JOB_STATUS.FINISHED; if (currentTab) currentTab.console.results = res.data.results; } else { + currentData.status = res.data.status; if (currentTab) currentTab.console.result = res.data.result; } - // Common sql task is synchronized, so it needs to automatically update the status to finished. - if (isSql(currentData.dialect)) { - currentData.status = JOB_STATUS.FINISHED; - } - if (currentTab) currentTab.console.result = res.data.result; saveTabs({ ...props.tabs }); }; diff --git a/dinky-web/src/pages/DevOps/constants.tsx b/dinky-web/src/pages/DevOps/constants.tsx index 589c12c431..ac2352eb80 100644 --- a/dinky-web/src/pages/DevOps/constants.tsx +++ b/dinky-web/src/pages/DevOps/constants.tsx @@ -38,6 +38,14 @@ export enum JOB_STATUS { UNKNOWN = 'UNKNOWN' } +export enum JOB_SUBMIT_STATUS { + INITIALIZE = 'INITIALIZE', + RUNNING = 'RUNNING', + SUCCESS = 'SUCCESS', + FAILED = 'FAILED', + CANCEL = 'CANCEL' +} + export enum BackPressureStatus { OK = 'ok', HIGH = 'high' diff --git a/dinky-web/src/pages/DevOps/function.tsx b/dinky-web/src/pages/DevOps/function.tsx index 873a1207eb..a02d38902d 100644 --- a/dinky-web/src/pages/DevOps/function.tsx +++ b/dinky-web/src/pages/DevOps/function.tsx @@ -17,7 +17,7 @@ * */ -import { JOB_STATUS } from '@/pages/DevOps/constants'; +import {JOB_STATUS, JOB_SUBMIT_STATUS} from '@/pages/DevOps/constants'; import { Jobs } from '@/types/DevOps/data'; import { parseMilliSecondStr } from '@/utils/function'; @@ -36,11 +36,15 @@ export function isStatusDone(type: string) { case JOB_STATUS.CANCELED: case JOB_STATUS.FINISHED: case JOB_STATUS.UNKNOWN: + case JOB_SUBMIT_STATUS.SUCCESS: + case JOB_SUBMIT_STATUS.FAILED: + case JOB_SUBMIT_STATUS.CANCEL: return true; default: return false; } } + export function isNotFinallyStatus(type: string) { if (!type) { return false;