You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2024/09/27 10:52:23 UTC
(incubator-streampark) branch dev updated: [Improve] Improvements related to Spark & Flink class-names (#4097)
This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new 92bf923df [Improve] Improvements related to Spark & Flink class-names (#4097)
92bf923df is described below
commit 92bf923df6730bff7b5298ad2312827fafbbab32
Author: benjobs <be...@apache.org>
AuthorDate: Fri Sep 27 18:52:18 2024 +0800
[Improve] Improvements related to Spark & Flink class-names (#4097)
* [Improve] spark app submit bug fixed.
* [Improve] ExecutionMode rename to DeployMode improvements
* [Improve] table column execution_mode rename to deploy_mode
* [Improve] known-dependencies.txt update
---
...linkExecutionMode.java => FlinkDeployMode.java} | 32 +-
...FlinkDevelopmentMode.java => FlinkJobType.java} | 14 +-
...parkExecutionMode.java => SparkDeployMode.java} | 24 +-
...SparkDevelopmentMode.java => SparkJobType.java} | 14 +-
.../streampark-console-service/pom.xml | 12 -
.../src/main/assembly/script/data/mysql-data.sql | 4 +-
.../src/main/assembly/script/data/pgsql-data.sql | 4 +-
.../main/assembly/script/schema/mysql-schema.sql | 14 +-
.../main/assembly/script/schema/pgsql-schema.sql | 22 +-
.../main/assembly/script/upgrade/mysql/2.2.0.sql | 80 +--
.../main/assembly/script/upgrade/mysql/2.2.2.sql | 250 ---------
.../main/assembly/script/upgrade/pgsql/2.2.0.sql | 25 -
.../console/core/aspect/PermissionAspect.java | 8 +-
.../console/core/bean/AlertTemplate.java | 12 +-
.../core/component/FlinkCheckpointProcessor.java | 22 +-
.../core/controller/ApplicationController.java | 64 +--
.../controller/ApplicationHistoryController.java | 12 +-
.../console/core/controller/ConfigController.java | 18 +-
.../core/controller/FlinkGateWayController.java | 90 ----
.../core/controller/FlinkSqlController.java | 4 +-
.../console/core/controller/OpenAPIController.java | 10 +-
.../console/core/controller/ProxyController.java | 12 +-
.../core/controller/SavepointController.java | 18 +-
.../controller/SparkApplicationController.java | 12 +-
.../core/controller/SparkSqlController.java | 4 +-
.../core/controller/SqlWorkBenchController.java | 160 ------
.../core/controller/VariableController.java | 4 +-
.../{Application.java => FlinkApplication.java} | 97 ++--
...tionBackUp.java => FlinkApplicationBackUp.java} | 14 +-
...tionConfig.java => FlinkApplicationConfig.java} | 7 +-
.../console/core/entity/FlinkCluster.java | 10 +-
.../console/core/entity/FlinkGateWay.java | 49 --
.../entity/{Savepoint.java => FlinkSavepoint.java} | 2 +-
.../streampark/console/core/entity/FlinkSql.java | 4 +-
.../console/core/entity/SparkApplication.java | 48 +-
.../core/entity/SparkApplicationBackUp.java | 4 +-
.../core/entity/SparkApplicationConfig.java | 3 +-
...pper.java => FlinkApplicationBackUpMapper.java} | 4 +-
...pper.java => FlinkApplicationConfigMapper.java} | 12 +-
...tionMapper.java => FlinkApplicationMapper.java} | 18 +-
...{CatalogMapper.java => FlinkCatalogMapper.java} | 2 +-
.../console/core/mapper/FlinkGateWayMapper.java | 25 -
...epointMapper.java => FlinkSavepointMapper.java} | 4 +-
.../core/mapper/SparkApplicationMapper.java | 2 +-
.../console/core/runner/QuickStartRunner.java | 16 +-
.../core/service/DistributedTaskService.java | 6 +-
...ice.java => FlinkApplicationBackUpService.java} | 24 +-
...ice.java => FlinkApplicationConfigService.java} | 20 +-
.../console/core/service/FlinkClusterService.java | 8 +-
.../console/core/service/FlinkGateWayService.java | 59 ---
.../console/core/service/FlinkSqlService.java | 4 +-
.../console/core/service/ProjectService.java | 4 +-
.../console/core/service/ProxyService.java | 4 +-
.../console/core/service/SavepointService.java | 16 +-
.../console/core/service/SqlWorkBenchService.java | 137 -----
.../console/core/service/VariableService.java | 4 +-
.../console/core/service/YarnQueueService.java | 10 +-
.../service/alert/impl/AlertConfigServiceImpl.java | 8 +-
...ice.java => FlinkApplicationActionService.java} | 10 +-
...rvice.java => FlinkApplicationInfoService.java} | 18 +-
...ice.java => FlinkApplicationManageService.java} | 39 +-
.../application/SparkApplicationManageService.java | 10 +-
...java => FlinkApplicationActionServiceImpl.java} | 134 ++---
...l.java => FlinkApplicationInfoServiceImpl.java} | 60 +--
...java => FlinkApplicationManageServiceImpl.java} | 168 +++---
.../impl/SparkApplicationActionServiceImpl.java | 24 +-
.../impl/SparkApplicationInfoServiceImpl.java | 8 +-
.../impl/SparkApplicationManageServiceImpl.java | 38 +-
.../core/service/impl/AppBuildPipeServiceImpl.java | 72 +--
.../service/impl/DistributedTaskServiceImpl.java | 18 +-
.../core/service/impl/ExternalLinkServiceImpl.java | 10 +-
...java => FlinkApplicationBackUpServiceImpl.java} | 82 +--
...java => FlinkApplicationConfigServiceImpl.java} | 73 +--
...rviceImpl.java => FlinkCatalogServiceImpl.java} | 4 +-
.../core/service/impl/FlinkClusterServiceImpl.java | 54 +-
.../core/service/impl/FlinkEnvServiceImpl.java | 4 +-
.../core/service/impl/FlinkGateWayServiceImpl.java | 90 ----
...iceImpl.java => FlinkSavepointServiceImpl.java} | 125 ++---
.../core/service/impl/FlinkSqlServiceImpl.java | 8 +-
.../core/service/impl/ProjectServiceImpl.java | 16 +-
.../core/service/impl/ProxyServiceImpl.java | 12 +-
.../core/service/impl/ResourceServiceImpl.java | 18 +-
.../service/impl/SparkAppBuildPipeServiceImpl.java | 10 +-
.../core/service/impl/SparkEnvServiceImpl.java | 8 -
.../core/service/impl/SqlWorkBenchServiceImpl.java | 225 --------
.../core/service/impl/VariableServiceImpl.java | 36 +-
.../core/service/impl/YarnQueueServiceImpl.java | 30 +-
.../core/task/ApplicationBackUpCleanTask.java | 14 +-
.../console/core/utils/AlertTemplateUtils.java | 14 +-
.../console/core/watcher/FlinkAppHttpWatcher.java | 104 ++--
.../console/core/watcher/FlinkClusterWatcher.java | 12 +-
.../core/watcher/FlinkK8sChangeEventListener.java | 20 +-
.../core/watcher/FlinkK8sWatcherWrapper.java | 24 +-
.../system/service/impl/TeamServiceImpl.java | 4 +-
.../system/service/impl/UserServiceImpl.java | 8 +-
.../src/main/resources/db/data-h2.sql | 4 +-
.../src/main/resources/db/schema-h2.sql | 12 +-
.../resources/mapper/core/AlertConfigMapper.xml | 13 -
.../mapper/core/ApplicationBackUpMapper.xml | 31 --
.../resources/mapper/core/ApplicationLogMapper.xml | 10 -
.../main/resources/mapper/core/EffectiveMapper.xml | 8 +-
.../resources/mapper/core/ExternalLinkMapper.xml | 10 +-
...Mapper.xml => FlinkApplicationConfigMapper.xml} | 17 +-
...cationMapper.xml => FlinkApplicationMapper.xml} | 87 +---
.../{CatalogMapper.xml => FlinkCatalogMapper.xml} | 13 +-
.../resources/mapper/core/FlinkClusterMapper.xml | 28 -
.../main/resources/mapper/core/FlinkEnvMapper.xml | 12 -
...kGateWayMapper.xml => FlinkSavepointMapper.xml} | 12 +-
.../main/resources/mapper/core/FlinkSqlMapper.xml | 10 -
.../main/resources/mapper/core/MessageMapper.xml | 11 +-
.../main/resources/mapper/core/ResourceMapper.xml | 16 -
.../main/resources/mapper/core/SavepointMapper.xml | 29 --
.../main/resources/mapper/core/SettingMapper.xml | 9 -
.../mapper/core/SparkApplicationConfigMapper.xml | 10 -
.../mapper/core/SparkApplicationMapper.xml | 60 +--
.../resources/mapper/core/SparkEffectiveMapper.xml | 7 -
.../main/resources/mapper/core/SparkEnvMapper.xml | 12 -
.../main/resources/mapper/core/SparkSqlMapper.xml | 10 -
.../main/resources/mapper/core/VariableMapper.xml | 12 -
.../main/resources/mapper/core/YarnQueueMapper.xml | 9 -
.../main/resources/mapper/system/MemberMapper.xml | 9 -
.../main/resources/mapper/system/RoleMapper.xml | 8 -
.../main/resources/mapper/system/TeamMapper.xml | 8 -
.../main/resources/mapper/system/UserMapper.xml | 16 -
.../streampark/console/SpringUnitTestBase.java | 16 +-
.../core/service/ApplicationManageServiceTest.java | 33 +-
.../core/service/DistributedTaskServiceTest.java | 6 +-
.../core/service/FlinkClusterServiceTest.java | 4 +-
.../console/core/service/SavepointServiceTest.java | 38 +-
.../console/core/service/UserServiceTest.java | 12 +-
.../console/core/service/YarnQueueServiceTest.java | 16 +-
.../core/service/alert/AlertServiceTest.java | 6 +-
.../src/api/flink/app.type.ts | 4 +-
.../src/api/flink/flinkCluster.type.ts | 2 +-
.../src/api/spark/app.type.ts | 4 +-
.../src/design/swal2.less | 9 +-
.../src/enums/flinkEnum.ts | 4 +-
.../src/enums/sparkEnum.ts | 4 +-
.../src/locales/lang/en/flink/app.ts | 6 +-
.../src/locales/lang/en/setting/flinkCluster.ts | 6 +-
.../src/locales/lang/en/spark/app.ts | 6 +-
.../src/locales/lang/zh-CN/flink/app.ts | 6 +-
.../src/locales/lang/zh-CN/setting/flinkCluster.ts | 6 +-
.../src/locales/lang/zh-CN/spark/app.ts | 6 +-
.../src/views/flink/app/Add.vue | 6 +-
.../src/views/flink/app/Detail.vue | 10 +-
.../src/views/flink/app/EditFlink.vue | 18 +-
.../src/views/flink/app/EditStreamPark.vue | 18 +-
.../src/views/flink/app/data/index.ts | 16 +-
.../src/views/flink/app/hooks/useApp.tsx | 12 +-
.../src/views/flink/app/hooks/useAppTableAction.ts | 6 +-
.../flink/app/hooks/useCreateAndEditSchema.ts | 67 ++-
.../src/views/flink/app/hooks/useCreateSchema.ts | 8 +-
.../src/views/flink/app/hooks/useEdit.ts | 2 +-
.../views/flink/app/hooks/useEditFlinkSchema.ts | 4 +-
.../src/views/flink/app/hooks/useEditStreamPark.ts | 8 +-
.../src/views/flink/app/hooks/useFlinkRender.tsx | 6 +-
.../src/views/flink/app/utils/index.ts | 20 +-
.../src/views/flink/cluster/Edit.vue | 2 +-
.../src/views/flink/cluster/View.vue | 28 +-
.../src/views/flink/cluster/useClusterSetting.ts | 60 +--
.../src/views/spark/app/create.vue | 4 +-
.../src/views/spark/app/data/index.ts | 10 +-
.../src/views/spark/app/detail.vue | 6 +-
.../src/views/spark/app/edit.vue | 4 +-
.../src/views/spark/app/hooks/useAppFormSchema.tsx | 22 +-
.../src/views/spark/app/hooks/useSparkAction.tsx | 9 +-
.../cases/Flink116OnRemoteClusterDeployTest.java | 4 +-
.../e2e/cases/Flink116OnYarnClusterDeployTest.java | 6 +-
.../cases/Flink117OnRemoteClusterDeployTest.java | 4 +-
.../e2e/cases/Flink117OnYarnClusterDeployTest.java | 6 +-
.../cases/Flink118OnRemoteClusterDeployTest.java | 4 +-
.../e2e/cases/Flink118OnYarnClusterDeployTest.java | 6 +-
.../e2e/cases/FlinkSQL116OnYarnTest.java | 8 +-
.../e2e/cases/FlinkSQL117OnYarnTest.java | 8 +-
.../e2e/cases/FlinkSQL118OnYarnTest.java | 8 +-
.../pages/flink/applications/ApplicationForm.java | 56 +-
.../pages/flink/clusters/ClusterDetailForm.java | 32 +-
streampark-flink/pom.xml | 1 -
.../flink/client/bean/CancelRequest.scala | 4 +-
.../flink/client/bean/DeployRequest.scala | 4 +-
.../flink/client/bean/DeployRequestTrait.scala | 4 +-
.../flink/client/bean/SavepointRequestTrait.scala | 4 +-
.../flink/client/bean/ShutDownRequest.scala | 4 +-
.../flink/client/bean/SubmitRequest.scala | 16 +-
.../client/bean/TriggerSavepointRequest.scala | 4 +-
.../flink/client/FlinkClientEntrypoint.scala | 27 +-
.../impl/KubernetesNativeApplicationClient.scala | 6 +-
.../impl/KubernetesNativeSessionClient.scala | 14 +-
.../flink/client/impl/RemoteClient.scala | 6 +-
.../flink/client/impl/YarnApplicationClient.scala | 6 +-
.../flink/client/impl/YarnSessionClient.scala | 6 +-
.../flink/client/trait/FlinkClientTrait.scala | 26 +-
.../client/trait/KubernetesNativeClientTrait.scala | 8 +-
.../flink/kubernetes/DefaultFlinkK8sWatcher.scala | 2 +-
.../flink/kubernetes/KubernetesRetriever.scala | 4 +-
...sExecuteMode.scala => FlinkK8sDeployMode.scala} | 20 +-
.../flink/kubernetes/model/ClusterKey.scala | 4 +-
.../flink/kubernetes/model/TrackId.scala | 12 +-
.../kubernetes/watcher/FlinkJobStatusWatcher.scala | 8 +-
.../flink/packer/pipeline/BuildRequest.scala | 24 +-
.../pipeline/impl/FlinkRemoteBuildPipeline.scala | 8 +-
.../impl/FlinkYarnApplicationBuildPipeline.scala | 6 +-
.../impl/SparkYarnApplicationBuildPipeline.scala | 6 +-
.../flink/core/FlinkStreamTableTrait.scala | 4 +-
.../streampark-flink-sql-gateway/pom.xml | 37 --
.../streampark-flink-sql-gateway-base/pom.xml | 103 ----
.../apache/streampark/gateway/ConfigOption.java | 251 ---------
.../streampark/gateway/ExecutionConfiguration.java | 23 -
.../apache/streampark/gateway/OperationHandle.java | 57 --
.../streampark/gateway/OperationStatusEnum.java | 86 ----
.../gateway/exception/SqlGatewayException.java | 36 --
.../gateway/exception/ValidationException.java | 36 --
.../streampark/gateway/factories/Factory.java | 32 --
.../streampark/gateway/factories/FactoryUtil.java | 117 -----
.../gateway/factories/ServiceLoaderUtil.java | 83 ---
.../factories/SqlGatewayServiceFactory.java | 38 --
.../factories/SqlGatewayServiceFactoryUtils.java | 151 ------
.../apache/streampark/gateway/results/Column.java | 86 ----
.../gateway/results/FetchOrientationEnum.java | 28 -
.../streampark/gateway/results/FunctionInfo.java | 23 -
.../streampark/gateway/results/GatewayInfo.java | 75 ---
.../apache/streampark/gateway/results/JobID.java | 60 ---
.../gateway/results/ObjectIdentifier.java | 87 ----
.../streampark/gateway/results/OperationInfo.java | 69 ---
.../streampark/gateway/results/ResultKindEnum.java | 33 --
.../gateway/results/ResultQueryCondition.java | 92 ----
.../streampark/gateway/results/ResultSet.java | 174 -------
.../apache/streampark/gateway/results/RowData.java | 65 ---
.../streampark/gateway/results/TableInfo.java | 64 ---
.../streampark/gateway/results/TableKindEnum.java | 22 -
.../gateway/service/SqlGatewayService.java | 155 ------
.../gateway/session/SessionEnvironment.java | 88 ----
.../streampark/gateway/session/SessionHandle.java | 56 --
.../service/SqlGatewayServiceFactoryUtilsTest.java | 177 -------
.../gateway/utils/FakeSqlGatewayService.java | 107 ----
.../utils/FakeSqlGatewayServiceFactory.java | 68 ---
.../gateway/utils/MockedSqlGatewayService.java | 134 -----
.../utils/MockedSqlGatewayServiceFactory.java | 68 ---
...org.apache.streampark.gateway.factories.Factory | 20 -
.../streampark-flink-sql-gateway-flink-v1/pom.xml | 194 -------
.../gateway/flink/FlinkSqlGatewayImpl.java | 240 ---------
.../flink/FlinkSqlGatewayServiceFactory.java | 62 ---
...org.apache.streampark.gateway.factories.Factory | 19 -
.../main/resources/flink_sql_gateway_rest_v1.yml | 573 ---------------------
.../streampark/gateway/flink/FlinkSqlGateway.java | 46 --
.../gateway/flink/FlinkSqlGatewayExample.java | 227 --------
.../streampark-flink-sql-gateway-kyuubi/pom.xml | 39 --
.../streampark/gateway/kyuubi/package-info.java | 18 -
.../streampark/spark/client/bean/StopRequest.scala | 4 +-
.../spark/client/bean/SubmitRequest.scala | 14 +-
.../spark/client/SparkClientEndpoint.scala | 15 +-
.../streampark/spark/client/impl/YarnClient.scala | 10 +-
.../spark/client/trait/SparkClientTrait.scala | 4 +-
tools/dependencies/known-dependencies.txt | 16 +-
255 files changed, 1533 insertions(+), 7336 deletions(-)
diff --git a/streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkExecutionMode.java b/streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkDeployMode.java
similarity index 84%
rename from streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkExecutionMode.java
rename to streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkDeployMode.java
index 6cd467eb6..5d39408ef 100644
--- a/streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkExecutionMode.java
+++ b/streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkDeployMode.java
@@ -25,7 +25,7 @@ import javax.annotation.Nullable;
import java.util.List;
/** Flink execution mode enum. */
-public enum FlinkExecutionMode {
+public enum FlinkDeployMode {
/** Unknown Mode */
UNKNOWN(-1, "Unknown"),
@@ -54,41 +54,41 @@ public enum FlinkExecutionMode {
private final String name;
- FlinkExecutionMode(@Nonnull Integer mode, @Nonnull String name) {
+ FlinkDeployMode(@Nonnull Integer mode, @Nonnull String name) {
this.mode = mode;
this.name = name;
}
/**
- * Try to resolve the mode value into {@link FlinkExecutionMode}.
+ * Try to resolve the mode value into {@link FlinkDeployMode}.
*
* @param value The mode value of potential flink execution mode.
* @return The parsed flink execution mode enum.
*/
@Nonnull
- public static FlinkExecutionMode of(@Nullable Integer value) {
- for (FlinkExecutionMode mode : values()) {
+ public static FlinkDeployMode of(@Nullable Integer value) {
+ for (FlinkDeployMode mode : values()) {
if (mode.mode.equals(value)) {
return mode;
}
}
- return FlinkExecutionMode.UNKNOWN;
+ return FlinkDeployMode.UNKNOWN;
}
/**
- * Try to resolve the mode name into {@link FlinkExecutionMode}.
+ * Try to resolve the mode name into {@link FlinkDeployMode}.
*
* @param name The mode name of potential flink execution mode.
* @return The parsed flink execution mode enum.
*/
@Nonnull
- public static FlinkExecutionMode of(@Nullable String name) {
- for (FlinkExecutionMode mode : values()) {
+ public static FlinkDeployMode of(@Nullable String name) {
+ for (FlinkDeployMode mode : values()) {
if (mode.name.equals(name)) {
return mode;
}
}
- return FlinkExecutionMode.UNKNOWN;
+ return FlinkDeployMode.UNKNOWN;
}
public int getMode() {
@@ -106,7 +106,7 @@ public enum FlinkExecutionMode {
* @param mode The given mode.
* @return The judged result.
*/
- public static boolean isYarnMode(@Nullable FlinkExecutionMode mode) {
+ public static boolean isYarnMode(@Nullable FlinkDeployMode mode) {
return YARN_PER_JOB == mode || YARN_APPLICATION == mode || YARN_SESSION == mode;
}
@@ -117,7 +117,7 @@ public enum FlinkExecutionMode {
* @return The judged result. TODO: We'll inline this method back to the corresponding caller
* lines after dropping the yarn perjob mode.
*/
- public static boolean isYarnPerJobOrAppMode(@Nullable FlinkExecutionMode mode) {
+ public static boolean isYarnPerJobOrAppMode(@Nullable FlinkDeployMode mode) {
return YARN_PER_JOB == mode || YARN_APPLICATION == mode;
}
@@ -127,7 +127,7 @@ public enum FlinkExecutionMode {
* @param mode The given mode.
* @return The judged result.
*/
- public static boolean isYarnSessionMode(@Nullable FlinkExecutionMode mode) {
+ public static boolean isYarnSessionMode(@Nullable FlinkDeployMode mode) {
return YARN_SESSION == mode;
}
@@ -157,7 +157,7 @@ public enum FlinkExecutionMode {
* @param mode The given flink execution mode.
* @return The judged result.
*/
- public static boolean isKubernetesMode(@Nullable FlinkExecutionMode mode) {
+ public static boolean isKubernetesMode(@Nullable FlinkDeployMode mode) {
return KUBERNETES_NATIVE_SESSION == mode || KUBERNETES_NATIVE_APPLICATION == mode;
}
@@ -189,7 +189,7 @@ public enum FlinkExecutionMode {
}
/** Judge the given flink execution mode whether is session execution mode. */
- public static boolean isSessionMode(@Nullable FlinkExecutionMode mode) {
+ public static boolean isSessionMode(@Nullable FlinkDeployMode mode) {
return KUBERNETES_NATIVE_SESSION == mode || YARN_SESSION == mode;
}
@@ -199,7 +199,7 @@ public enum FlinkExecutionMode {
}
/** Judge the given flink execution mode whether is remote execution mode. */
- public static boolean isRemoteMode(@Nullable FlinkExecutionMode mode) {
+ public static boolean isRemoteMode(@Nullable FlinkDeployMode mode) {
return REMOTE == mode;
}
}
diff --git a/streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkDevelopmentMode.java b/streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkJobType.java
similarity index 79%
rename from streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkDevelopmentMode.java
rename to streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkJobType.java
index 107d000af..b30f498a6 100644
--- a/streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkDevelopmentMode.java
+++ b/streampark-common/src/main/java/org/apache/streampark/common/enums/FlinkJobType.java
@@ -21,7 +21,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/** The flink deployment mode enum. */
-public enum FlinkDevelopmentMode {
+public enum FlinkJobType {
/** Unknown type replace null */
UNKNOWN("Unknown", -1),
@@ -39,28 +39,28 @@ public enum FlinkDevelopmentMode {
private final Integer mode;
- FlinkDevelopmentMode(@Nonnull String name, @Nonnull Integer mode) {
+ FlinkJobType(@Nonnull String name, @Nonnull Integer mode) {
this.name = name;
this.mode = mode;
}
/**
- * Try to resolve the mode value into {@link FlinkDevelopmentMode}.
+ * Try to resolve the mode value into {@link FlinkJobType}.
*
* @param value The mode value of potential flink deployment mode.
* @return The parsed flink deployment mode.
*/
@Nonnull
- public static FlinkDevelopmentMode of(@Nullable Integer value) {
- for (FlinkDevelopmentMode flinkDevelopmentMode : values()) {
+ public static FlinkJobType of(@Nullable Integer value) {
+ for (FlinkJobType flinkDevelopmentMode : values()) {
if (flinkDevelopmentMode.mode.equals(value)) {
return flinkDevelopmentMode;
}
}
- return FlinkDevelopmentMode.UNKNOWN;
+ return FlinkJobType.UNKNOWN;
}
- /** Get the mode value of the current {@link FlinkDevelopmentMode} enum. */
+ /** Get the mode value of the current {@link FlinkJobType} enum. */
@Nonnull
public Integer getMode() {
return mode;
diff --git a/streampark-common/src/main/java/org/apache/streampark/common/enums/SparkExecutionMode.java b/streampark-common/src/main/java/org/apache/streampark/common/enums/SparkDeployMode.java
similarity index 79%
rename from streampark-common/src/main/java/org/apache/streampark/common/enums/SparkExecutionMode.java
rename to streampark-common/src/main/java/org/apache/streampark/common/enums/SparkDeployMode.java
index d82d96f5d..785d77693 100644
--- a/streampark-common/src/main/java/org/apache/streampark/common/enums/SparkExecutionMode.java
+++ b/streampark-common/src/main/java/org/apache/streampark/common/enums/SparkDeployMode.java
@@ -21,7 +21,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/** Spark execution mode enum. */
-public enum SparkExecutionMode {
+public enum SparkDeployMode {
/** Unknown Mode */
UNKNOWN(-1, "Unknown"),
@@ -42,41 +42,41 @@ public enum SparkExecutionMode {
private final String name;
- SparkExecutionMode(@Nonnull Integer mode, @Nonnull String name) {
+ SparkDeployMode(@Nonnull Integer mode, @Nonnull String name) {
this.mode = mode;
this.name = name;
}
/**
- * Try to resolve the mode value into {@link SparkExecutionMode}.
+ * Try to resolve the mode value into {@link SparkDeployMode}.
*
* @param value The mode value of potential spark execution mode.
* @return The parsed spark execution mode enum.
*/
@Nonnull
- public static SparkExecutionMode of(@Nullable Integer value) {
- for (SparkExecutionMode mode : values()) {
+ public static SparkDeployMode of(@Nullable Integer value) {
+ for (SparkDeployMode mode : values()) {
if (mode.mode.equals(value)) {
return mode;
}
}
- return SparkExecutionMode.UNKNOWN;
+ return SparkDeployMode.UNKNOWN;
}
/**
- * Try to resolve the mode name into {@link SparkExecutionMode}.
+ * Try to resolve the mode name into {@link SparkDeployMode}.
*
* @param name The mode name of potential spark execution mode.
* @return The parsed spark execution mode enum.
*/
@Nonnull
- public static SparkExecutionMode of(@Nullable String name) {
- for (SparkExecutionMode mode : values()) {
+ public static SparkDeployMode of(@Nullable String name) {
+ for (SparkDeployMode mode : values()) {
if (mode.name.equals(name)) {
return mode;
}
}
- return SparkExecutionMode.UNKNOWN;
+ return SparkDeployMode.UNKNOWN;
}
public int getMode() {
@@ -94,7 +94,7 @@ public enum SparkExecutionMode {
* @param mode The given mode.
* @return The judged result.
*/
- public static boolean isYarnMode(@Nullable SparkExecutionMode mode) {
+ public static boolean isYarnMode(@Nullable SparkDeployMode mode) {
return YARN_CLUSTER == mode || YARN_CLIENT == mode;
}
@@ -114,7 +114,7 @@ public enum SparkExecutionMode {
}
/** Judge the given spark execution mode whether is remote execution mode. */
- public static boolean isRemoteMode(@Nullable SparkExecutionMode mode) {
+ public static boolean isRemoteMode(@Nullable SparkDeployMode mode) {
return REMOTE == mode;
}
}
diff --git a/streampark-common/src/main/java/org/apache/streampark/common/enums/SparkDevelopmentMode.java b/streampark-common/src/main/java/org/apache/streampark/common/enums/SparkJobType.java
similarity index 78%
rename from streampark-common/src/main/java/org/apache/streampark/common/enums/SparkDevelopmentMode.java
rename to streampark-common/src/main/java/org/apache/streampark/common/enums/SparkJobType.java
index a1531379a..cb6b4ed61 100644
--- a/streampark-common/src/main/java/org/apache/streampark/common/enums/SparkDevelopmentMode.java
+++ b/streampark-common/src/main/java/org/apache/streampark/common/enums/SparkJobType.java
@@ -21,7 +21,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/** The spark deployment mode enum. */
-public enum SparkDevelopmentMode {
+public enum SparkJobType {
/** Unknown type replace null */
UNKNOWN("Unknown", -1),
@@ -39,28 +39,28 @@ public enum SparkDevelopmentMode {
private final Integer mode;
- SparkDevelopmentMode(@Nonnull String name, @Nonnull Integer mode) {
+ SparkJobType(@Nonnull String name, @Nonnull Integer mode) {
this.name = name;
this.mode = mode;
}
/**
- * Try to resolve the mode value into {@link SparkDevelopmentMode}.
+ * Try to resolve the mode value into {@link SparkJobType}.
*
* @param value The mode value of potential spark deployment mode.
* @return The parsed spark deployment mode.
*/
@Nonnull
- public static SparkDevelopmentMode valueOf(@Nullable Integer value) {
- for (SparkDevelopmentMode sparkDevelopmentMode : values()) {
+ public static SparkJobType valueOf(@Nullable Integer value) {
+ for (SparkJobType sparkDevelopmentMode : values()) {
if (sparkDevelopmentMode.mode.equals(value)) {
return sparkDevelopmentMode;
}
}
- return SparkDevelopmentMode.UNKNOWN;
+ return SparkJobType.UNKNOWN;
}
- /** Get the mode value of the current {@link SparkDevelopmentMode} enum. */
+ /** Get the mode value of the current {@link SparkJobType} enum. */
@Nonnull
public Integer getMode() {
return mode;
diff --git a/streampark-console/streampark-console-service/pom.xml b/streampark-console/streampark-console-service/pom.xml
index d32f85d0b..b0938bb6f 100644
--- a/streampark-console/streampark-console-service/pom.xml
+++ b/streampark-console/streampark-console-service/pom.xml
@@ -397,18 +397,6 @@
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.streampark</groupId>
- <artifactId>streampark-flink-sql-gateway-base</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.streampark</groupId>
- <artifactId>streampark-flink-sql-gateway-flink-v1</artifactId>
- <version>${project.version}</version>
- </dependency>
-
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_${scala.binary.version}</artifactId>
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/data/mysql-data.sql b/streampark-console/streampark-console-service/src/main/assembly/script/data/mysql-data.sql
index ce909e13d..a756a60b7 100644
--- a/streampark-console/streampark-console-service/src/main/assembly/script/data/mysql-data.sql
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/data/mysql-data.sql
@@ -31,7 +31,7 @@ insert into `t_team` values (100000, 'default', null, now(), now());
-- Records of t_flink_app
-- ----------------------------
INSERT INTO `t_flink_app` (
- `id`, `team_id`, `job_type`, `execution_mode`, `job_name`, `user_id`, `app_type`, `state`, `restart_size`,
+ `id`, `team_id`, `job_type`, `deploy_mode`, `job_name`, `user_id`, `app_type`, `state`, `restart_size`,
`description`,`resolve_order`,`option_state`,`tracking`,`create_time`, `modify_time`,`release`, `build`,
`k8s_hadoop_integration`,`tags`
) VALUES (100000, 100000, 2, 4, 'Flink SQL Demo', 100000, 1, 0, 0, 'Flink SQL Demo', 0, 0, 0, now(), now(), 1, 1, 0, 'streampark,test');
@@ -55,7 +55,7 @@ insert into `t_flink_sql` values (100000, 100000, 'eNqlUUtPhDAQvu+vmFs1AYIHT5s94
-- Records of t_spark_app
-- ----------------------------
insert into `t_spark_app` (
- `id`, `team_id`, `job_type`, `app_type`, `app_name`, `execution_mode`, `resource_from`, `main_class`,
+ `id`, `team_id`, `job_type`, `app_type`, `app_name`, `deploy_mode`, `resource_from`, `main_class`,
`yarn_queue`, `k8s_image_pull_policy`, `k8s_namespace`, `state`, `option_state`, `user_id`,
`description`, `tracking`, `release`, `build`, `create_time`, `modify_time`, `tags`)
values (100000, 100000, 2, 4, 'Spark SQL Demo', 2, 2, 'org.apache.streampark.spark.cli.SqlClient', 'default', 0, 'default', 0, 0, 100000, 'Spark SQL Demo', 0, 1, 1, now(), now(), 'streampark,test');
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/data/pgsql-data.sql b/streampark-console/streampark-console-service/src/main/assembly/script/data/pgsql-data.sql
index cbe75e12f..484b5736a 100644
--- a/streampark-console/streampark-console-service/src/main/assembly/script/data/pgsql-data.sql
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/data/pgsql-data.sql
@@ -26,7 +26,7 @@ insert into "public"."t_team" values (100000, 'default', null, now(), now());
-- Records of t_flink_app
-- ----------------------------
INSERT INTO "public"."t_flink_app" (
- "id", "team_id", "job_type", "execution_mode", "job_name", "user_id", "app_type", "state", "restart_size",
+ "id", "team_id", "job_type", "deploy_mode", "job_name", "user_id", "app_type", "state", "restart_size",
"description", "resolve_order", "option_state", "tracking", "create_time", "modify_time", "release", "build",
"k8s_hadoop_integration", "tags"
) VALUES (100000, 100000, 2, 4, 'Flink SQL Demo', 100000, 1, 0, 0, 'Flink SQL Demo', 0, 0, 0, now(), now(), 1, true, false, 'streampark,test');
@@ -50,7 +50,7 @@ insert into "public"."t_flink_sql" values (100000, 100000, 'eNqlUUtPhDAQvu+vmFs1
-- Records of t_spark_app
-- ----------------------------
insert into "public"."t_spark_app" (
- "id", "team_id", "job_type", "app_type", "app_name", "execution_mode", "resource_from", "main_class",
+ "id", "team_id", "job_type", "app_type", "app_name", "deploy_mode", "resource_from", "main_class",
"yarn_queue", "k8s_image_pull_policy", "k8s_namespace", "state", "option_state", "user_id",
"description", "tracking", "release", "build", "create_time", "modify_time", "tags")
values (100000, 100000, 2, 4, 'Spark SQL Demo', 2, 2, 'org.apache.streampark.spark.cli.SqlClient', 'default', 0, 'default', 0, 0, 100000, 'Spark SQL Demo', 0, 1, 1, now(), now(), 'streampark,test');
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/schema/mysql-schema.sql b/streampark-console/streampark-console-service/src/main/assembly/script/schema/mysql-schema.sql
index e723e63fc..09c6620c6 100644
--- a/streampark-console/streampark-console-service/src/main/assembly/script/schema/mysql-schema.sql
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/schema/mysql-schema.sql
@@ -22,10 +22,10 @@ set names utf8mb4;
set foreign_key_checks = 0;
-- ----------------------------
--- table structure for t_app_backup
+-- table structure for t_flink_app_backup
-- ----------------------------
-drop table if exists `t_app_backup`;
-create table `t_app_backup` (
+drop table if exists `t_flink_app_backup`;
+create table `t_flink_app_backup` (
`id` bigint not null auto_increment,
`app_id` bigint default null,
`sql_id` bigint default null,
@@ -45,7 +45,7 @@ create table `t_flink_app` (
`id` bigint not null auto_increment,
`team_id` bigint not null,
`job_type` tinyint default null,
- `execution_mode` tinyint default null,
+ `deploy_mode` tinyint default null,
`resource_from` tinyint default null,
`project_id` bigint default null,
`job_name` varchar(255) collate utf8mb4_general_ci default null,
@@ -440,7 +440,7 @@ create table `t_flink_cluster` (
`cluster_name` varchar(128) not null comment 'cluster name',
`options` text comment 'json form of parameter collection ',
`yarn_queue` varchar(128) default null comment 'the yarn queue where the task is located',
- `execution_mode` tinyint not null default 1 comment 'k8s execution session mode(1:remote,3:yarn-session,5:kubernetes-session)',
+ `deploy_mode` tinyint not null default 1 comment 'k8s execution session mode(1:remote,3:yarn-session,5:kubernetes-session)',
`version_id` bigint not null comment 'flink version id',
`k8s_namespace` varchar(63) default 'default' comment 'k8s namespace',
`service_account` varchar(64) default null comment 'k8s service account',
@@ -459,7 +459,7 @@ create table `t_flink_cluster` (
`end_time` datetime default null comment 'end time',
`alert_id` bigint default null comment 'alert id',
primary key (`id`,`cluster_name`),
- unique key `id` (`cluster_id`,`address`,`execution_mode`)
+ unique key `id` (`cluster_id`,`address`,`deploy_mode`)
) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci;
@@ -584,7 +584,7 @@ create table `t_spark_app` (
`app_type` tinyint default null comment '(1)Apache Spark(2)StreamPark Spark',
`version_id` bigint default null comment 'spark version',
`app_name` varchar(255) collate utf8mb4_general_ci default null comment 'spark.app.name',
- `execution_mode` tinyint default null comment 'spark.submit.deployMode(1)cluster(2)client',
+ `deploy_mode` tinyint default null comment 'spark.submit.deployMode(1)cluster(2)client',
`resource_from` tinyint default null,
`project_id` bigint default null,
`module` varchar(255) collate utf8mb4_general_ci default null,
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/schema/pgsql-schema.sql b/streampark-console/streampark-console-service/src/main/assembly/script/schema/pgsql-schema.sql
index c25619457..6b2df02a1 100644
--- a/streampark-console/streampark-console-service/src/main/assembly/script/schema/pgsql-schema.sql
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/schema/pgsql-schema.sql
@@ -36,7 +36,7 @@ drop table if exists "public"."t_flink_cluster";
drop table if exists "public"."t_flink_app";
drop table if exists "public"."t_distributed_task";
drop table if exists "public"."t_app_build_pipe";
-drop table if exists "public"."t_app_backup";
+drop table if exists "public"."t_flink_app_backup";
drop table if exists "public"."t_alert_config";
drop table if exists "public"."t_access_token";
drop table if exists "public"."t_flink_log";
@@ -63,7 +63,7 @@ drop sequence if exists "public"."streampark_t_flink_config_id_seq";
drop sequence if exists "public"."streampark_t_flink_cluster_id_seq";
drop sequence if exists "public"."streampark_t_flink_app_id_seq";
drop sequence if exists "public"."streampark_t_distributed_task_id_seq";
-drop sequence if exists "public"."streampark_t_app_backup_id_seq";
+drop sequence if exists "public"."streampark_t_flink_app_backup_id_seq";
drop sequence if exists "public"."streampark_t_alert_config_id_seq";
drop sequence if exists "public"."streampark_t_access_token_id_seq";
drop sequence if exists "public"."streampark_t_flink_log_id_seq";
@@ -148,13 +148,13 @@ create index "inx_alert_user" on "public"."t_alert_config" using btree (
-- ----------------------------
--- table structure for t_app_backup
+-- table structure for t_flink_app_backup
-- ----------------------------
-create sequence "public"."streampark_t_app_backup_id_seq"
+create sequence "public"."streampark_t_flink_app_backup_id_seq"
increment 1 start 10000 cache 1 minvalue 10000 maxvalue 9223372036854775807;
-create table "public"."t_app_backup" (
- "id" int8 not null default nextval('streampark_t_app_backup_id_seq'::regclass),
+create table "public"."t_flink_app_backup" (
+ "id" int8 not null default nextval('streampark_t_flink_app_backup_id_seq'::regclass),
"app_id" int8,
"sql_id" int8,
"config_id" int8,
@@ -164,7 +164,7 @@ create table "public"."t_app_backup" (
"create_time" timestamp(6)
)
;
-alter table "public"."t_app_backup" add constraint "t_app_backup_pkey" primary key ("id");
+alter table "public"."t_flink_app_backup" add constraint "t_flink_app_backup_pkey" primary key ("id");
-- ----------------------------
@@ -195,7 +195,7 @@ create table "public"."t_flink_app" (
"id" int8 not null default nextval('streampark_t_flink_app_id_seq'::regclass),
"team_id" int8,
"job_type" int2,
- "execution_mode" int2,
+ "deploy_mode" int2,
"resource_from" int2,
"project_id" bigint,
"job_name" varchar(255) collate "pg_catalog"."default",
@@ -280,7 +280,7 @@ create table "public"."t_flink_cluster" (
"cluster_name" varchar(128) collate "pg_catalog"."default" not null,
"options" text collate "pg_catalog"."default",
"yarn_queue" varchar(128) collate "pg_catalog"."default",
- "execution_mode" int2 not null default 1,
+ "deploy_mode" int2 not null default 1,
"version_id" int8 not null,
"k8s_namespace" varchar(63) collate "pg_catalog"."default",
"service_account" varchar(64) collate "pg_catalog"."default",
@@ -306,7 +306,7 @@ comment on column "public"."t_flink_cluster"."cluster_id" is 'clusterid of sessi
comment on column "public"."t_flink_cluster"."cluster_name" is 'cluster name';
comment on column "public"."t_flink_cluster"."options" is 'parameter collection json form';
comment on column "public"."t_flink_cluster"."yarn_queue" is 'the yarn queue where the task is located';
-comment on column "public"."t_flink_cluster"."execution_mode" is 'k8s execution session mode(1:remote,3:yarn-session,5:kubernetes-session)';
+comment on column "public"."t_flink_cluster"."deploy_mode" is 'k8s execution session mode(1:remote,3:yarn-session,5:kubernetes-session)';
comment on column "public"."t_flink_cluster"."version_id" is 'flink version id';
comment on column "public"."t_flink_cluster"."k8s_namespace" is 'k8s namespace';
comment on column "public"."t_flink_cluster"."service_account" is 'k8s service account';
@@ -323,7 +323,7 @@ alter table "public"."t_flink_cluster" add constraint "t_flink_cluster_pkey" pri
create index "id" on "public"."t_flink_cluster" using btree (
"cluster_id" collate "pg_catalog"."default" "pg_catalog"."text_ops" asc nulls last,
"address" collate "pg_catalog"."default" "pg_catalog"."text_ops" asc nulls last,
- "execution_mode" "pg_catalog"."int2_ops" asc nulls last
+ "deploy_mode" "pg_catalog"."int2_ops" asc nulls last
);
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.0.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.0.sql
index 37a874ef4..6ba50d281 100644
--- a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.0.sql
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.0.sql
@@ -20,6 +20,29 @@ use streampark;
set names utf8mb4;
set foreign_key_checks = 0;
+alter table t_app_backup rename to t_flink_app_backup;
+
+alter table `t_flink_app`
+ add column `k8s_name` varchar(63) collate utf8mb4_general_ci default null,
+ -- modify_time change with duration #3188
+ modify column `modify_time` datetime not null default current_timestamp comment 'modify time';
+
+alter table `t_flink_log`
+ add column `user_id` bigint default null comment 'operator user id';
+
+alter table `t_flink_project`
+ add column `salt` varchar(26) collate utf8mb4_general_ci default null comment 'password salt',
+ modify column `password` varchar(512) collate utf8mb4_general_ci default null comment 'password';
+
+alter table `t_flink_sql`
+ add column `team_resource` varchar(64) default null;
+
+alter table `t_flink_cluster`
+ add column `job_manager_url` varchar(150) default null comment 'url address of jobmanager' after `address`,
+ add column `start_time` datetime default null comment 'start time',
+ add column `end_time` datetime default null comment 'end time',
+ add column `alert_id` bigint default null comment 'alert id';
+
-- ----------------------------
-- Table of t_resource
-- ----------------------------
@@ -40,18 +63,6 @@ primary key (`id`) using btree,
unique key `un_team_vcode_inx` (`team_id`,`resource_name`) using btree
) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci;
-alter table `t_flink_sql`
- add column `team_resource` varchar(64) default null;
-
-alter table `t_flink_app`
- add column `hadoop_user` varchar(64) default null;
-
-alter table `t_flink_cluster`
- add column `job_manager_url` varchar(150) default null comment 'url address of jobmanager' after `address`,
- add column `start_time` datetime default null comment 'start time',
- add column `end_time` datetime default null comment 'end time',
- add column `alert_id` bigint default null comment 'alert id';
-
-- menu level 2
insert into `t_menu` values (120400, 120000, 'menu.resource', '/flink/resource', 'flink/resource/View', null, 'apartment', '0', 1, 3, now(), now());
-- menu level 3
@@ -74,45 +85,11 @@ insert into `t_role_menu` (role_id, menu_id) values (100002, 120403);
alter table `t_user` modify column `password` varchar(64) collate utf8mb4_general_ci default null comment 'password';
alter table `t_user` modify column `login_type` tinyint default 0 comment 'login type 0:password 1:ldap 2:sso';
--- ----------------------------
--- Table of t_flink_gateway
--- ----------------------------
-drop table if exists `t_flink_gateway`;
-create table `t_flink_gateway` (
-`id` bigint not null auto_increment,
-`gateway_name` varchar(128) collate utf8mb4_general_ci not null comment 'The name of the gateway',
-`description` text collate utf8mb4_general_ci default null comment 'More detailed description of resource',
-`gateway_type` int not null comment 'The type of the gateway',
-`address` varchar(150) default null comment 'url address of gateway endpoint',
-`create_time` datetime default null comment 'create time',
-`modify_time` datetime default null comment 'modify time',
-primary key (`id`) using btree
-) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci;
-
--- menu level 2
-insert into `t_menu` values (120500, 130000, 'setting.flinkGateway', '/setting/FlinkGateway', 'setting/FlinkGateway/index', null, 'apartment', '0', 1, 3, now(), now());
--- menu level 3
-insert into `t_menu` values (120501, 120500, 'add', NULL, NULL, 'gateway:add', NULL, '1', 1, NULL, now(), now());
-insert into `t_menu` values (120502, 120500, 'update', NULL, NULL, 'gateway:update', NULL, '1', 1, NULL, now(), now());
-insert into `t_menu` values (120503, 120500, 'delete', NULL, NULL, 'gateway:delete', NULL, '1', 1, NULL, now(), now());
-
--- role menu script
-insert into `t_role_menu` (role_id, menu_id) values (100001, 120500);
-insert into `t_role_menu` (role_id, menu_id) values (100001, 120501);
-insert into `t_role_menu` (role_id, menu_id) values (100001, 120502);
-insert into `t_role_menu` (role_id, menu_id) values (100001, 120503);
-
-insert into `t_role_menu` (role_id, menu_id) values (100002, 120500);
-insert into `t_role_menu` (role_id, menu_id) values (100002, 120501);
-insert into `t_role_menu` (role_id, menu_id) values (100002, 120502);
-insert into `t_role_menu` (role_id, menu_id) values (100002, 120503);
-
-- ----------------------------
-- Table structure for jdbc registry
-- ----------------------------
DROP TABLE IF EXISTS `t_jdbc_registry_data`;
-CREATE TABLE `t_jdbc_registry_data`
-(
+CREATE TABLE `t_jdbc_registry_data` (
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
`data_key` varchar(256) NOT NULL COMMENT 'key, like zookeeper node path',
`data_value` text NOT NULL COMMENT 'data, like zookeeper node value',
@@ -127,8 +104,7 @@ CREATE TABLE `t_jdbc_registry_data`
DROP TABLE IF EXISTS `t_jdbc_registry_lock`;
-CREATE TABLE `t_jdbc_registry_lock`
-(
+CREATE TABLE `t_jdbc_registry_lock` (
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
`lock_key` varchar(256) NOT NULL COMMENT 'lock path',
`lock_owner` varchar(256) NOT NULL COMMENT 'the lock owner, ip_processId',
@@ -140,8 +116,7 @@ CREATE TABLE `t_jdbc_registry_lock`
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `t_jdbc_registry_client_heartbeat`;
-CREATE TABLE `t_jdbc_registry_client_heartbeat`
-(
+CREATE TABLE `t_jdbc_registry_client_heartbeat` (
`id` bigint(11) NOT NULL COMMENT 'primary key',
`client_name` varchar(256) NOT NULL COMMENT 'client name, ip_processId',
`last_heartbeat_time` bigint(11) NOT NULL COMMENT 'last heartbeat timestamp',
@@ -152,8 +127,7 @@ CREATE TABLE `t_jdbc_registry_client_heartbeat`
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `t_jdbc_registry_data_change_event`;
-CREATE TABLE `t_jdbc_registry_data_change_event`
-(
+CREATE TABLE `t_jdbc_registry_data_change_event` (
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
`event_type` varchar(64) NOT NULL COMMENT 'ADD, UPDATE, DELETE',
`jdbc_registry_data` text NOT NULL COMMENT 'jdbc registry data',
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.2.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.2.sql
deleted file mode 100644
index f0e38a3e8..000000000
--- a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.2.2.sql
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-use streampark;
-
-set names utf8mb4;
-set foreign_key_checks = 0;
-
--- reset t_menu
-truncate table `t_menu`;
-insert into `t_menu` values (110000, 0, 'Apache Flink', '/flink', 'PageView', null, null, '0', 1, 1, now(), now());
-insert into `t_menu` values (120000, 0, 'Apache Spark', '/spark', 'PageView', null, null, '0', 1, 2, now(), now());
-insert into `t_menu` values (130000, 0, 'resource.menu', '/resource', 'PageView', null, 0, '0', 1, 3, now(), now());
-insert into `t_menu` values (140000, 0, 'setting.menu', '/setting', 'PageView', null, 0, '0', 1, 4, now(), now());
-insert into `t_menu` values (150000, 0, 'system.menu', '/system', 'PageView', null, 0, '0', 1, 5, now(), now());
-
-insert into `t_menu` values (110100, 110000, 'flink.application', '/flink/app', 'flink/app/View', null, null, '0', 1, 2, now(), now());
-insert into `t_menu` values (110200, 110000, 'flink.flinkHome', '/flink/home', 'flink/home/View', null, null, '0', 1, 3, now(), now());
-insert into `t_menu` values (110300, 110000, 'flink.flinkCluster', '/flink/cluster', 'flink/cluster/View', 'menu:view', null, '0', 1, 4, now(), now());
-
-insert into `t_menu` values (110101, 110100, 'app view', null, null, 'app:view', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110102, 110100, 'app add', '/flink/app/add', 'flink/app/Add', 'app:create', '', '0', 0, null, now(), now());
-insert into `t_menu` values (110103, 110100, 'app detail', '/flink/app/detail', 'flink/app/Detail', 'app:detail', '', '0', 0, null, now(), now());
-insert into `t_menu` values (110104, 110100, 'app edit flink', '/flink/app/edit_flink', 'flink/app/EditFlink', 'app:update', '', '0', 0, null, now(), now());
-insert into `t_menu` values (110105, 110100, 'app edit streampark', '/flink/app/edit_streampark', 'flink/app/EditStreamPark', 'app:update', '', '0', 0, null, now(), now());
-insert into `t_menu` values (110106, 110100, 'app mapping', null, null, 'app:mapping', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110107, 110100, 'app release', null, null, 'app:release', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110108, 110100, 'app start', null, null, 'app:start', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110109, 110100, 'app clean', null, null, 'app:clean', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110110, 110100, 'app cancel', null, null, 'app:cancel', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110111, 110100, 'app savepoint delete', null, null, 'savepoint:delete', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110112, 110100, 'app backup rollback', null, null, 'backup:rollback', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110113, 110100, 'app backup delete', null, null, 'backup:delete', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110114, 110100, 'app conf delete', null, null, 'conf:delete', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110115, 110100, 'app delete', null, null, 'app:delete', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110116, 110100, 'app copy', null, null, 'app:copy', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110117, 110100, 'app savepoint trigger', null, null, 'savepoint:trigger', null, '1', 1, null, now(), now());
-insert into `t_menu` values (110118, 110100, 'app sql delete', null, null, 'sql:delete', null, '1', 1, null, now(), now());
-
-insert into `t_menu` values (110301, 110300, 'cluster add', '/flink/add_cluster', 'flink/cluster/Add', 'cluster:create', '', '0', 0, null, now(), now());
-insert into `t_menu` values (110302, 110300, 'cluster edit', '/flink/edit_cluster', 'flink/cluster/Edit', 'cluster:update', '', '0', 0, null, now(), now());
-
-insert into `t_menu` values (130100, 130000, 'resource.project', '/resource/project', 'resource/project/View', null, 'github', '0', 1, 3, now(), now());
-insert into `t_menu` values (130200, 130000, 'resource.variable', '/resource/variable', 'resource/variable/View', null, null, '0', 1, 4, now(), now());
-insert into `t_menu` values (130300, 130000, 'resource.upload', '/resource/upload', 'resource/upload/View', null, null, '0', 1, 3, now(), now());
-
-insert into `t_menu` values (130101, 130100, 'project view', null, null, 'project:view', null, '1', 1, null, now(), now());
-insert into `t_menu` values (130102, 130100, 'project add', '/project/add', 'project/Add', 'project:create', '', '0', 0, null, now(), now());
-insert into `t_menu` values (130103, 130100, 'project build', null, null, 'project:build', null, '1', 1, null, now(), now());
-insert into `t_menu` values (130104, 130100, 'project delete', null, null, 'project:delete', null, '1', 1, null, now(), now());
-insert into `t_menu` values (130105, 130100, 'project edit', '/project/edit', 'project/Edit', 'project:update', null, '0', 0, null, now(), now());
-
-insert into `t_menu` values (130201, 130200, 'variable view', NULL, NULL, 'variable:view', NULL, '1', 1, null, now(), now());
-insert into `t_menu` values (130202, 130200, 'variable depend view', null, null, 'variable:depend_apps', null, '1', 1, NULL, now(), now());
-insert into `t_menu` values (130203, 130200, 'variable add', NULL, NULL, 'variable:add', NULL, '1', 1, NULL, now(), now());
-insert into `t_menu` values (130204, 130200, 'variable update', NULL, NULL, 'variable:update', NULL, '1', 1, NULL, now(), now());
-insert into `t_menu` values (130205, 130200, 'variable delete', NULL, NULL, 'variable:delete', NULL, '1', 1, NULL, now(), now());
-insert into `t_menu` values (130206, 130200, 'variable depend apps', '/resource/variable/depend_apps', 'resource/variable/DependApps', 'variable:depend_apps', '', '0', 0, NULL, now(), now());
-insert into `t_menu` values (130207, 130200, 'variable show original', NULL, NULL, 'variable:show_original', NULL, '1', 1, NULL, now(), now());
-
-insert into `t_menu` values (130301, 130300, 'resource add', NULL, NULL, 'resource:add', NULL, '1', 1, NULL, now(), now());
-insert into `t_menu` values (130302, 130300, 'resource update', NULL, NULL, 'resource:update', NULL, '1', 1, NULL, now(), now());
-insert into `t_menu` values (130303, 130300, 'resource delete', NULL, NULL, 'resource:delete', NULL, '1', 1, NULL, now(), now());
-
-insert into `t_menu` values (140100, 140000, 'setting.system', '/setting/system', 'setting/system/View', null, null, '0', 1, 1, now(), now());
-insert into `t_menu` values (140200, 140000, 'setting.alarm', '/setting/alarm', 'setting/alarm/View', null, null, '0', 1, 2, now(), now());
-insert into `t_menu` values (140300, 140000, 'setting.externalLink', '/setting/externalLink', 'setting/externalLink/View', 'menu:view', null, '0', 1, 5, now(), now());
-insert into `t_menu` values (140400, 140000, 'setting.yarnQueue', '/setting/yarn-queue', 'setting/yarn-queue/View', 'menu:view', null, '0', 1, 6, now(), now());
-insert into `t_menu` values (140101, 140100, 'setting view', null, null, 'setting:view', null, '1', 1, null, now(), now());
-insert into `t_menu` values (140102, 140100, 'setting update', null, null, 'setting:update', null, '1', 1, null, now(), now());
-
-insert into `t_menu` values (140301, 140300, 'link view', null, null, 'externalLink:view', null, '1', 1, null, now(), now());
-insert into `t_menu` values (140302, 140300, 'link create', null, null, 'externalLink:create', null, '1', 1, null, now(), now());
-insert into `t_menu` values (140303, 140300, 'link update', null, null, 'externalLink:update', null, '1', 1, null, now(), now());
-insert into `t_menu` values (140304, 140300, 'link delete', null, null, 'externalLink:delete', null, '1', 1, null, now(), now());
-insert into `t_menu` values (140401, 140400, 'yarn queue add', null, null, 'yarnQueue:create', '', '1', 0, null, now(), now());
-insert into `t_menu` values (140402, 140400, 'yarn queue edit', null, null, 'yarnQueue:update', '', '1', 0, null, now(), now());
-insert into `t_menu` values (140403, 140400, 'yarn queue delete', null, null, 'yarnQueue:delete', '', '1', 0, null, now(), now());
-
-insert into `t_menu` values (150100, 150000, 'system.user', '/system/user', 'system/user/View', null, null, '0', 1, 1, now(), now());
-insert into `t_menu` values (150200, 150000, 'system.role', '/system/role', 'system/role/View', null, null, '0', 1, 2, now(), now());
-insert into `t_menu` values (150300, 150000, 'system.token', '/system/token', 'system/token/View', null, null, '0', 1, 1, now(), now());
-insert into `t_menu` values (150400, 150000, 'system.team', '/system/team', 'system/team/View', null, null, '0', 1, 2, now(), now());
-insert into `t_menu` values (150500, 150000, 'system.member', '/system/member', 'system/member/View', null, null, '0', 1, 2, now(), now());
-
-insert into `t_menu` values (150101, 150100, 'user view', null, null, 'user:view', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150102, 150100, 'user add', null, null, 'user:add', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150103, 150100, 'user update', null, null, 'user:update', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150104, 150100, 'user delete', null, null, 'user:delete', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150105, 150100, 'user reset', null, null, 'user:reset', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150106, 150100, 'user types', null, null, 'user:types', null, '1', 1, null, now(), now());
-
-insert into `t_menu` values (150201, 150200, 'role view', null, null, 'role:view', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150202, 150200, 'role add', null, null, 'role:add', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150203, 150200, 'role update', null, null, 'role:update', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150204, 150200, 'role delete', null, null, 'role:delete', null, '1', 1, null, now(), now());
-
-insert into `t_menu` values (150301, 150300, 'token view', null, null, 'token:view', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150302, 150300, 'token add', null, null, 'token:add', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150303, 150300, 'token delete', null, null, 'token:delete', null, '1', 1, null, now(), now());
-
-insert into `t_menu` values (150401, 150400, 'team view', null, null, 'team:view', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150402, 150400, 'team add', null, null, 'team:add', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150403, 150400, 'team update', null, null, 'team:update', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150404, 150400, 'team delete', null, null, 'team:delete', null, '1', 1, null, now(), now());
-
-insert into `t_menu` values (150501, 150500, 'member view', null, null, 'member:view', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150502, 150500, 'member add', null, null, 'member:add', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150503, 150500, 'member update', null, null, 'member:update', null, '1', 1, null, now(), now());
-insert into `t_menu` values (150504, 150500, 'member delete', null, null, 'member:delete', null, '1', 1, null, now(), now());
-
--- reset t_role_menu
-truncate table `t_role_menu`;
-insert into `t_role_menu` values (100000, 100001, 110000);
-insert into `t_role_menu` values (100001, 100001, 110100);
-insert into `t_role_menu` values (100002, 100001, 110101);
-insert into `t_role_menu` values (100003, 100001, 110102);
-insert into `t_role_menu` values (100004, 100001, 110103);
-insert into `t_role_menu` values (100005, 100001, 110104);
-insert into `t_role_menu` values (100006, 100001, 110105);
-insert into `t_role_menu` values (100007, 100001, 110106);
-insert into `t_role_menu` values (100008, 100001, 110107);
-insert into `t_role_menu` values (100009, 100001, 110108);
-insert into `t_role_menu` values (100010, 100001, 110109);
-insert into `t_role_menu` values (100011, 100001, 110110);
-insert into `t_role_menu` values (100012, 100001, 110111);
-insert into `t_role_menu` values (100013, 100001, 110112);
-insert into `t_role_menu` values (100014, 100001, 110113);
-insert into `t_role_menu` values (100015, 100001, 110114);
-insert into `t_role_menu` values (100016, 100001, 110115);
-insert into `t_role_menu` values (100017, 100001, 110116);
-insert into `t_role_menu` values (100018, 100001, 110117);
-insert into `t_role_menu` values (100019, 100001, 110118);
-insert into `t_role_menu` values (100020, 100001, 110200);
-insert into `t_role_menu` values (100021, 100001, 110300);
-insert into `t_role_menu` values (100022, 100001, 110301);
-insert into `t_role_menu` values (100023, 100001, 110302);
-insert into `t_role_menu` values (100024, 100001, 120000);
-insert into `t_role_menu` values (100025, 100001, 130000);
-insert into `t_role_menu` values (100026, 100001, 130100);
-insert into `t_role_menu` values (100027, 100001, 130101);
-insert into `t_role_menu` values (100028, 100001, 130102);
-insert into `t_role_menu` values (100029, 100001, 130103);
-insert into `t_role_menu` values (100030, 100001, 130104);
-insert into `t_role_menu` values (100031, 100001, 130105);
-insert into `t_role_menu` values (100032, 100001, 130200);
-insert into `t_role_menu` values (100033, 100001, 130201);
-insert into `t_role_menu` values (100034, 100001, 130202);
-insert into `t_role_menu` values (100035, 100001, 130203);
-insert into `t_role_menu` values (100036, 100001, 130204);
-insert into `t_role_menu` values (100037, 100001, 130205);
-insert into `t_role_menu` values (100038, 100001, 130206);
-insert into `t_role_menu` values (100039, 100001, 130207);
-insert into `t_role_menu` values (100040, 100001, 130300);
-insert into `t_role_menu` values (100041, 100001, 130301);
-insert into `t_role_menu` values (100042, 100001, 130302);
-insert into `t_role_menu` values (100043, 100001, 130303);
-insert into `t_role_menu` values (100044, 100001, 140000);
-insert into `t_role_menu` values (100045, 100001, 140100);
-insert into `t_role_menu` values (100046, 100001, 140101);
-insert into `t_role_menu` values (100047, 100002, 110000);
-insert into `t_role_menu` values (100048, 100002, 110100);
-insert into `t_role_menu` values (100049, 100002, 110101);
-insert into `t_role_menu` values (100050, 100002, 110102);
-insert into `t_role_menu` values (100051, 100002, 110103);
-insert into `t_role_menu` values (100052, 100002, 110104);
-insert into `t_role_menu` values (100053, 100002, 110105);
-insert into `t_role_menu` values (100054, 100002, 110106);
-insert into `t_role_menu` values (100055, 100002, 110107);
-insert into `t_role_menu` values (100056, 100002, 110108);
-insert into `t_role_menu` values (100057, 100002, 110109);
-insert into `t_role_menu` values (100058, 100002, 110110);
-insert into `t_role_menu` values (100059, 100002, 110111);
-insert into `t_role_menu` values (100060, 100002, 110112);
-insert into `t_role_menu` values (100061, 100002, 110113);
-insert into `t_role_menu` values (100062, 100002, 110114);
-insert into `t_role_menu` values (100063, 100002, 110115);
-insert into `t_role_menu` values (100064, 100002, 110116);
-insert into `t_role_menu` values (100065, 100002, 110117);
-insert into `t_role_menu` values (100066, 100002, 110118);
-insert into `t_role_menu` values (100067, 100002, 110200);
-insert into `t_role_menu` values (100068, 100002, 110300);
-insert into `t_role_menu` values (100069, 100002, 110301);
-insert into `t_role_menu` values (100070, 100002, 110302);
-insert into `t_role_menu` values (100071, 100002, 120000);
-insert into `t_role_menu` values (100072, 100002, 130000);
-insert into `t_role_menu` values (100073, 100002, 130100);
-insert into `t_role_menu` values (100074, 100002, 130101);
-insert into `t_role_menu` values (100075, 100002, 130102);
-insert into `t_role_menu` values (100076, 100002, 130103);
-insert into `t_role_menu` values (100077, 100002, 130104);
-insert into `t_role_menu` values (100078, 100002, 130105);
-insert into `t_role_menu` values (100079, 100002, 130200);
-insert into `t_role_menu` values (100080, 100002, 130201);
-insert into `t_role_menu` values (100081, 100002, 130202);
-insert into `t_role_menu` values (100082, 100002, 130203);
-insert into `t_role_menu` values (100083, 100002, 130204);
-insert into `t_role_menu` values (100084, 100002, 130205);
-insert into `t_role_menu` values (100085, 100002, 130206);
-insert into `t_role_menu` values (100086, 100002, 130207);
-insert into `t_role_menu` values (100087, 100002, 130300);
-insert into `t_role_menu` values (100088, 100002, 130301);
-insert into `t_role_menu` values (100089, 100002, 130302);
-insert into `t_role_menu` values (100090, 100002, 130303);
-insert into `t_role_menu` values (100091, 100002, 140000);
-insert into `t_role_menu` values (100092, 100002, 140100);
-insert into `t_role_menu` values (100093, 100002, 140101);
-insert into `t_role_menu` values (100094, 100002, 140102);
-insert into `t_role_menu` values (100095, 100002, 140200);
-insert into `t_role_menu` values (100096, 100002, 140300);
-insert into `t_role_menu` values (100097, 100002, 140301);
-insert into `t_role_menu` values (100098, 100002, 140302);
-insert into `t_role_menu` values (100099, 100002, 140303);
-insert into `t_role_menu` values (100100, 100002, 140304);
-insert into `t_role_menu` values (100101, 100002, 140400);
-insert into `t_role_menu` values (100102, 100002, 140401);
-insert into `t_role_menu` values (100103, 100002, 140402);
-insert into `t_role_menu` values (100104, 100002, 140403);
-insert into `t_role_menu` values (100105, 100002, 150000);
-insert into `t_role_menu` values (100106, 100002, 150500);
-insert into `t_role_menu` values (100107, 100002, 150501);
-insert into `t_role_menu` values (100108, 100002, 150502);
-insert into `t_role_menu` values (100109, 100002, 150503);
-insert into `t_role_menu` values (100110, 100002, 150504);
-
-alter table `t_flink_app`
- add column `k8s_name` varchar(63) collate utf8mb4_general_ci default null,
- -- modify_time change with duration #3188
- modify column `modify_time` datetime not null default current_timestamp comment 'modify time';
-
-alter table `t_flink_log`
- add column `user_id` bigint default null comment 'operator user id';
-
-alter table `t_flink_project`
- add column `salt` varchar(26) collate utf8mb4_general_ci default null comment 'password salt',
- modify column `password` varchar(512) collate utf8mb4_general_ci default null comment 'password';
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.0.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.0.sql
index 1b0f3bb8e..bb459c99a 100644
--- a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.0.sql
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.2.0.sql
@@ -84,31 +84,6 @@ insert into "public"."t_role_menu" (role_id, menu_id) values (100002, 120403);
alter table "public"."t_user" alter column "password" TYPE varchar(64) collate "pg_catalog"."default";
comment on column "public"."t_user"."login_type" is 'login type 0:password 1:ldap 2:sso';
--- ----------------------------
--- Table of t_flink_gateway
--- ----------------------------
-create sequence "public"."streampark_t_flink_gateway_id_seq"
-increment 1 start 10000 cache 1 minvalue 10000 maxvalue 9223372036854775807;
-
-create table "public"."t_flink_gateway" (
-"id" int8 not null default nextval('streampark_t_resource_id_seq'::regclass),
-"gateway_name" varchar(128) collate "pg_catalog"."default" not null,
-"description" text collate "pg_catalog"."default" default null,
-"gateway_type" int4,
-"address" varchar(150) collate "pg_catalog"."default",
-"create_time" timestamp(6),
-"modify_time" timestamp(6)
-);
-comment on column "public"."t_flink_gateway"."id" is 'The id of the gateway';
-comment on column "public"."t_flink_gateway"."gateway_name" is 'The name of the gateway';
-comment on column "public"."t_flink_gateway"."description" is 'More detailed description of resource';
-comment on column "public"."t_flink_gateway"."gateway_type" is 'The type of the gateway';
-comment on column "public"."t_flink_gateway"."address" is 'url address of gateway endpoint';
-comment on column "public"."t_flink_gateway"."create_time" is 'create time';
-comment on column "public"."t_flink_gateway"."modify_time" is 'modify time';
-
-alter table "public"."t_flink_gateway" add constraint "t_flink_gateway_pkey" primary key ("id");
-
insert into "public"."t_menu" values (120500, 130000, 'setting.flinkGateway', '/setting/FlinkGateway', 'setting/FlinkGateway/index', null, 'apartment', '0', '1', 3, now(), now());
insert into "public"."t_menu" values (110501, 110500, 'add', null, null, 'gateway:add', null, '1', '1', null, now(), now());
insert into "public"."t_menu" values (110502, 110500, 'update', null, null, 'gateway:update', null, '1', '1', null, now(), now());
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/aspect/PermissionAspect.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/aspect/PermissionAspect.java
index add5f5e01..698e023d1 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/aspect/PermissionAspect.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/aspect/PermissionAspect.java
@@ -20,9 +20,9 @@ package org.apache.streampark.console.core.aspect;
import org.apache.streampark.console.base.domain.RestResponse;
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.core.annotation.Permission;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.enums.UserTypeEnum;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.util.ServiceHelper;
import org.apache.streampark.console.system.entity.Member;
import org.apache.streampark.console.system.entity.User;
@@ -53,7 +53,7 @@ public class PermissionAspect {
private MemberService memberService;
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Pointcut("@annotation(org.apache.streampark.console.core.annotation.Permission)")
public void permissionPointcut() {
@@ -88,7 +88,7 @@ public class PermissionAspect {
// 3) check app
Long appId = getId(joinPoint, methodSignature, permission.app());
if (appId != null) {
- Application app = applicationManageService.getById(appId);
+ FlinkApplication app = applicationManageService.getById(appId);
ApiAlertException.throwIfTrue(app == null, "Invalid operation, application is null");
if (!currentUser.getUserId().equals(app.getUserId())) {
Member member = memberService.getByTeamIdUserName(app.getTeamId(), currentUser.getUsername());
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/bean/AlertTemplate.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/bean/AlertTemplate.java
index 4b9f220f8..2dec8a1bf 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/bean/AlertTemplate.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/bean/AlertTemplate.java
@@ -17,8 +17,8 @@
package org.apache.streampark.console.core.bean;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
-import org.apache.streampark.common.enums.SparkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
+import org.apache.streampark.common.enums.SparkDeployMode;
import org.apache.streampark.common.util.DateUtils;
import org.apache.streampark.common.util.YarnUtils;
@@ -88,8 +88,8 @@ public class AlertTemplate implements Serializable {
return this;
}
- public AlertTemplateBuilder link(FlinkExecutionMode mode, String appId) {
- if (FlinkExecutionMode.isYarnMode(mode)) {
+ public AlertTemplateBuilder link(FlinkDeployMode mode, String appId) {
+ if (FlinkDeployMode.isYarnMode(mode)) {
String format = "%s/proxy/%s/";
this.link = String.format(format, YarnUtils.getRMWebAppURL(false), appId);
} else {
@@ -98,8 +98,8 @@ public class AlertTemplate implements Serializable {
return this;
}
- public AlertTemplateBuilder link(SparkExecutionMode mode, String appId) {
- if (SparkExecutionMode.isYarnMode(mode)) {
+ public AlertTemplateBuilder link(SparkDeployMode mode, String appId) {
+ if (SparkDeployMode.isYarnMode(mode)) {
String format = "%s/proxy/%s/";
this.link = String.format(format, YarnUtils.getRMWebAppURL(false), appId);
} else {
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/component/FlinkCheckpointProcessor.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/component/FlinkCheckpointProcessor.java
index 5363c2ede..081440f0a 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/component/FlinkCheckpointProcessor.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/component/FlinkCheckpointProcessor.java
@@ -18,14 +18,14 @@
package org.apache.streampark.console.core.component;
import org.apache.streampark.common.util.AssertUtils;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.Savepoint;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkSavepoint;
import org.apache.streampark.console.core.enums.CheckPointStatusEnum;
import org.apache.streampark.console.core.enums.FailoverStrategyEnum;
import org.apache.streampark.console.core.metrics.flink.CheckPoints;
import org.apache.streampark.console.core.service.SavepointService;
import org.apache.streampark.console.core.service.alert.AlertService;
-import org.apache.streampark.console.core.service.application.ApplicationActionService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationActionService;
import org.apache.streampark.console.core.utils.AlertTemplateUtils;
import org.apache.streampark.console.core.watcher.FlinkAppHttpWatcher;
@@ -67,7 +67,7 @@ public class FlinkCheckpointProcessor {
private final Map<Long, Counter> checkPointFailedCache = new ConcurrentHashMap<>(0);
@Autowired
- private ApplicationActionService applicationActionService;
+ private FlinkApplicationActionService applicationActionService;
@Autowired
private AlertService alertService;
@@ -78,11 +78,11 @@ public class FlinkCheckpointProcessor {
@Autowired
private FlinkAppHttpWatcher flinkAppHttpWatcher;
- public void process(Application application, @Nonnull CheckPoints checkPoints) {
+ public void process(FlinkApplication application, @Nonnull CheckPoints checkPoints) {
checkPoints.getLatestCheckpoint().forEach(checkPoint -> process(application, checkPoint));
}
- private void process(Application application, @Nonnull CheckPoints.CheckPoint checkPoint) {
+ private void process(FlinkApplication application, @Nonnull CheckPoints.CheckPoint checkPoint) {
String jobID = application.getJobId();
Long appId = application.getId();
CheckPointStatusEnum status = checkPoint.getCheckPointStatus();
@@ -107,7 +107,7 @@ public class FlinkCheckpointProcessor {
}
private void processFailedCheckpoint(
- Application application, @Nonnull CheckPoints.CheckPoint checkPoint,
+ FlinkApplication application, @Nonnull CheckPoints.CheckPoint checkPoint,
Long appId) {
Counter counter = checkPointFailedCache.get(appId);
if (counter == null) {
@@ -130,7 +130,7 @@ public class FlinkCheckpointProcessor {
}
private void processFailoverStrategy(
- Application application, FailoverStrategyEnum failoverStrategyEnum) {
+ FlinkApplication application, FailoverStrategyEnum failoverStrategyEnum) {
switch (failoverStrategyEnum) {
case ALERT:
alertService.alert(
@@ -172,8 +172,8 @@ public class FlinkCheckpointProcessor {
return checkPointCache.get(
cacheId,
key -> {
- Savepoint savepoint = savepointService.getLatest(appId);
- return Optional.ofNullable(savepoint).map(Savepoint::getChkId).orElse(null);
+ FlinkSavepoint savepoint = savepointService.getLatest(appId);
+ return Optional.ofNullable(savepoint).map(FlinkSavepoint::getChkId).orElse(null);
});
}
@@ -184,7 +184,7 @@ public class FlinkCheckpointProcessor {
}
private void saveSavepoint(CheckPoints.CheckPoint checkPoint, Long appId) {
- Savepoint savepoint = new Savepoint();
+ FlinkSavepoint savepoint = new FlinkSavepoint();
savepoint.setAppId(appId);
savepoint.setChkId(checkPoint.getId());
savepoint.setLatest(true);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationController.java
index 0073efd31..3d9252731 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationController.java
@@ -24,16 +24,16 @@ import org.apache.streampark.console.base.domain.RestResponse;
import org.apache.streampark.console.base.exception.InternalException;
import org.apache.streampark.console.core.annotation.AppChangeEvent;
import org.apache.streampark.console.core.annotation.Permission;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationBackUp;
import org.apache.streampark.console.core.entity.ApplicationLog;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationBackUp;
import org.apache.streampark.console.core.enums.AppExistsStateEnum;
-import org.apache.streampark.console.core.service.ApplicationBackUpService;
import org.apache.streampark.console.core.service.ApplicationLogService;
+import org.apache.streampark.console.core.service.FlinkApplicationBackUpService;
import org.apache.streampark.console.core.service.ResourceService;
-import org.apache.streampark.console.core.service.application.ApplicationActionService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationActionService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -58,16 +58,16 @@ import java.util.Map;
public class ApplicationController {
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
- private ApplicationActionService applicationActionService;
+ private FlinkApplicationActionService applicationActionService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@Autowired
- private ApplicationBackUpService backUpService;
+ private FlinkApplicationBackUpService backUpService;
@Autowired
private ApplicationLogService applicationLogService;
@@ -78,15 +78,15 @@ public class ApplicationController {
@PostMapping("get")
@Permission(app = "#app.id")
@RequiresPermissions("app:detail")
- public RestResponse get(Application app) {
- Application application = applicationManageService.getApp(app.getId());
+ public RestResponse get(FlinkApplication app) {
+ FlinkApplication application = applicationManageService.getApp(app.getId());
return RestResponse.success(application);
}
@Permission(team = "#app.teamId")
@PostMapping("create")
@RequiresPermissions("app:create")
- public RestResponse create(Application app) throws IOException {
+ public RestResponse create(FlinkApplication app) throws IOException {
boolean saved = applicationManageService.create(app);
return RestResponse.success(saved);
}
@@ -94,7 +94,7 @@ public class ApplicationController {
@Permission(app = "#app.id", team = "#app.teamId")
@PostMapping("copy")
@RequiresPermissions("app:copy")
- public RestResponse copy(Application app) throws IOException {
+ public RestResponse copy(FlinkApplication app) throws IOException {
applicationManageService.copy(app);
return RestResponse.success();
}
@@ -103,7 +103,7 @@ public class ApplicationController {
@Permission(app = "#app.id")
@PostMapping("update")
@RequiresPermissions("app:update")
- public RestResponse update(Application app) {
+ public RestResponse update(FlinkApplication app) {
applicationManageService.update(app);
return RestResponse.success(true);
}
@@ -118,8 +118,8 @@ public class ApplicationController {
@PostMapping("list")
@Permission(team = "#app.teamId")
@RequiresPermissions("app:view")
- public RestResponse list(Application app, RestRequest request) {
- IPage<Application> applicationList = applicationManageService.page(app, request);
+ public RestResponse list(FlinkApplication app, RestRequest request) {
+ IPage<FlinkApplication> applicationList = applicationManageService.page(app, request);
return RestResponse.success(applicationList);
}
@@ -127,7 +127,7 @@ public class ApplicationController {
@PostMapping("mapping")
@Permission(app = "#app.id")
@RequiresPermissions("app:mapping")
- public RestResponse mapping(Application app) {
+ public RestResponse mapping(FlinkApplication app) {
boolean flag = applicationManageService.mapping(app);
return RestResponse.success(flag);
}
@@ -136,7 +136,7 @@ public class ApplicationController {
@Permission(app = "#app.id")
@PostMapping("revoke")
@RequiresPermissions("app:release")
- public RestResponse revoke(Application app) {
+ public RestResponse revoke(FlinkApplication app) {
applicationActionService.revoke(app.getId());
return RestResponse.success();
}
@@ -144,7 +144,7 @@ public class ApplicationController {
@Permission(app = "#app.id", team = "#app.teamId")
@PostMapping("check/start")
@RequiresPermissions("app:start")
- public RestResponse checkStart(Application app) {
+ public RestResponse checkStart(FlinkApplication app) {
AppExistsStateEnum stateEnum = applicationInfoService.checkStart(app.getId());
return RestResponse.success(stateEnum.get());
}
@@ -152,7 +152,7 @@ public class ApplicationController {
@Permission(app = "#app.id", team = "#app.teamId")
@PostMapping("start")
@RequiresPermissions("app:start")
- public RestResponse start(Application app) throws Exception {
+ public RestResponse start(FlinkApplication app) throws Exception {
applicationActionService.start(app, false);
return RestResponse.success(true);
}
@@ -160,7 +160,7 @@ public class ApplicationController {
@Permission(app = "#app.id", team = "#app.teamId")
@PostMapping("cancel")
@RequiresPermissions("app:cancel")
- public RestResponse cancel(Application app) throws Exception {
+ public RestResponse cancel(FlinkApplication app) throws Exception {
applicationActionService.cancel(app);
return RestResponse.success();
}
@@ -169,7 +169,7 @@ public class ApplicationController {
@Permission(app = "#app.id")
@PostMapping("abort")
@RequiresPermissions("app:cancel")
- public RestResponse abort(Application app) {
+ public RestResponse abort(FlinkApplication app) {
applicationActionService.abort(app.getId());
return RestResponse.success();
}
@@ -181,35 +181,35 @@ public class ApplicationController {
@PostMapping("name")
@Permission(app = "#app.id", team = "#app.teamId")
- public RestResponse yarnName(Application app) {
+ public RestResponse yarnName(FlinkApplication app) {
String yarnName = applicationInfoService.getYarnName(app.getConfig());
return RestResponse.success(yarnName);
}
@PostMapping("check/name")
@Permission(app = "#app.id", team = "#app.teamId")
- public RestResponse checkName(Application app) {
+ public RestResponse checkName(FlinkApplication app) {
AppExistsStateEnum exists = applicationInfoService.checkExists(app);
return RestResponse.success(exists.get());
}
@PostMapping("read_conf")
- public RestResponse readConf(Application app) throws IOException {
+ public RestResponse readConf(FlinkApplication app) throws IOException {
String config = applicationInfoService.readConf(app.getConfig());
return RestResponse.success(config);
}
@PostMapping("main")
@Permission(app = "#app.id", team = "#app.teamId")
- public RestResponse getMain(Application application) {
+ public RestResponse getMain(FlinkApplication application) {
String mainClass = applicationInfoService.getMain(application);
return RestResponse.success(mainClass);
}
@PostMapping("backups")
@Permission(app = "#backUp.appId", team = "#backUp.teamId")
- public RestResponse backups(ApplicationBackUp backUp, RestRequest request) {
- IPage<ApplicationBackUp> backups = backUpService.getPage(backUp, request);
+ public RestResponse backups(FlinkApplicationBackUp backUp, RestRequest request) {
+ IPage<FlinkApplicationBackUp> backups = backUpService.getPage(backUp, request);
return RestResponse.success(backups);
}
@@ -231,14 +231,14 @@ public class ApplicationController {
@Permission(app = "#app.id", team = "#app.teamId")
@PostMapping("delete")
@RequiresPermissions("app:delete")
- public RestResponse delete(Application app) throws InternalException {
+ public RestResponse delete(FlinkApplication app) throws InternalException {
Boolean deleted = applicationManageService.remove(app.getId());
return RestResponse.success(deleted);
}
@Permission(app = "#backUp.appId")
@PostMapping("delete/backup")
- public RestResponse deleteBackup(ApplicationBackUp backUp) throws InternalException {
+ public RestResponse deleteBackup(FlinkApplicationBackUp backUp) throws InternalException {
Boolean deleted = backUpService.removeById(backUp.getId());
return RestResponse.success(deleted);
}
@@ -273,7 +273,7 @@ public class ApplicationController {
@PostMapping("check/savepoint_path")
@Permission(app = "#app.id", team = "#app.teamId")
- public RestResponse checkSavepointPath(Application app) throws Exception {
+ public RestResponse checkSavepointPath(FlinkApplication app) throws Exception {
String error = applicationInfoService.checkSavepointPath(app);
if (error == null) {
return RestResponse.success(true);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationHistoryController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationHistoryController.java
index 994f8ab7e..04cea4eda 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationHistoryController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationHistoryController.java
@@ -17,9 +17,9 @@
package org.apache.streampark.console.core.controller;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.console.base.domain.RestResponse;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -40,7 +40,7 @@ import java.util.List;
public class ApplicationHistoryController {
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@PostMapping("k8s_namespaces")
@RequiresPermissions("app:create")
@@ -51,13 +51,13 @@ public class ApplicationHistoryController {
@PostMapping("session_cluster_ids")
@RequiresPermissions("app:create")
- public RestResponse listSessionClusterId(int executionMode) {
+ public RestResponse listSessionClusterId(int deployMode) {
List<String> clusterIds;
- switch (FlinkExecutionMode.of(executionMode)) {
+ switch (FlinkDeployMode.of(deployMode)) {
case KUBERNETES_NATIVE_SESSION:
case YARN_SESSION:
case REMOTE:
- clusterIds = applicationInfoService.listRecentK8sClusterId(executionMode);
+ clusterIds = applicationInfoService.listRecentK8sClusterId(deployMode);
break;
default:
clusterIds = new ArrayList<>(0);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ConfigController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ConfigController.java
index 46b6c5991..dd63d21aa 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ConfigController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ConfigController.java
@@ -20,9 +20,9 @@ package org.apache.streampark.console.core.controller;
import org.apache.streampark.common.util.HadoopConfigUtils;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.domain.RestResponse;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
-import org.apache.streampark.console.core.service.ApplicationConfigService;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
+import org.apache.streampark.console.core.service.FlinkApplicationConfigService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -45,11 +45,11 @@ import java.util.Map;
public class ConfigController {
@Autowired
- private ApplicationConfigService applicationConfigService;
+ private FlinkApplicationConfigService applicationConfigService;
@PostMapping("get")
public RestResponse get(Long id) {
- ApplicationConfig config = applicationConfigService.get(id);
+ FlinkApplicationConfig config = applicationConfigService.get(id);
return RestResponse.success(config);
}
@@ -60,14 +60,14 @@ public class ConfigController {
}
@PostMapping("list")
- public RestResponse list(ApplicationConfig config, RestRequest request) {
- IPage<ApplicationConfig> page = applicationConfigService.getPage(config, request);
+ public RestResponse list(FlinkApplicationConfig config, RestRequest request) {
+ IPage<FlinkApplicationConfig> page = applicationConfigService.getPage(config, request);
return RestResponse.success(page);
}
@PostMapping("history")
- public RestResponse history(Application application) {
- List<ApplicationConfig> history = applicationConfigService.list(application.getId());
+ public RestResponse history(FlinkApplication application) {
+ List<FlinkApplicationConfig> history = applicationConfigService.list(application.getId());
return RestResponse.success(history);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/FlinkGateWayController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/FlinkGateWayController.java
deleted file mode 100644
index 7353a4a7e..000000000
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/FlinkGateWayController.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.streampark.console.core.controller;
-
-import org.apache.streampark.console.base.domain.RestResponse;
-import org.apache.streampark.console.core.entity.FlinkGateWay;
-import org.apache.streampark.console.core.enums.GatewayTypeEnum;
-import org.apache.streampark.console.core.service.FlinkGateWayService;
-
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.validation.constraints.NotNull;
-
-@Slf4j
-@Validated
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("flink/gateway")
-public class FlinkGateWayController {
-
- private final FlinkGateWayService flinkGatewayService;
-
- @GetMapping("list")
- public RestResponse list() {
- return RestResponse.success(flinkGatewayService.list());
- }
-
- @PostMapping("create")
- public RestResponse create(@RequestBody FlinkGateWay flinkGateWay) {
- flinkGatewayService.create(flinkGateWay);
- return RestResponse.success();
- }
-
- @GetMapping("check/name")
- public RestResponse checkName(
- @NotNull(message = "The Gateway name cannot be null") @RequestParam("name") String name) {
- return RestResponse.success(flinkGatewayService.existsByGatewayName(name));
- }
-
- @GetMapping("check/address")
- public RestResponse checkAddress(
- @NotNull(message = "The Gateway address cannot be null") @RequestParam("address") String address) throws Exception {
- GatewayTypeEnum gatewayVersion = flinkGatewayService.getGatewayVersion(address);
- return RestResponse.success(gatewayVersion);
- }
-
- @PutMapping("update")
- public RestResponse update(@RequestBody FlinkGateWay flinkGateWay) {
- flinkGatewayService.update(flinkGateWay);
- return RestResponse.success();
- }
-
- @GetMapping("get/{id}")
- public RestResponse get(@PathVariable Long id) {
- return RestResponse.success(flinkGatewayService.getById(id));
- }
-
- @DeleteMapping("delete")
- public RestResponse delete(
- @NotNull(message = "The Gateway id cannot be null") @RequestParam("id") Long id) {
- flinkGatewayService.removeById(id);
- return RestResponse.success();
- }
-}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/FlinkSqlController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/FlinkSqlController.java
index 4659d2e45..ad08871ac 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/FlinkSqlController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/FlinkSqlController.java
@@ -22,7 +22,7 @@ import org.apache.streampark.console.base.domain.RestResponse;
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.exception.InternalException;
import org.apache.streampark.console.core.annotation.Permission;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkSql;
import org.apache.streampark.console.core.service.FlinkSqlService;
import org.apache.streampark.console.core.service.SqlCompleteService;
@@ -119,7 +119,7 @@ public class FlinkSqlController {
@PostMapping("history")
@Permission(app = "#app.id", team = "#app.teamId")
- public RestResponse history(Application app) {
+ public RestResponse history(FlinkApplication app) {
List<FlinkSql> sqlList = flinkSqlService.listFlinkSqlHistory(app.getId());
return RestResponse.success(sqlList);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/OpenAPIController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/OpenAPIController.java
index 0959004a0..3c85c0842 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/OpenAPIController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/OpenAPIController.java
@@ -22,8 +22,8 @@ import org.apache.streampark.console.core.annotation.OpenAPI;
import org.apache.streampark.console.core.annotation.Permission;
import org.apache.streampark.console.core.bean.OpenAPISchema;
import org.apache.streampark.console.core.component.OpenAPIComponent;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.service.application.ApplicationActionService;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.service.application.FlinkApplicationActionService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -45,7 +45,7 @@ public class OpenAPIController {
private OpenAPIComponent openAPIComponent;
@Autowired
- private ApplicationActionService applicationActionService;
+ private FlinkApplicationActionService applicationActionService;
@OpenAPI(name = "flinkStart", header = {
@OpenAPI.Param(name = "Authorization", description = "Access authorization token", required = true, type = String.class)
@@ -60,7 +60,7 @@ public class OpenAPIController {
@Permission(app = "#app.appId", team = "#app.teamId")
@PostMapping("app/start")
@RequiresPermissions("app:start")
- public RestResponse flinkStart(Application app) throws Exception {
+ public RestResponse flinkStart(FlinkApplication app) throws Exception {
applicationActionService.start(app, false);
return RestResponse.success(true);
}
@@ -77,7 +77,7 @@ public class OpenAPIController {
@Permission(app = "#app.appId", team = "#app.teamId")
@PostMapping("app/cancel")
@RequiresPermissions("app:cancel")
- public RestResponse flinkCancel(Application app) throws Exception {
+ public RestResponse flinkCancel(FlinkApplication app) throws Exception {
applicationActionService.cancel(app);
return RestResponse.success();
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ProxyController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ProxyController.java
index 1ae022594..2b586a1a6 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ProxyController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ProxyController.java
@@ -18,12 +18,12 @@
package org.apache.streampark.console.core.controller;
import org.apache.streampark.console.base.exception.ApiAlertException;
-import org.apache.streampark.console.core.entity.Application;
import org.apache.streampark.console.core.entity.ApplicationLog;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.enums.UserTypeEnum;
import org.apache.streampark.console.core.service.ApplicationLogService;
import org.apache.streampark.console.core.service.ProxyService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.util.ServiceHelper;
import org.apache.streampark.console.system.entity.Member;
import org.apache.streampark.console.system.entity.User;
@@ -53,7 +53,7 @@ public class ProxyController {
private ProxyService proxyService;
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
private ApplicationLogService logService;
@@ -79,7 +79,7 @@ public class ProxyController {
private ResponseEntity<?> proxy(String type, HttpServletRequest request, Long id) throws Exception {
ApplicationLog log;
- Application app;
+ FlinkApplication app;
switch (type) {
case "flink":
@@ -101,7 +101,7 @@ public class ProxyController {
}
}
- private void checkProxyApp(Application app) {
+ private void checkProxyApp(FlinkApplication app) {
ApiAlertException.throwIfNull(app, "Invalid operation, application is invalid.");
User user = ServiceHelper.getLoginUser();
@@ -116,7 +116,7 @@ public class ProxyController {
private void checkProxyAppLog(ApplicationLog log) {
ApiAlertException.throwIfNull(log, "Invalid operation, The application log not found.");
- Application app = applicationManageService.getById(log.getAppId());
+ FlinkApplication app = applicationManageService.getById(log.getAppId());
checkProxyApp(app);
}
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SavepointController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SavepointController.java
index 85902e3c3..8b7921e5e 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SavepointController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SavepointController.java
@@ -21,10 +21,10 @@ import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.domain.RestResponse;
import org.apache.streampark.console.base.exception.InternalException;
import org.apache.streampark.console.core.annotation.Permission;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.Savepoint;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkSavepoint;
import org.apache.streampark.console.core.service.SavepointService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -45,24 +45,24 @@ import javax.annotation.Nullable;
public class SavepointController {
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
private SavepointService savepointService;
@PostMapping("history")
@Permission(app = "#sp.appId", team = "#sp.teamId")
- public RestResponse history(Savepoint sp, RestRequest request) {
- IPage<Savepoint> page = savepointService.getPage(sp, request);
+ public RestResponse history(FlinkSavepoint sp, RestRequest request) {
+ IPage<FlinkSavepoint> page = savepointService.getPage(sp, request);
return RestResponse.success(page);
}
@PostMapping("delete")
@RequiresPermissions("savepoint:delete")
@Permission(app = "#sp.appId", team = "#sp.teamId")
- public RestResponse delete(Savepoint sp) throws InternalException {
- Savepoint savepoint = savepointService.getById(sp.getId());
- Application application = applicationManageService.getById(savepoint.getAppId());
+ public RestResponse delete(FlinkSavepoint sp) throws InternalException {
+ FlinkSavepoint savepoint = savepointService.getById(sp.getId());
+ FlinkApplication application = applicationManageService.getById(savepoint.getAppId());
Boolean deleted = savepointService.remove(sp.getId(), application);
return RestResponse.success(deleted);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SparkApplicationController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SparkApplicationController.java
index 2e7c92826..bc3043699 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SparkApplicationController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SparkApplicationController.java
@@ -23,11 +23,11 @@ import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.domain.RestResponse;
import org.apache.streampark.console.base.exception.InternalException;
import org.apache.streampark.console.core.annotation.AppChangeEvent;
-import org.apache.streampark.console.core.entity.ApplicationBackUp;
+import org.apache.streampark.console.core.entity.FlinkApplicationBackUp;
import org.apache.streampark.console.core.entity.SparkApplication;
import org.apache.streampark.console.core.entity.SparkApplicationLog;
import org.apache.streampark.console.core.enums.AppExistsStateEnum;
-import org.apache.streampark.console.core.service.ApplicationBackUpService;
+import org.apache.streampark.console.core.service.FlinkApplicationBackUpService;
import org.apache.streampark.console.core.service.ResourceService;
import org.apache.streampark.console.core.service.SparkApplicationLogService;
import org.apache.streampark.console.core.service.application.SparkApplicationActionService;
@@ -66,7 +66,7 @@ public class SparkApplicationController {
private SparkApplicationInfoService applicationInfoService;
@Autowired
- private ApplicationBackUpService backUpService;
+ private FlinkApplicationBackUpService backUpService;
@Autowired
private SparkApplicationLogService applicationLogService;
@@ -196,8 +196,8 @@ public class SparkApplicationController {
}
@PostMapping("backups")
- public RestResponse backups(ApplicationBackUp backUp, RestRequest request) {
- IPage<ApplicationBackUp> backups = backUpService.getPage(backUp, request);
+ public RestResponse backups(FlinkApplicationBackUp backUp, RestRequest request) {
+ IPage<FlinkApplicationBackUp> backups = backUpService.getPage(backUp, request);
return RestResponse.success(backups);
}
@@ -222,7 +222,7 @@ public class SparkApplicationController {
}
@PostMapping("delete/bak")
- public RestResponse deleteBak(ApplicationBackUp backUp) throws InternalException {
+ public RestResponse deleteBak(FlinkApplicationBackUp backUp) throws InternalException {
Boolean deleted = backUpService.removeById(backUp.getId());
return RestResponse.success(deleted);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SparkSqlController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SparkSqlController.java
index 961d1b0ae..cd93c1cd7 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SparkSqlController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SparkSqlController.java
@@ -22,7 +22,7 @@ import org.apache.streampark.console.base.domain.RestResponse;
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.exception.InternalException;
import org.apache.streampark.console.core.annotation.Permission;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.SparkSql;
import org.apache.streampark.console.core.service.SparkSqlService;
import org.apache.streampark.console.core.service.SqlCompleteService;
@@ -119,7 +119,7 @@ public class SparkSqlController {
@PostMapping("history")
@Permission(app = "#app.id", team = "#app.teamId")
- public RestResponse history(Application app) {
+ public RestResponse history(FlinkApplication app) {
List<SparkSql> sqlList = sparkSqlService.listSparkSqlHistory(app.getId());
return RestResponse.success(sqlList);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SqlWorkBenchController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SqlWorkBenchController.java
deleted file mode 100644
index 30bb212a7..000000000
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SqlWorkBenchController.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.streampark.console.core.controller;
-
-import org.apache.streampark.console.base.domain.RestResponse;
-import org.apache.streampark.console.core.service.SqlWorkBenchService;
-import org.apache.streampark.gateway.results.ResultQueryCondition;
-import org.apache.streampark.gateway.session.SessionHandle;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-@Slf4j
-@Validated
-@RestController
-@RequestMapping("flink/sqlWorkBench/{flinkGatewayId}")
-public class SqlWorkBenchController {
-
- private final SqlWorkBenchService sqlWorkBenchService;
-
- public SqlWorkBenchController(SqlWorkBenchService sqlWorkBenchService) {
- this.sqlWorkBenchService = sqlWorkBenchService;
- }
-
- // -------------------------------------------------------------------------------------------
- // Validation API
- // -------------------------------------------------------------------------------------------
- public RestResponse check(@PathVariable Long flinkGatewayId, @PathVariable Long flinkClusterId) {
- return RestResponse.success(sqlWorkBenchService.check(flinkGatewayId, flinkClusterId));
- }
-
- // -------------------------------------------------------------------------------------------
- // Info API
- // -------------------------------------------------------------------------------------------
-
- @GetMapping("getGatewayInfo")
- public RestResponse getGatewayInfo(@PathVariable Long flinkGatewayId) {
- return RestResponse.success(sqlWorkBenchService.getGatewayInfo(flinkGatewayId));
- }
-
- // -------------------------------------------------------------------------------------------
- // Session Management
- // -------------------------------------------------------------------------------------------
-
- @PostMapping("/{flinkClusterId}/sessions")
- public RestResponse openSession(
- @PathVariable Long flinkGatewayId, @PathVariable Long flinkClusterId) {
- SessionHandle sessionHandle = sqlWorkBenchService.openSession(flinkGatewayId, flinkClusterId);
- return RestResponse.success(sessionHandle);
- }
-
- @PostMapping("sessions/{sessionHandle}/heartbeat")
- public RestResponse heartbeat(
- @PathVariable Long flinkGatewayId, @PathVariable String sessionHandle) {
- sqlWorkBenchService.heartbeat(flinkGatewayId, sessionHandle);
- return RestResponse.success();
- }
-
- @DeleteMapping("sessions/{sessionHandle}")
- public RestResponse closeSession(
- @PathVariable Long flinkGatewayId, @PathVariable String sessionHandle) {
- sqlWorkBenchService.closeSession(flinkGatewayId, sessionHandle);
- return RestResponse.success();
- }
-
- // -------------------------------------------------------------------------------------------
- // Operation Management
- // -------------------------------------------------------------------------------------------
-
- @PostMapping("sessions/{sessionHandle}/operations/{operationHandle}/cancel")
- public RestResponse cancelOperation(
- @PathVariable Long flinkGatewayId,
- @PathVariable String sessionHandle,
- @PathVariable String operationHandle) {
- sqlWorkBenchService.cancelOperation(flinkGatewayId, sessionHandle, operationHandle);
- return RestResponse.success();
- }
-
- @DeleteMapping("sessions/{sessionHandle}/operations/{operationHandle}/close")
- public RestResponse closeOperation(
- @PathVariable Long flinkGatewayId,
- @PathVariable String sessionHandle,
- @PathVariable String operationHandle) {
- sqlWorkBenchService.closeOperation(flinkGatewayId, sessionHandle, operationHandle);
- return RestResponse.success();
- }
-
- @PostMapping("sessions/{sessionHandle}/operations/{operationHandle}/info")
- public RestResponse getOperationInfo(
- @PathVariable Long flinkGatewayId,
- @PathVariable String sessionHandle,
- @PathVariable String operationHandle) {
- return RestResponse.success(
- sqlWorkBenchService.getOperationInfo(flinkGatewayId, sessionHandle, operationHandle));
- }
-
- @PostMapping("sessions/{sessionHandle}/operations/{operationHandle}/resultSchema")
- public RestResponse getOperationResultSchema(
- @PathVariable Long flinkGatewayId,
- @PathVariable String sessionHandle,
- @PathVariable String operationHandle) {
- return RestResponse.success(
- sqlWorkBenchService.getOperationResultSchema(
- flinkGatewayId, sessionHandle, operationHandle));
- }
-
- // -------------------------------------------------------------------------------------------
- // Statements API
- // -------------------------------------------------------------------------------------------
-
- @PostMapping("sessions/{sessionHandle}/statements")
- public RestResponse executeStatement(
- @PathVariable Long flinkGatewayId,
- @PathVariable String sessionHandle,
- @RequestParam String statement) {
- return RestResponse.success(
- sqlWorkBenchService.executeStatement(flinkGatewayId, sessionHandle, statement));
- }
-
- @PostMapping("sessions/{sessionHandle}/statements/{operationHandle}/info")
- public RestResponse fetchResults(
- @PathVariable Long flinkGatewayId,
- @PathVariable String sessionHandle,
- @PathVariable String operationHandle,
- @RequestBody ResultQueryCondition resultQueryCondition) {
- return RestResponse.success(
- sqlWorkBenchService.fetchResults(
- flinkGatewayId, sessionHandle, operationHandle, resultQueryCondition));
- }
-
- // -------------------------------------------------------------------------------------------
- // Catalog API
- // -------------------------------------------------------------------------------------------
- // TODO: 2023/5/5 because of catalog with fixed statement, so frontend can use above methods to
- // get catalog info
-
-}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java
index 30718cb59..1abb889fe 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java
@@ -19,7 +19,7 @@ package org.apache.streampark.console.core.controller;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.domain.RestResponse;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.Variable;
import org.apache.streampark.console.core.service.VariableService;
@@ -86,7 +86,7 @@ public class VariableController {
@PostMapping("depend_apps")
@RequiresPermissions("variable:depend_apps")
public RestResponse dependApps(RestRequest restRequest, Variable variable) {
- IPage<Application> dependApps = variableService.getDependAppsPage(variable, restRequest);
+ IPage<FlinkApplication> dependApps = variableService.getDependAppsPage(variable, restRequest);
return RestResponse.success(dependApps);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Application.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkApplication.java
similarity index 82%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Application.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkApplication.java
index 5685f933e..12f40f408 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Application.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkApplication.java
@@ -21,8 +21,8 @@ import org.apache.streampark.common.conf.ConfigKeys;
import org.apache.streampark.common.conf.Workspace;
import org.apache.streampark.common.constants.Constants;
import org.apache.streampark.common.enums.ApplicationType;
-import org.apache.streampark.common.enums.FlinkDevelopmentMode;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
+import org.apache.streampark.common.enums.FlinkJobType;
import org.apache.streampark.common.enums.FlinkK8sRestExposedType;
import org.apache.streampark.common.enums.StorageType;
import org.apache.streampark.common.fs.FsOperator;
@@ -64,7 +64,7 @@ import java.util.Optional;
@Data
@TableName("t_flink_app")
@Slf4j
-public class Application implements Serializable {
+public class FlinkApplication implements Serializable {
@TableId(type = IdType.AUTO)
private Long id;
@@ -147,7 +147,8 @@ public class Application implements Serializable {
private String hotParams;
private Integer resolveOrder;
- private Integer executionMode;
+
+ private Integer deployMode;
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String dynamicProperties;
@@ -275,8 +276,8 @@ public class Application implements Serializable {
}
public void setYarnQueueByHotParams() {
- if (!(FlinkExecutionMode.YARN_APPLICATION == this.getFlinkExecutionMode()
- || FlinkExecutionMode.YARN_PER_JOB == this.getFlinkExecutionMode())) {
+ if (!(FlinkDeployMode.YARN_APPLICATION == this.getFlinkDeployMode()
+ || FlinkDeployMode.YARN_PER_JOB == this.getFlinkDeployMode())) {
return;
}
@@ -340,8 +341,8 @@ public class Application implements Serializable {
}
@JsonIgnore
- public FlinkDevelopmentMode getDevelopmentMode() {
- return FlinkDevelopmentMode.of(jobType);
+ public FlinkJobType getDevelopmentMode() {
+ return FlinkJobType.of(jobType);
}
@JsonIgnore
@@ -355,8 +356,8 @@ public class Application implements Serializable {
}
@JsonIgnore
- public FlinkExecutionMode getFlinkExecutionMode() {
- return FlinkExecutionMode.of(executionMode);
+ public FlinkDeployMode getFlinkDeployMode() {
+ return FlinkDeployMode.of(deployMode);
}
public boolean cpFailedTrigger() {
@@ -365,7 +366,7 @@ public class Application implements Serializable {
&& this.cpFailureAction != null;
}
- public boolean eqFlinkJob(Application other) {
+ public boolean eqFlinkJob(FlinkApplication other) {
if (this.isFlinkSqlJob()
&& other.isFlinkSqlJob()
&& this.getFlinkSql().trim().equals(other.getFlinkSql().trim())) {
@@ -396,10 +397,10 @@ public class Application implements Serializable {
return path;
}
- /** Automatically identify remoteAppHome or localAppHome based on app FlinkExecutionMode */
+ /** Automatically identify remoteAppHome or localAppHome based on app FlinkDeployMode */
@JsonIgnore
public String getAppHome() {
- switch (this.getFlinkExecutionMode()) {
+ switch (this.getFlinkDeployMode()) {
case KUBERNETES_NATIVE_APPLICATION:
case KUBERNETES_NATIVE_SESSION:
case YARN_PER_JOB:
@@ -411,7 +412,7 @@ public class Application implements Serializable {
return getRemoteAppHome();
default:
throw new UnsupportedOperationException(
- "unsupported executionMode ".concat(getFlinkExecutionMode().getName()));
+ "unsupported deployMode ".concat(getFlinkDeployMode().getName()));
}
}
@@ -439,24 +440,24 @@ public class Application implements Serializable {
@JsonIgnore
public boolean isFlinkSqlJob() {
- return FlinkDevelopmentMode.FLINK_SQL.getMode().equals(this.getJobType());
+ return FlinkJobType.FLINK_SQL.getMode().equals(this.getJobType());
}
@JsonIgnore
public boolean isFlinkSqlJobOrPyFlinkJob() {
- return FlinkDevelopmentMode.FLINK_SQL.getMode().equals(this.getJobType())
- || FlinkDevelopmentMode.PYFLINK.getMode().equals(this.getJobType());
+ return FlinkJobType.FLINK_SQL.getMode().equals(this.getJobType())
+ || FlinkJobType.PYFLINK.getMode().equals(this.getJobType());
}
@JsonIgnore
public boolean isCustomCodeJob() {
- return FlinkDevelopmentMode.CUSTOM_CODE.getMode().equals(this.getJobType());
+ return FlinkJobType.CUSTOM_CODE.getMode().equals(this.getJobType());
}
@JsonIgnore
public boolean isCustomCodeOrPyFlinkJob() {
- return FlinkDevelopmentMode.CUSTOM_CODE.getMode().equals(this.getJobType())
- || FlinkDevelopmentMode.PYFLINK.getMode().equals(this.getJobType());
+ return FlinkJobType.CUSTOM_CODE.getMode().equals(this.getJobType())
+ || FlinkJobType.PYFLINK.getMode().equals(this.getJobType());
}
@JsonIgnore
@@ -506,12 +507,12 @@ public class Application implements Serializable {
@JsonIgnore
public StorageType getStorageType() {
- return getStorageType(getExecutionMode());
+ return getStorageType(getDeployMode());
}
- public static StorageType getStorageType(Integer execMode) {
- FlinkExecutionMode executionModeEnum = FlinkExecutionMode.of(execMode);
- switch (Objects.requireNonNull(executionModeEnum)) {
+ public static StorageType getStorageType(Integer deployMode) {
+ FlinkDeployMode deployModeEnum = FlinkDeployMode.of(deployMode);
+ switch (Objects.requireNonNull(deployModeEnum)) {
case YARN_APPLICATION:
return StorageType.HDFS;
case YARN_PER_JOB:
@@ -521,7 +522,7 @@ public class Application implements Serializable {
case REMOTE:
return StorageType.LFS;
default:
- throw new UnsupportedOperationException("Unsupported ".concat(executionModeEnum.getName()));
+ throw new UnsupportedOperationException("Unsupported ".concat(deployModeEnum.getName()));
}
}
@@ -553,16 +554,16 @@ public class Application implements Serializable {
}
@SneakyThrows
- public void updateHotParams(Application appParam) {
+ public void updateHotParams(FlinkApplication appParam) {
if (appParam != this) {
this.hotParams = null;
}
- FlinkExecutionMode executionModeEnum = appParam.getFlinkExecutionMode();
+ FlinkDeployMode deployModeEnum = appParam.getFlinkDeployMode();
Map<String, String> hotParams = new HashMap<>(0);
- if (needFillYarnQueueLabel(executionModeEnum)) {
+ if (needFillYarnQueueLabel(deployModeEnum)) {
hotParams.putAll(YarnQueueLabelExpression.getQueueLabelMap(appParam.getYarnQueue()));
}
- if (executionModeEnum == FlinkExecutionMode.KUBERNETES_NATIVE_APPLICATION) {
+ if (deployModeEnum == FlinkDeployMode.KUBERNETES_NATIVE_APPLICATION) {
if (StringUtils.isNotBlank(appParam.getServiceAccount())) {
hotParams.put(ConfigKeys.KEY_KERBEROS_SERVICE_ACCOUNT(), appParam.getServiceAccount());
}
@@ -572,8 +573,8 @@ public class Application implements Serializable {
}
}
- private boolean needFillYarnQueueLabel(FlinkExecutionMode mode) {
- return FlinkExecutionMode.YARN_PER_JOB == mode || FlinkExecutionMode.YARN_APPLICATION == mode;
+ private boolean needFillYarnQueueLabel(FlinkDeployMode mode) {
+ return FlinkDeployMode.YARN_PER_JOB == mode || FlinkDeployMode.YARN_APPLICATION == mode;
}
@Override
@@ -584,7 +585,7 @@ public class Application implements Serializable {
if (o == null || getClass() != o.getClass()) {
return false;
}
- return id.equals(((Application) o).id);
+ return id.equals(((FlinkApplication) o).id);
}
@Override
@@ -593,26 +594,26 @@ public class Application implements Serializable {
}
public boolean isKubernetesModeJob() {
- return FlinkExecutionMode.isKubernetesMode(this.getFlinkExecutionMode());
+ return FlinkDeployMode.isKubernetesMode(this.getFlinkDeployMode());
}
public static class SFunc {
- public static final SFunction<Application, Long> ID = Application::getId;
- public static final SFunction<Application, String> JOB_ID = Application::getJobId;
- public static final SFunction<Application, Date> START_TIME = Application::getStartTime;
- public static final SFunction<Application, Date> END_TIME = Application::getEndTime;
- public static final SFunction<Application, Long> DURATION = Application::getDuration;
- public static final SFunction<Application, Integer> TOTAL_TASK = Application::getTotalTask;
- public static final SFunction<Application, Integer> TOTAL_TM = Application::getTotalTM;
- public static final SFunction<Application, Integer> TOTAL_SLOT = Application::getTotalSlot;
- public static final SFunction<Application, Integer> JM_MEMORY = Application::getJmMemory;
- public static final SFunction<Application, Integer> TM_MEMORY = Application::getTmMemory;
- public static final SFunction<Application, Integer> STATE = Application::getState;
- public static final SFunction<Application, String> OPTIONS = Application::getOptions;
- public static final SFunction<Application, Integer> AVAILABLE_SLOT = Application::getAvailableSlot;
- public static final SFunction<Application, Integer> EXECUTION_MODE = Application::getExecutionMode;
- public static final SFunction<Application, String> JOB_MANAGER_URL = Application::getJobManagerUrl;
+ public static final SFunction<FlinkApplication, Long> ID = FlinkApplication::getId;
+ public static final SFunction<FlinkApplication, String> JOB_ID = FlinkApplication::getJobId;
+ public static final SFunction<FlinkApplication, Date> START_TIME = FlinkApplication::getStartTime;
+ public static final SFunction<FlinkApplication, Date> END_TIME = FlinkApplication::getEndTime;
+ public static final SFunction<FlinkApplication, Long> DURATION = FlinkApplication::getDuration;
+ public static final SFunction<FlinkApplication, Integer> TOTAL_TASK = FlinkApplication::getTotalTask;
+ public static final SFunction<FlinkApplication, Integer> TOTAL_TM = FlinkApplication::getTotalTM;
+ public static final SFunction<FlinkApplication, Integer> TOTAL_SLOT = FlinkApplication::getTotalSlot;
+ public static final SFunction<FlinkApplication, Integer> JM_MEMORY = FlinkApplication::getJmMemory;
+ public static final SFunction<FlinkApplication, Integer> TM_MEMORY = FlinkApplication::getTmMemory;
+ public static final SFunction<FlinkApplication, Integer> STATE = FlinkApplication::getState;
+ public static final SFunction<FlinkApplication, String> OPTIONS = FlinkApplication::getOptions;
+ public static final SFunction<FlinkApplication, Integer> AVAILABLE_SLOT = FlinkApplication::getAvailableSlot;
+ public static final SFunction<FlinkApplication, Integer> EXECUTION_MODE = FlinkApplication::getDeployMode;
+ public static final SFunction<FlinkApplication, String> JOB_MANAGER_URL = FlinkApplication::getJobManagerUrl;
}
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationBackUp.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkApplicationBackUp.java
similarity index 86%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationBackUp.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkApplicationBackUp.java
index 6d6a45b75..20712df0a 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationBackUp.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkApplicationBackUp.java
@@ -28,9 +28,9 @@ import lombok.extern.slf4j.Slf4j;
import java.util.Date;
@Data
-@TableName("t_app_backup")
+@TableName("t_flink_app_backup")
@Slf4j
-public class ApplicationBackUp {
+public class FlinkApplicationBackUp {
@TableId(type = IdType.AUTO)
private Long id;
@@ -49,10 +49,10 @@ public class ApplicationBackUp {
private transient String teamId;
- public ApplicationBackUp() {
+ public FlinkApplicationBackUp() {
}
- public ApplicationBackUp(Application application) {
+ public FlinkApplicationBackUp(FlinkApplication application) {
this.appId = application.getId();
this.sqlId = application.getSqlId();
this.configId = application.getConfigId();
@@ -61,8 +61,8 @@ public class ApplicationBackUp {
renderPath(application);
}
- private void renderPath(Application application) {
- switch (application.getFlinkExecutionMode()) {
+ private void renderPath(FlinkApplication application) {
+ switch (application.getFlinkDeployMode()) {
case KUBERNETES_NATIVE_APPLICATION:
case KUBERNETES_NATIVE_SESSION:
case YARN_PER_JOB:
@@ -80,7 +80,7 @@ public class ApplicationBackUp {
break;
default:
throw new UnsupportedOperationException(
- "unsupported executionMode ".concat(application.getFlinkExecutionMode().getName()));
+ "unsupported deployMode ".concat(application.getFlinkDeployMode().getName()));
}
}
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationConfig.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkApplicationConfig.java
similarity index 97%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationConfig.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkApplicationConfig.java
index 9f4d47d6e..9b8f58251 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/ApplicationConfig.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkApplicationConfig.java
@@ -31,7 +31,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
-import org.jetbrains.annotations.Nullable;
+
+import javax.annotation.Nullable;
import java.util.Base64;
import java.util.Date;
@@ -42,7 +43,7 @@ import java.util.stream.Collectors;
@Data
@TableName("t_flink_config")
@Slf4j
-public class ApplicationConfig {
+public class FlinkApplicationConfig {
@TableId(type = IdType.AUTO)
private Long id;
@@ -69,7 +70,7 @@ public class ApplicationConfig {
private transient boolean effective = false;
- public void setToApplication(Application application) {
+ public void setToApplication(FlinkApplication application) {
String unzipString = DeflaterUtils.unzipString(content);
String encode = Base64.getEncoder().encodeToString(unzipString.getBytes());
application.setConfig(encode);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java
index 6858a80c8..21c3428c1 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java
@@ -19,7 +19,7 @@ package org.apache.streampark.console.core.entity;
import org.apache.streampark.common.conf.ConfigKeys;
import org.apache.streampark.common.enums.ClusterState;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.common.enums.FlinkK8sRestExposedType;
import org.apache.streampark.common.enums.ResolveOrder;
import org.apache.streampark.common.util.HttpClientUtils;
@@ -69,7 +69,7 @@ public class FlinkCluster implements Serializable {
private String clusterName;
- private Integer executionMode;
+ private Integer deployMode;
/** flink version */
private Long versionId;
@@ -123,8 +123,8 @@ public class FlinkCluster implements Serializable {
}
@JsonIgnore
- public FlinkExecutionMode getFlinkExecutionModeEnum() {
- return FlinkExecutionMode.of(this.executionMode);
+ public FlinkDeployMode getFlinkDeployModeEnum() {
+ return FlinkDeployMode.of(this.deployMode);
}
@JsonIgnore
@@ -139,7 +139,7 @@ public class FlinkCluster implements Serializable {
return new HashMap<>();
}
Map<String, Object> optionMap = JacksonUtils.read(this.options, Map.class);
- if (FlinkExecutionMode.YARN_SESSION == getFlinkExecutionModeEnum()) {
+ if (FlinkDeployMode.YARN_SESSION == getFlinkDeployModeEnum()) {
optionMap.put(ConfigKeys.KEY_YARN_APP_NAME(), this.clusterName);
optionMap.putAll(YarnQueueLabelExpression.getQueueLabelMap(yarnQueue));
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkGateWay.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkGateWay.java
deleted file mode 100644
index 1085d2f4b..000000000
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkGateWay.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.streampark.console.core.entity;
-
-import org.apache.streampark.console.base.mybatis.entity.BaseEntity;
-import org.apache.streampark.console.core.enums.GatewayTypeEnum;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import javax.validation.constraints.NotBlank;
-
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("t_flink_gateway")
-public class FlinkGateWay extends BaseEntity {
-
- @TableId(type = IdType.AUTO)
- private Long id;
-
- @NotBlank(message = "{required}")
- private String gatewayName;
-
- private String description;
-
- private GatewayTypeEnum gatewayType;
-
- @NotBlank(message = "{required}")
- private String address;
-
-}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Savepoint.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSavepoint.java
similarity index 98%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Savepoint.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSavepoint.java
index 1f12b8734..fef55eea0 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Savepoint.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSavepoint.java
@@ -28,7 +28,7 @@ import java.util.Date;
@Data
@TableName("t_flink_savepoint")
@Slf4j
-public class Savepoint {
+public class FlinkSavepoint {
@TableId(type = IdType.AUTO)
private Long id;
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSql.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSql.java
index 74dadb326..c01e0e97a 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSql.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSql.java
@@ -66,7 +66,7 @@ public class FlinkSql {
public FlinkSql() {
}
- public FlinkSql(Application application) {
+ public FlinkSql(FlinkApplication application) {
this.appId = application.getId();
this.sql = application.getFlinkSql();
this.teamResource = application.getTeamResource();
@@ -86,7 +86,7 @@ public class FlinkSql {
this.setSql(DeflaterUtils.unzipString(this.sql));
}
- public void setToApplication(Application application) {
+ public void setToApplication(FlinkApplication application) {
String encode = Base64.getEncoder().encodeToString(this.sql.getBytes());
application.setFlinkSql(encode);
application.setDependency(this.dependency);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplication.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplication.java
index 4789b9195..8cc8abccf 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplication.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplication.java
@@ -21,8 +21,8 @@ import org.apache.streampark.common.conf.ConfigKeys;
import org.apache.streampark.common.conf.Workspace;
import org.apache.streampark.common.constants.Constants;
import org.apache.streampark.common.enums.ApplicationType;
-import org.apache.streampark.common.enums.SparkDevelopmentMode;
-import org.apache.streampark.common.enums.SparkExecutionMode;
+import org.apache.streampark.common.enums.SparkDeployMode;
+import org.apache.streampark.common.enums.SparkJobType;
import org.apache.streampark.common.enums.StorageType;
import org.apache.streampark.common.fs.FsOperator;
import org.apache.streampark.console.base.mybatis.entity.BaseEntity;
@@ -76,7 +76,7 @@ public class SparkApplication extends BaseEntity {
/** spark.app.name */
private String appName;
- private Integer executionMode;
+ private Integer deployMode;
/** 1: cicd (build from csv) 2: upload (upload local jar job) */
private Integer resourceFrom;
@@ -233,8 +233,8 @@ public class SparkApplication extends BaseEntity {
}
public void resolveYarnQueue() {
- if (!(SparkExecutionMode.YARN_CLIENT == this.getSparkExecutionMode()
- || SparkExecutionMode.YARN_CLUSTER == this.getSparkExecutionMode())) {
+ if (!(SparkDeployMode.YARN_CLIENT == this.getSparkDeployMode()
+ || SparkDeployMode.YARN_CLUSTER == this.getSparkDeployMode())) {
return;
}
if (StringUtils.isBlank(this.yarnQueue)) {
@@ -312,8 +312,8 @@ public class SparkApplication extends BaseEntity {
}
@JsonIgnore
- public SparkDevelopmentMode getDevelopmentMode() {
- return SparkDevelopmentMode.valueOf(jobType);
+ public SparkJobType getDevelopmentMode() {
+ return SparkJobType.valueOf(jobType);
}
@JsonIgnore
@@ -322,8 +322,8 @@ public class SparkApplication extends BaseEntity {
}
@JsonIgnore
- public SparkExecutionMode getSparkExecutionMode() {
- return SparkExecutionMode.of(executionMode);
+ public SparkDeployMode getSparkDeployMode() {
+ return SparkDeployMode.of(deployMode);
}
/** Local compilation and packaging working directory */
@@ -348,10 +348,10 @@ public class SparkApplication extends BaseEntity {
return path;
}
- /** Automatically identify remoteAppHome or localAppHome based on app SparkExecutionMode */
+ /** Automatically identify remoteAppHome or localAppHome based on app SparkDeployMode */
@JsonIgnore
public String getAppHome() {
- switch (this.getSparkExecutionMode()) {
+ switch (this.getSparkDeployMode()) {
case REMOTE:
case LOCAL:
return getLocalAppHome();
@@ -360,7 +360,7 @@ public class SparkApplication extends BaseEntity {
return getRemoteAppHome();
default:
throw new UnsupportedOperationException(
- "unsupported executionMode ".concat(getSparkExecutionMode().getName()));
+ "unsupported deployMode ".concat(getSparkDeployMode().getName()));
}
}
@@ -388,24 +388,24 @@ public class SparkApplication extends BaseEntity {
@JsonIgnore
public boolean isSparkOnYarnJob() {
- return SparkExecutionMode.YARN_CLUSTER.getMode() == (this.getExecutionMode())
- || SparkExecutionMode.YARN_CLIENT.getMode() == (this.getExecutionMode());
+ return SparkDeployMode.YARN_CLUSTER.getMode() == (this.getDeployMode())
+ || SparkDeployMode.YARN_CLIENT.getMode() == (this.getDeployMode());
}
@JsonIgnore
public boolean isSparkSqlJob() {
- return SparkDevelopmentMode.SPARK_SQL.getMode().equals(this.getJobType());
+ return SparkJobType.SPARK_SQL.getMode().equals(this.getJobType());
}
@JsonIgnore
public boolean isSparkJarJob() {
- return SparkDevelopmentMode.SPARK_JAR.getMode().equals(this.getJobType());
+ return SparkJobType.SPARK_JAR.getMode().equals(this.getJobType());
}
@JsonIgnore
public boolean isSparkJarOrPySparkJob() {
- return SparkDevelopmentMode.SPARK_JAR.getMode().equals(this.getJobType())
- || SparkDevelopmentMode.PYSPARK.getMode().equals(this.getJobType());
+ return SparkJobType.SPARK_JAR.getMode().equals(this.getJobType())
+ || SparkJobType.PYSPARK.getMode().equals(this.getJobType());
}
@JsonIgnore
@@ -455,19 +455,19 @@ public class SparkApplication extends BaseEntity {
@JsonIgnore
public StorageType getStorageType() {
- return getStorageType(getExecutionMode());
+ return getStorageType(getDeployMode());
}
- public static StorageType getStorageType(Integer execMode) {
- SparkExecutionMode executionModeEnum = SparkExecutionMode.of(execMode);
- switch (Objects.requireNonNull(executionModeEnum)) {
+ public static StorageType getStorageType(Integer deployMode) {
+ SparkDeployMode deployModeEnum = SparkDeployMode.of(deployMode);
+ switch (Objects.requireNonNull(deployModeEnum)) {
case YARN_CLUSTER:
case YARN_CLIENT:
return StorageType.HDFS;
case REMOTE:
return StorageType.LFS;
default:
- throw new UnsupportedOperationException("Unsupported ".concat(executionModeEnum.getName()));
+ throw new UnsupportedOperationException("Unsupported ".concat(deployModeEnum.getName()));
}
}
@@ -515,6 +515,6 @@ public class SparkApplication extends BaseEntity {
public static final SFunction<SparkApplication, Long> DURATION = SparkApplication::getDuration;
public static final SFunction<SparkApplication, Integer> STATE = SparkApplication::getState;
public static final SFunction<SparkApplication, String> OPTIONS = SparkApplication::getOptions;
- public static final SFunction<SparkApplication, Integer> EXECUTION_MODE = SparkApplication::getExecutionMode;
+ public static final SFunction<SparkApplication, Integer> EXECUTION_MODE = SparkApplication::getDeployMode;
}
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplicationBackUp.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplicationBackUp.java
index e404e8e71..bc51ce079 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplicationBackUp.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplicationBackUp.java
@@ -64,7 +64,7 @@ public class SparkApplicationBackUp {
}
private void renderPath(SparkApplication application) {
- switch (application.getSparkExecutionMode()) {
+ switch (application.getSparkDeployMode()) {
case LOCAL:
this.path = String.format(
"%s/%d/%d",
@@ -78,7 +78,7 @@ public class SparkApplicationBackUp {
break;
default:
throw new UnsupportedOperationException(
- "unsupported executionMode ".concat(application.getSparkExecutionMode().getName()));
+ "unsupported deployMode ".concat(application.getSparkDeployMode().getName()));
}
}
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplicationConfig.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplicationConfig.java
index dda55bd54..3bb622825 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplicationConfig.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/SparkApplicationConfig.java
@@ -28,7 +28,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
-import org.jetbrains.annotations.Nullable;
+
+import javax.annotation.Nullable;
import java.util.Base64;
import java.util.Date;
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationBackUpMapper.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkApplicationBackUpMapper.java
similarity index 84%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationBackUpMapper.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkApplicationBackUpMapper.java
index 7ee6e7f7c..208f82eb6 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationBackUpMapper.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkApplicationBackUpMapper.java
@@ -17,9 +17,9 @@
package org.apache.streampark.console.core.mapper;
-import org.apache.streampark.console.core.entity.ApplicationBackUp;
+import org.apache.streampark.console.core.entity.FlinkApplicationBackUp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-public interface ApplicationBackUpMapper extends BaseMapper<ApplicationBackUp> {
+public interface FlinkApplicationBackUpMapper extends BaseMapper<FlinkApplicationBackUp> {
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationConfigMapper.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkApplicationConfigMapper.java
similarity index 70%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationConfigMapper.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkApplicationConfigMapper.java
index 235a8bd91..47357c824 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationConfigMapper.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkApplicationConfigMapper.java
@@ -17,7 +17,7 @@
package org.apache.streampark.console.core.mapper;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
import org.apache.ibatis.annotations.Param;
@@ -25,14 +25,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-public interface ApplicationConfigMapper extends BaseMapper<ApplicationConfig> {
+public interface FlinkApplicationConfigMapper extends BaseMapper<FlinkApplicationConfig> {
Integer selectLastVersion(@Param("appId") Long appId);
- ApplicationConfig selectEffective(@Param("appId") Long appId);
+ FlinkApplicationConfig selectEffective(@Param("appId") Long appId);
- ApplicationConfig selectLatest(@Param("appId") Long appId);
+ FlinkApplicationConfig selectLatest(@Param("appId") Long appId);
- IPage<ApplicationConfig> selectPageByAppId(
- Page<ApplicationConfig> page, @Param("appId") Long appId);
+ IPage<FlinkApplicationConfig> selectPageByAppId(
+ Page<FlinkApplicationConfig> page, @Param("appId") Long appId);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationMapper.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkApplicationMapper.java
similarity index 73%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationMapper.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkApplicationMapper.java
index c90b34961..ad3698dc5 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationMapper.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkApplicationMapper.java
@@ -17,7 +17,7 @@
package org.apache.streampark.console.core.mapper;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.ibatis.annotations.Param;
@@ -27,22 +27,22 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
-public interface ApplicationMapper extends BaseMapper<Application> {
+public interface FlinkApplicationMapper extends BaseMapper<FlinkApplication> {
- IPage<Application> selectPage(Page<Application> page, @Param("app") Application application);
+ IPage<FlinkApplication> selectPage(Page<FlinkApplication> page, @Param("app") FlinkApplication application);
- Application selectApp(@Param("id") Long id);
+ FlinkApplication selectApp(@Param("id") Long id);
- void persistMetrics(@Param("app") Application application);
+ void persistMetrics(@Param("app") FlinkApplication application);
- List<Application> selectAppsByTeamId(@Param("teamId") Long teamId);
+ List<FlinkApplication> selectAppsByTeamId(@Param("teamId") Long teamId);
- boolean mapping(@Param("app") Application appParam);
+ boolean mapping(@Param("app") FlinkApplication appParam);
List<String> selectRecentK8sNamespaces(@Param("limitSize") Integer limit);
List<String> selectRecentK8sClusterIds(
- @Param("executionMode") Integer executionMode,
+ @Param("deployMode") Integer deployMode,
@Param("limitSize") Integer limit);
List<String> selectRecentFlinkBaseImages(@Param("limitSize") Integer limit);
@@ -55,7 +55,7 @@ public interface ApplicationMapper extends BaseMapper<Application> {
void resetOptionState();
- List<Application> selectAppsByProjectId(@Param("projectId") Long id);
+ List<FlinkApplication> selectAppsByProjectId(@Param("projectId") Long id);
boolean existsRunningJobByClusterId(@Param("clusterId") Long clusterId);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/CatalogMapper.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkCatalogMapper.java
similarity index 94%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/CatalogMapper.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkCatalogMapper.java
index 7053bee5b..4f5d86092 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/CatalogMapper.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkCatalogMapper.java
@@ -26,7 +26,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/** catalog mapper */
-public interface CatalogMapper extends BaseMapper<FlinkCatalog> {
+public interface FlinkCatalogMapper extends BaseMapper<FlinkCatalog> {
boolean existsByCatalogName(@Param("catalogName") String catalogName);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkGateWayMapper.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkGateWayMapper.java
deleted file mode 100644
index 5c813c310..000000000
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkGateWayMapper.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.streampark.console.core.mapper;
-
-import org.apache.streampark.console.core.entity.FlinkGateWay;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-public interface FlinkGateWayMapper extends BaseMapper<FlinkGateWay> {
-}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/SavepointMapper.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkSavepointMapper.java
similarity index 86%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/SavepointMapper.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkSavepointMapper.java
index 7040ec574..bebc7fa05 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/SavepointMapper.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/FlinkSavepointMapper.java
@@ -17,9 +17,9 @@
package org.apache.streampark.console.core.mapper;
-import org.apache.streampark.console.core.entity.Savepoint;
+import org.apache.streampark.console.core.entity.FlinkSavepoint;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-public interface SavepointMapper extends BaseMapper<Savepoint> {
+public interface FlinkSavepointMapper extends BaseMapper<FlinkSavepoint> {
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/SparkApplicationMapper.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/SparkApplicationMapper.java
index 23dab27d3..b45ad52fd 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/SparkApplicationMapper.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/SparkApplicationMapper.java
@@ -43,7 +43,7 @@ public interface SparkApplicationMapper extends BaseMapper<SparkApplication> {
List<String> selectRecentK8sNamespaces(@Param("limitSize") Integer limit);
List<String> selectRecentK8sClusterIds(
- @Param("executionMode") Integer executionMode,
+ @Param("deployMode") Integer deployMode,
@Param("limitSize") Integer limit);
List<String> selectRecentK8sPodTemplates(@Param("limitSize") Integer limit);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/runner/QuickStartRunner.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/runner/QuickStartRunner.java
index 6396801c9..afd50f1ad 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/runner/QuickStartRunner.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/runner/QuickStartRunner.java
@@ -18,9 +18,9 @@
package org.apache.streampark.console.core.runner;
import org.apache.streampark.common.enums.ClusterState;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.common.util.PropertiesUtils;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.FlinkEnv;
import org.apache.streampark.console.core.entity.FlinkSql;
@@ -28,7 +28,7 @@ import org.apache.streampark.console.core.service.AppBuildPipeService;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.FlinkEnvService;
import org.apache.streampark.console.core.service.FlinkSqlService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -54,7 +54,7 @@ public class QuickStartRunner implements ApplicationRunner {
private FlinkSqlService flinkSqlService;
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
private AppBuildPipeService appBuildPipeService;
@@ -80,17 +80,17 @@ public class QuickStartRunner implements ApplicationRunner {
flinkCluster.setClusterName("quickstart");
flinkCluster.setVersionId(flinkEnv.getId());
flinkCluster.setClusterState(ClusterState.RUNNING.getState());
- flinkCluster.setExecutionMode(FlinkExecutionMode.REMOTE.getMode());
+ flinkCluster.setDeployMode(FlinkDeployMode.REMOTE.getMode());
flinkCluster.setAddress("http://localhost:" + quickstart.get("flink_port"));
flinkClusterService.create(flinkCluster, defaultId);
// 3) set flink version and cluster
- Application app = new Application();
+ FlinkApplication app = new FlinkApplication();
app.setId(defaultId);
- Application application = applicationManageService.getApp(app.getId());
+ FlinkApplication application = applicationManageService.getApp(app.getId());
application.setFlinkClusterId(flinkCluster.getId());
application.setVersionId(flinkEnv.getId());
- application.setExecutionMode(FlinkExecutionMode.REMOTE.getMode());
+ application.setDeployMode(FlinkDeployMode.REMOTE.getMode());
FlinkSql flinkSql = flinkSqlService.getEffective(application.getId(), true);
application.setFlinkSql(flinkSql.getSql());
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/DistributedTaskService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/DistributedTaskService.java
index 70cf53968..a1730f5bd 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/DistributedTaskService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/DistributedTaskService.java
@@ -17,8 +17,8 @@
package org.apache.streampark.console.core.service;
-import org.apache.streampark.console.core.entity.Application;
import org.apache.streampark.console.core.entity.DistributedTask;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.enums.DistributedTaskEnum;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -49,7 +49,7 @@ public interface DistributedTaskService extends IService<DistributedTask> {
* @param applications List<Application>
* @return List<Application> List of tasks that need to be monitored
*/
- List<Application> getMonitoredTaskList(List<Application> applications);
+ List<FlinkApplication> getMonitoredTaskList(List<FlinkApplication> applications);
/**
* This interface handles task redistribution when server nodes are added.
@@ -78,5 +78,5 @@ public interface DistributedTaskService extends IService<DistributedTask> {
* @param autoStart boolean
* @param action It may be one of the following values: START, RESTART, REVOKE, CANCEL, ABORT
*/
- public void saveDistributedTask(Application appParam, boolean autoStart, DistributedTaskEnum action);
+ public void saveDistributedTask(FlinkApplication appParam, boolean autoStart, DistributedTaskEnum action);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationBackUpService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkApplicationBackUpService.java
similarity index 75%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationBackUpService.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkApplicationBackUpService.java
index 7e7f1c37d..cafe8376f 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationBackUpService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkApplicationBackUpService.java
@@ -19,15 +19,15 @@ package org.apache.streampark.console.core.service;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.exception.InternalException;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationBackUp;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationBackUp;
import org.apache.streampark.console.core.entity.FlinkSql;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
/** Interface representing a service for application backup operations. */
-public interface ApplicationBackUpService extends IService<ApplicationBackUp> {
+public interface FlinkApplicationBackUpService extends IService<FlinkApplicationBackUp> {
/**
* Deletes an object specified by the given ID.
@@ -44,37 +44,37 @@ public interface ApplicationBackUpService extends IService<ApplicationBackUp> {
* @param appParam The application to back up.
* @param flinkSqlParam The Flink SQL to back up.
*/
- void backup(Application appParam, FlinkSql flinkSqlParam);
+ void backup(FlinkApplication appParam, FlinkSql flinkSqlParam);
/**
- * Retrieves a page of {@link ApplicationBackUp} objects based on the provided parameters.
+ * Retrieves a page of {@link FlinkApplicationBackUp} objects based on the provided parameters.
*
- * @param bakParam The {@link ApplicationBackUp} object containing the search criteria.
+ * @param bakParam The {@link FlinkApplicationBackUp} object containing the search criteria.
* @param request The {@link RestRequest} object used for pagination and sorting.
- * @return An {@link IPage} containing the retrieved {@link ApplicationBackUp} objects.
+ * @return An {@link IPage} containing the retrieved {@link FlinkApplicationBackUp} objects.
*/
- IPage<ApplicationBackUp> getPage(ApplicationBackUp bakParam, RestRequest request);
+ IPage<FlinkApplicationBackUp> getPage(FlinkApplicationBackUp bakParam, RestRequest request);
/**
* Rolls back the changes made by the specified application backup.
*
* @param bakParam The ApplicationBackUp object representing the backup to roll back.
*/
- void rollback(ApplicationBackUp bakParam);
+ void rollback(FlinkApplicationBackUp bakParam);
/**
* Revoke the given application.
*
* @param appParam The application to be revoked.
*/
- void revoke(Application appParam);
+ void revoke(FlinkApplication appParam);
/**
* Removes the specified application.
*
* @param appParam the application to be removed
*/
- void remove(Application appParam);
+ void remove(FlinkApplication appParam);
/**
* Rolls back a Flink SQL application to its previous state.
@@ -82,5 +82,5 @@ public interface ApplicationBackUpService extends IService<ApplicationBackUp> {
* @param appParam The application to rollback.
* @param flinkSqlParam The Flink SQL instance associated with the application.
*/
- void rollbackFlinkSql(Application appParam, FlinkSql flinkSqlParam);
+ void rollbackFlinkSql(FlinkApplication appParam, FlinkSql flinkSqlParam);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationConfigService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkApplicationConfigService.java
similarity index 86%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationConfigService.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkApplicationConfigService.java
index 4b5520946..7850b2aa5 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationConfigService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkApplicationConfigService.java
@@ -18,8 +18,8 @@
package org.apache.streampark.console.core.service;
import org.apache.streampark.console.base.domain.RestRequest;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -27,7 +27,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/** This interface defines the methods to manage the application configuration. */
-public interface ApplicationConfigService extends IService<ApplicationConfig> {
+public interface FlinkApplicationConfigService extends IService<FlinkApplicationConfig> {
/**
* Creates a new instance of an Application.
@@ -35,7 +35,7 @@ public interface ApplicationConfigService extends IService<ApplicationConfig> {
* @param appParam The Application object to create.
* @param latest If set to true, sets the created Application as the latest version.
*/
- void create(Application appParam, Boolean latest);
+ void create(FlinkApplication appParam, Boolean latest);
/**
* Updates the given application.
@@ -43,7 +43,7 @@ public interface ApplicationConfigService extends IService<ApplicationConfig> {
* @param appParam the application to be updated
* @param latest a boolean indicating whether to update to the latest version
*/
- void update(Application appParam, Boolean latest);
+ void update(FlinkApplication appParam, Boolean latest);
/**
* Sets the latest or effective flag for a given configuration and application. The latest flag
@@ -71,7 +71,7 @@ public interface ApplicationConfigService extends IService<ApplicationConfig> {
* @param appId The ID of the application
* @return The latest version of the application configuration
*/
- ApplicationConfig getLatest(Long appId);
+ FlinkApplicationConfig getLatest(Long appId);
/**
* Retrieves the effective ApplicationConfig for the given appId.
@@ -79,7 +79,7 @@ public interface ApplicationConfigService extends IService<ApplicationConfig> {
* @param appId The identifier of the application.
* @return The effective ApplicationConfig.
*/
- ApplicationConfig getEffective(Long appId);
+ FlinkApplicationConfig getEffective(Long appId);
/**
* Retrieves the ApplicationConfig for the specified ID.
@@ -88,7 +88,7 @@ public interface ApplicationConfigService extends IService<ApplicationConfig> {
* @return the ApplicationConfig object corresponding to the specified ID, or null if no
* ApplicationConfig is found
*/
- ApplicationConfig get(Long id);
+ FlinkApplicationConfig get(Long id);
/**
* Retrieves a page of ApplicationConfig objects based on the specified ApplicationConfig and
@@ -100,7 +100,7 @@ public interface ApplicationConfigService extends IService<ApplicationConfig> {
* @return an IPage containing the ApplicationConfig objects that match the filter criteria
* specified in the config object, limited by the settings in the request object
*/
- IPage<ApplicationConfig> getPage(ApplicationConfig config, RestRequest request);
+ IPage<FlinkApplicationConfig> getPage(FlinkApplicationConfig config, RestRequest request);
/**
* Retrieves the history of application configurations for a given application.
@@ -108,7 +108,7 @@ public interface ApplicationConfigService extends IService<ApplicationConfig> {
* @param appId The application's id for which to retrieve the history.
* @return The list of application configurations representing the history.
*/
- List<ApplicationConfig> list(Long appId);
+ List<FlinkApplicationConfig> list(Long appId);
/**
* Reads a template from a file or a database.
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkClusterService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkClusterService.java
index 055cdd412..adb20e377 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkClusterService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkClusterService.java
@@ -18,7 +18,7 @@
package org.apache.streampark.console.core.service;
import org.apache.streampark.common.enums.ClusterState;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.core.bean.ResponseResult;
import org.apache.streampark.console.core.entity.FlinkCluster;
@@ -118,12 +118,12 @@ public interface FlinkClusterService extends IService<FlinkCluster> {
Boolean existsByFlinkEnvId(Long id);
/**
- * Lists the corresponding flink clusters based on ExecutionMode
+ * Lists the corresponding flink clusters based on DeployMode
*
- * @param executionModeEnums Collection of FlinkExecutionMode
+ * @param deployModeEnums Collection of FlinkDeployMode
* @return List of flink cluster
*/
- List<FlinkCluster> listByExecutionModes(Collection<FlinkExecutionMode> executionModeEnums);
+ List<FlinkCluster> listByDeployModes(Collection<FlinkDeployMode> deployModeEnums);
/**
* update flink cluster state
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkGateWayService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkGateWayService.java
deleted file mode 100644
index 3c69e0c51..000000000
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkGateWayService.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.streampark.console.core.service;
-
-import org.apache.streampark.console.core.entity.FlinkGateWay;
-import org.apache.streampark.console.core.enums.GatewayTypeEnum;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.fasterxml.jackson.core.JsonProcessingException;
-
-/** Connecting to Flink Gateway service */
-public interface FlinkGateWayService extends IService<FlinkGateWay> {
-
- /**
- * Create flink gateway
- *
- * @param flinkGateWay FlinkGateWay
- */
- void create(FlinkGateWay flinkGateWay);
-
- /**
- * Update flink gateway
- *
- * @param flinkGateWay FlinkGateWay
- */
- void update(FlinkGateWay flinkGateWay);
-
- /**
- * Check gateway exists by gateway name
- *
- * @param name gateway name
- * @return Whether it exists
- */
- boolean existsByGatewayName(String name);
-
- /**
- * Get gateway version
- *
- * @param address
- * @return gateway type
- * @throws JsonProcessingException
- */
- GatewayTypeEnum getGatewayVersion(String address) throws JsonProcessingException;
-}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkSqlService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkSqlService.java
index 6ce50e86e..292ed03c2 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkSqlService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/FlinkSqlService.java
@@ -18,7 +18,7 @@
package org.apache.streampark.console.core.service;
import org.apache.streampark.console.base.domain.RestRequest;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkSql;
import org.apache.streampark.console.core.enums.CandidateTypeEnum;
import org.apache.streampark.flink.core.FlinkSqlValidationResult;
@@ -105,7 +105,7 @@ public interface FlinkSqlService extends IService<FlinkSql> {
*
* @param application Application
*/
- void rollback(Application application);
+ void rollback(FlinkApplication application);
/**
* Verify whether the entered SQL is correct
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java
index 08b46eb70..5e1f96dd3 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java
@@ -19,7 +19,7 @@ package org.apache.streampark.console.core.service;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.domain.RestResponse;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.Project;
import org.apache.streampark.console.core.enums.GitAuthorizedErrorEnum;
@@ -139,7 +139,7 @@ public interface ProjectService extends IService<Project> {
* @param project Project
* @return List of Applications
*/
- List<Application> listApps(Project project);
+ List<FlinkApplication> listApps(Project project);
/**
* Check whether the corresponding project exists
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProxyService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProxyService.java
index 8eed7e29d..c9f269cbf 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProxyService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProxyService.java
@@ -17,8 +17,8 @@
package org.apache.streampark.console.core.service;
-import org.apache.streampark.console.core.entity.Application;
import org.apache.streampark.console.core.entity.ApplicationLog;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.SparkApplicationLog;
import org.springframework.http.ResponseEntity;
@@ -27,7 +27,7 @@ import javax.servlet.http.HttpServletRequest;
public interface ProxyService {
- ResponseEntity<?> proxyFlink(HttpServletRequest request, Application app) throws Exception;
+ ResponseEntity<?> proxyFlink(HttpServletRequest request, FlinkApplication app) throws Exception;
ResponseEntity<?> proxyYarn(HttpServletRequest request, SparkApplicationLog log) throws Exception;
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/SavepointService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/SavepointService.java
index d7597817a..f239402d5 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/SavepointService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/SavepointService.java
@@ -19,15 +19,15 @@ package org.apache.streampark.console.core.service;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.exception.InternalException;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.Savepoint;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkSavepoint;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.annotation.Nullable;
-public interface SavepointService extends IService<Savepoint> {
+public interface SavepointService extends IService<FlinkSavepoint> {
/**
* Expires all savepoints for the specified application.
@@ -42,7 +42,7 @@ public interface SavepointService extends IService<Savepoint> {
* @param id the unique identifier of the SavePoint
* @return the latest SavePoint object, or null if not found
*/
- Savepoint getLatest(Long id);
+ FlinkSavepoint getLatest(Long id);
/**
* Triggers a savepoint for the specified application.
@@ -62,7 +62,7 @@ public interface SavepointService extends IService<Savepoint> {
* @return true if the application is successfully deleted, false otherwise
* @throws InternalException if there is an internal error during the deletion process
*/
- Boolean remove(Long id, Application appParam) throws InternalException;
+ Boolean remove(Long id, FlinkApplication appParam) throws InternalException;
/**
* Retrieves a page of savepoint objects based on the specified parameters.
@@ -71,14 +71,14 @@ public interface SavepointService extends IService<Savepoint> {
* @param request The RestRequest object containing additional request parameters.
* @return An instance of IPage<SavePoint> representing the page of SavePoint objects.
*/
- IPage<Savepoint> getPage(Savepoint savepoint, RestRequest request);
+ IPage<FlinkSavepoint> getPage(FlinkSavepoint savepoint, RestRequest request);
/**
* Removes all savepoints for the specified application.
*
* @param appParam the application to be removed
*/
- void remove(Application appParam);
+ void remove(FlinkApplication appParam);
/**
* Returns the savepoint path for the given application.
@@ -87,5 +87,5 @@ public interface SavepointService extends IService<Savepoint> {
* @return the save point path for the given application
* @throws Exception if an error occurs while getting the save point path
*/
- String getSavePointPath(Application appParam) throws Exception;
+ String getSavePointPath(FlinkApplication appParam) throws Exception;
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/SqlWorkBenchService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/SqlWorkBenchService.java
deleted file mode 100644
index 2ecfb06eb..000000000
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/SqlWorkBenchService.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.streampark.console.core.service;
-
-import org.apache.streampark.gateway.OperationHandle;
-import org.apache.streampark.gateway.results.Column;
-import org.apache.streampark.gateway.results.GatewayInfo;
-import org.apache.streampark.gateway.results.OperationInfo;
-import org.apache.streampark.gateway.results.ResultQueryCondition;
-import org.apache.streampark.gateway.results.ResultSet;
-import org.apache.streampark.gateway.session.SessionHandle;
-
-public interface SqlWorkBenchService {
-
- /**
- * Open a session for a flink cluster
- *
- * @param flinkGatewayId flink gateway id
- * @param flinkClusterId flink cluster id
- * @return session handle
- */
- SessionHandle openSession(Long flinkGatewayId, Long flinkClusterId);
-
- /**
- * Close a session
- *
- * @param flinkGatewayId flink gateway id
- * @param sessionHandleUUIDStr session handle uuid string
- */
- void closeSession(Long flinkGatewayId, String sessionHandleUUIDStr);
-
- /**
- * Get the gateway info
- *
- * @param flinkGatewayId flink gateway id
- * @return gateway info
- */
- GatewayInfo getGatewayInfo(Long flinkGatewayId);
-
- /**
- * Get the session info
- *
- * @param flinkGatewayId flink gateway id
- * @param sessionHandleUUIDStr session handle uuid string
- * @param operationId operation id
- */
- void cancelOperation(Long flinkGatewayId, String sessionHandleUUIDStr, String operationId);
-
- /**
- * Close the operation
- *
- * @param flinkGatewayId flink gateway id
- * @param sessionHandleUUIDStr session handle uuid string
- * @param operationId operation id
- */
- void closeOperation(Long flinkGatewayId, String sessionHandleUUIDStr, String operationId);
-
- /**
- * Get operation info
- *
- * @param flinkGatewayId flink gateway id
- * @param sessionHandleUUIDStr session handle uuid string
- * @param operationId operation id
- * @return operation info
- */
- OperationInfo getOperationInfo(
- Long flinkGatewayId, String sessionHandleUUIDStr, String operationId);
-
- /**
- * Get operation result schema
- *
- * @param flinkGatewayId flink gateway id
- * @param sessionHandleUUIDStr session handle uuid string
- * @param operationId operation id
- * @return operation result schema
- */
- Column getOperationResultSchema(
- Long flinkGatewayId, String sessionHandleUUIDStr, String operationId);
-
- /**
- * Execute statement
- *
- * @param flinkGatewayId flink gateway id
- * @param sessionHandleUUIDStr session handle uuid string
- * @param statement statement
- * @return operation handle
- */
- OperationHandle executeStatement(
- Long flinkGatewayId, String sessionHandleUUIDStr, String statement);
-
- /**
- * Fetch results
- *
- * @param flinkGatewayId flink gateway id
- * @param sessionHandleUUIDStr session handle uuid string
- * @param operationId operation id
- * @param resultQueryCondition result query condition
- * @return result set
- */
- ResultSet fetchResults(
- Long flinkGatewayId,
- String sessionHandleUUIDStr,
- String operationId,
- ResultQueryCondition resultQueryCondition);
-
- /**
- * Send heartbeat
- *
- * @param flinkGatewayId flink gateway id
- * @param sessionHandle session handle
- */
- void heartbeat(Long flinkGatewayId, String sessionHandle);
-
- /**
- * check flink cluster version is supported
- *
- * @param flinkGatewayId flink gateway id
- * @param flinkClusterId flink cluster id
- * @return true if supported
- */
- boolean check(Long flinkGatewayId, Long flinkClusterId);
-}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/VariableService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/VariableService.java
index b14f1b18b..fc8ee4cc7 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/VariableService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/VariableService.java
@@ -18,7 +18,7 @@
package org.apache.streampark.console.core.service;
import org.apache.streampark.console.base.domain.RestRequest;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.Variable;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -102,7 +102,7 @@ public interface VariableService extends IService<Variable> {
* @param request The REST request containing additional parameters for retrieving the page.
* @return An instance of IPage<Application> containing the dependent applications.
*/
- IPage<Application> getDependAppsPage(Variable variable, RestRequest request);
+ IPage<FlinkApplication> getDependAppsPage(Variable variable, RestRequest request);
/**
* Updates the given variable.
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java
index 3dfbff385..e45d64e28 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java
@@ -17,8 +17,8 @@
package org.apache.streampark.console.core.service;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
-import org.apache.streampark.common.enums.SparkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
+import org.apache.streampark.common.enums.SparkDeployMode;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.core.bean.ResponseResult;
import org.apache.streampark.console.core.entity.YarnQueue;
@@ -70,12 +70,12 @@ public interface YarnQueueService extends IService<YarnQueue> {
/**
* Check queue label by given parameters
*
- * @param executionModeEnum FlinkExecutionMode
+ * @param deployModeEnum FlinkDeployMode
* @param queueLabel queue Label
*/
- void checkQueueLabel(FlinkExecutionMode executionModeEnum, String queueLabel);
+ void checkQueueLabel(FlinkDeployMode deployModeEnum, String queueLabel);
- void checkQueueLabel(SparkExecutionMode executionModeEnum, String queueLabel);
+ void checkQueueLabel(SparkDeployMode deployModeEnum, String queueLabel);
/**
* Determine whether it is the default queue by the given queue label
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/AlertConfigServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/AlertConfigServiceImpl.java
index 52d576f6e..75280e364 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/AlertConfigServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/AlertConfigServiceImpl.java
@@ -22,10 +22,10 @@ import org.apache.streampark.console.base.exception.AlertException;
import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
import org.apache.streampark.console.core.bean.AlertConfigParams;
import org.apache.streampark.console.core.entity.AlertConfig;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.mapper.AlertConfigMapper;
import org.apache.streampark.console.core.service.alert.AlertConfigService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
import org.apache.commons.collections.CollectionUtils;
@@ -49,7 +49,7 @@ public class AlertConfigServiceImpl extends ServiceImpl<AlertConfigMapper, Alert
AlertConfigService {
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@Override
public IPage<AlertConfigParams> page(Long userId, RestRequest request) {
@@ -78,7 +78,7 @@ public class AlertConfigServiceImpl extends ServiceImpl<AlertConfigMapper, Alert
@Override
public boolean removeById(Long id) throws AlertException {
long count = applicationInfoService.count(
- new LambdaQueryWrapper<Application>().eq(id != null, Application::getAlertId, id));
+ new LambdaQueryWrapper<FlinkApplication>().eq(id != null, FlinkApplication::getAlertId, id));
if (count > 0) {
throw new AlertException(
String.format(
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/ApplicationActionService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/FlinkApplicationActionService.java
similarity index 86%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/ApplicationActionService.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/FlinkApplicationActionService.java
index 872048152..ef6a992a2 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/ApplicationActionService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/FlinkApplicationActionService.java
@@ -18,7 +18,7 @@
package org.apache.streampark.console.core.service.application;
import org.apache.streampark.console.base.exception.ApplicationException;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -26,7 +26,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* This interface represents an Application Operation Service. It extends the IService interface for
* handling Application entities.
*/
-public interface ApplicationActionService extends IService<Application> {
+public interface FlinkApplicationActionService extends IService<FlinkApplication> {
/**
* Starts the specified application.
@@ -35,7 +35,7 @@ public interface ApplicationActionService extends IService<Application> {
* @param auto True if the application should start automatically, False otherwise.
* @throws Exception If an error occurs while starting the application.
*/
- void start(Application appParam, boolean auto) throws Exception;
+ void start(FlinkApplication appParam, boolean auto) throws Exception;
/**
* Restarts the given application.
@@ -43,7 +43,7 @@ public interface ApplicationActionService extends IService<Application> {
* @param appParam The application to restart.
* @throws Exception If an error occurs while restarting the application.
*/
- void restart(Application appParam) throws Exception;
+ void restart(FlinkApplication appParam) throws Exception;
/**
* Revokes access for the given application.
@@ -59,7 +59,7 @@ public interface ApplicationActionService extends IService<Application> {
* @param appParam the application to be canceled
* @throws Exception if cancellation fails
*/
- void cancel(Application appParam) throws Exception;
+ void cancel(FlinkApplication appParam) throws Exception;
/**
* Forces the given application to stop.
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/ApplicationInfoService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/FlinkApplicationInfoService.java
similarity index 92%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/ApplicationInfoService.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/FlinkApplicationInfoService.java
index 43a688efe..a35d58850 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/ApplicationInfoService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/FlinkApplicationInfoService.java
@@ -18,7 +18,7 @@
package org.apache.streampark.console.core.service.application;
import org.apache.streampark.console.base.exception.ApplicationException;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.enums.AppExistsStateEnum;
import org.apache.hadoop.yarn.api.records.ApplicationReport;
@@ -34,7 +34,7 @@ import java.util.Map;
* This interface defines the methods that can be used for various utility operations related to an
* application.
*/
-public interface ApplicationInfoService extends IService<Application> {
+public interface FlinkApplicationInfoService extends IService<FlinkApplication> {
/**
* Checks the environment for the given application.
@@ -43,7 +43,7 @@ public interface ApplicationInfoService extends IService<Application> {
* @return true if the environment is valid for the application, false otherwise
* @throws ApplicationException if an error occurs while checking the environment
*/
- boolean checkEnv(Application appParam) throws ApplicationException;
+ boolean checkEnv(FlinkApplication appParam) throws ApplicationException;
/**
* Checks the savepoint path for the given application.
@@ -52,7 +52,7 @@ public interface ApplicationInfoService extends IService<Application> {
* @return the check message
* @throws Exception if an error occurs while checking the savepoint path
*/
- String checkSavepointPath(Application appParam) throws Exception;
+ String checkSavepointPath(FlinkApplication appParam) throws Exception;
/**
* Checks if the given application meets the required alterations.
@@ -61,7 +61,7 @@ public interface ApplicationInfoService extends IService<Application> {
* @return True if the application meets the required alterations, false otherwise.
* @throws ApplicationException If an error occurs while checking the alterations.
*/
- boolean checkAlter(Application appParam);
+ boolean checkAlter(FlinkApplication appParam);
/**
* Checks if a record exists in the database with the given team ID.
@@ -134,7 +134,7 @@ public interface ApplicationInfoService extends IService<Application> {
* @param appParam The application to check for existence.
* @return AppExistsState indicating the existence state of the application.
*/
- AppExistsStateEnum checkExists(Application appParam);
+ AppExistsStateEnum checkExists(FlinkApplication appParam);
/**
* Reads the configuration for the given application and returns it as a String.
@@ -151,7 +151,7 @@ public interface ApplicationInfoService extends IService<Application> {
* @param appParam the Application object for which to fetch the main configuration value
* @return the main configuration value as a String
*/
- String getMain(Application appParam);
+ String getMain(FlinkApplication appParam);
/**
* Returns the dashboard for the specified team.
@@ -182,11 +182,11 @@ public interface ApplicationInfoService extends IService<Application> {
/**
* Retrieves the list of recent K8s cluster IDs based on the specified execution mode.
*
- * @param executionMode The execution mode to filter the recent K8s cluster IDs. 1: Production
+ * @param deployMode The execution mode to filter the recent K8s cluster IDs. 1: Production
* mode 2: Test mode 3: Development mode -1: All modes
* @return The list of recent K8s cluster IDs based on the specified execution mode.
*/
- List<String> listRecentK8sClusterId(Integer executionMode);
+ List<String> listRecentK8sClusterId(Integer deployMode);
/**
* Retrieves the list of recent Flink base images.
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/ApplicationManageService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/FlinkApplicationManageService.java
similarity index 80%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/ApplicationManageService.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/FlinkApplicationManageService.java
index 2ee3c90f3..038784703 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/ApplicationManageService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/FlinkApplicationManageService.java
@@ -17,9 +17,9 @@
package org.apache.streampark.console.core.service.application;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.console.base.domain.RestRequest;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -32,7 +32,7 @@ import java.util.List;
* The ApplicationManageService interface provides methods to manage applications information. It
* extends the IService interface with the Application entity.
*/
-public interface ApplicationManageService extends IService<Application> {
+public interface FlinkApplicationManageService extends IService<FlinkApplication> {
/**
* Retrieves a page of applications based on the provided parameters.
@@ -41,7 +41,7 @@ public interface ApplicationManageService extends IService<Application> {
* @param request The REST request object containing additional parameters or headers.
* @return A page of Application objects based on the provided parameters.
*/
- IPage<Application> page(Application appParam, RestRequest request);
+ IPage<FlinkApplication> page(FlinkApplication appParam, RestRequest request);
/**
* Creates a new application.
@@ -50,7 +50,7 @@ public interface ApplicationManageService extends IService<Application> {
* @return True if the application was successfully created, false otherwise.
* @throws IOException If an I/O error occurs.
*/
- boolean create(Application appParam) throws IOException;
+ boolean create(FlinkApplication appParam) throws IOException;
/**
* Copies the given Application.
@@ -59,7 +59,7 @@ public interface ApplicationManageService extends IService<Application> {
* @return the size of the copied Application in bytes as a Long value
* @throws IOException if there was an error during the copy process
*/
- Long copy(Application appParam) throws IOException;
+ Long copy(FlinkApplication appParam) throws IOException;
/**
* Updates the given application.
@@ -67,21 +67,21 @@ public interface ApplicationManageService extends IService<Application> {
* @param appParam the application to be updated
* @return true if the update was successful, false otherwise
*/
- boolean update(Application appParam);
+ boolean update(FlinkApplication appParam);
/**
* Sets the given application to be effective.
*
* @param appParam the application to be set effective
*/
- void toEffective(Application appParam);
+ void toEffective(FlinkApplication appParam);
/**
* Persists the metrics of the given application.
*
* @param appParam The application which metrics need to be persisted.
*/
- void persistMetrics(Application appParam);
+ void persistMetrics(FlinkApplication appParam);
/**
* Maps the given application.
@@ -89,7 +89,7 @@ public interface ApplicationManageService extends IService<Application> {
* @param appParam The application to be mapped.
* @return True if the mapping was successful, false otherwise.
*/
- boolean mapping(Application appParam);
+ boolean mapping(FlinkApplication appParam);
/**
* Checks if the given application is ready to build and update.
@@ -97,7 +97,7 @@ public interface ApplicationManageService extends IService<Application> {
* @param appParam the application to check for readiness
* @return true if the application is ready to build and update, false otherwise
*/
- boolean checkBuildAndUpdate(Application appParam);
+ boolean checkBuildAndUpdate(FlinkApplication appParam);
/**
* Deletes the given Application from the system.
@@ -114,21 +114,21 @@ public interface ApplicationManageService extends IService<Application> {
* @return The Application object that matches the specified details, or null if no matching
* Application is found.
*/
- Application getApp(Long id);
+ FlinkApplication getApp(Long id);
/**
* Updates the release of the given application.
*
* @param appParam The application to update the release for.
*/
- void updateRelease(Application appParam);
+ void updateRelease(FlinkApplication appParam);
/**
* Cleans the application by performing necessary cleanup tasks.
*
* @param appParam The application to clean.
*/
- void clean(Application appParam);
+ void clean(FlinkApplication appParam);
/**
* Retrieves a list of applications by project ID.
@@ -136,7 +136,7 @@ public interface ApplicationManageService extends IService<Application> {
* @param id The project ID to search for applications.
* @return A list of applications associated with the project ID.
*/
- List<Application> listByProjectId(Long id);
+ List<FlinkApplication> listByProjectId(Long id);
/**
* Changes the ownership of all applications associated with a user.
@@ -152,16 +152,17 @@ public interface ApplicationManageService extends IService<Application> {
* @param teamId The ID of the team to retrieve the applications for.
* @return A list of Application objects associated with the given team ID.
*/
- List<Application> listByTeamId(Long teamId);
+ List<FlinkApplication> listByTeamId(Long teamId);
/**
* Retrieves a list of applications by team ID and execution modes.
*
* @param teamId The ID of the team to filter by
- * @param executionModeEnums The collection of execution modes to filter by
+ * @param deployModeEnums The collection of execution modes to filter by
* @return A list of applications that belong to the specified team and have the specified
* execution modes
*/
- List<Application> listByTeamIdAndExecutionModes(
- Long teamId, Collection<FlinkExecutionMode> executionModeEnums);
+ List<FlinkApplication> listByTeamIdAndDeployModes(
+ Long teamId,
+ Collection<FlinkDeployMode> deployModeEnums);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/SparkApplicationManageService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/SparkApplicationManageService.java
index f0b10d913..0753b164e 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/SparkApplicationManageService.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/SparkApplicationManageService.java
@@ -17,7 +17,7 @@
package org.apache.streampark.console.core.service.application;
-import org.apache.streampark.common.enums.SparkExecutionMode;
+import org.apache.streampark.common.enums.SparkDeployMode;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.core.entity.SparkApplication;
@@ -158,11 +158,11 @@ public interface SparkApplicationManageService extends IService<SparkApplication
* Retrieves a list of applications by team ID and execution modes.
*
* @param teamId The ID of the team to filter by
- * @param executionModeEnums The collection of execution modes to filter by
+ * @param deployModeEnums The collection of execution modes to filter by
* @return A list of applications that belong to the specified team and have the specified
* execution modes
*/
- List<SparkApplication> listByTeamIdAndExecutionModes(
- Long teamId,
- Collection<SparkExecutionMode> executionModeEnums);
+ List<SparkApplication> listByTeamIdAndDeployModes(
+ Long teamId,
+ Collection<SparkDeployMode> deployModeEnums);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/FlinkApplicationActionServiceImpl.java
similarity index 88%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/FlinkApplicationActionServiceImpl.java
index ef768f45f..451fee22c 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/FlinkApplicationActionServiceImpl.java
@@ -22,8 +22,8 @@ import org.apache.streampark.common.conf.Workspace;
import org.apache.streampark.common.constants.Constants;
import org.apache.streampark.common.enums.ApplicationType;
import org.apache.streampark.common.enums.ClusterState;
-import org.apache.streampark.common.enums.FlinkDevelopmentMode;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
+import org.apache.streampark.common.enums.FlinkJobType;
import org.apache.streampark.common.enums.FlinkK8sRestExposedType;
import org.apache.streampark.common.enums.FlinkRestoreMode;
import org.apache.streampark.common.enums.ResolveOrder;
@@ -38,14 +38,14 @@ import org.apache.streampark.console.base.exception.ApplicationException;
import org.apache.streampark.console.base.util.Tuple2;
import org.apache.streampark.console.base.util.Tuple3;
import org.apache.streampark.console.core.entity.AppBuildPipeline;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
import org.apache.streampark.console.core.entity.ApplicationLog;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.FlinkEnv;
+import org.apache.streampark.console.core.entity.FlinkSavepoint;
import org.apache.streampark.console.core.entity.FlinkSql;
import org.apache.streampark.console.core.entity.Resource;
-import org.apache.streampark.console.core.entity.Savepoint;
import org.apache.streampark.console.core.enums.CheckPointTypeEnum;
import org.apache.streampark.console.core.enums.ConfigFileTypeEnum;
import org.apache.streampark.console.core.enums.DistributedTaskEnum;
@@ -53,12 +53,12 @@ import org.apache.streampark.console.core.enums.FlinkAppStateEnum;
import org.apache.streampark.console.core.enums.OperationEnum;
import org.apache.streampark.console.core.enums.OptionStateEnum;
import org.apache.streampark.console.core.enums.ReleaseStateEnum;
-import org.apache.streampark.console.core.mapper.ApplicationMapper;
+import org.apache.streampark.console.core.mapper.FlinkApplicationMapper;
import org.apache.streampark.console.core.service.AppBuildPipeService;
-import org.apache.streampark.console.core.service.ApplicationBackUpService;
-import org.apache.streampark.console.core.service.ApplicationConfigService;
import org.apache.streampark.console.core.service.ApplicationLogService;
import org.apache.streampark.console.core.service.DistributedTaskService;
+import org.apache.streampark.console.core.service.FlinkApplicationBackUpService;
+import org.apache.streampark.console.core.service.FlinkApplicationConfigService;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.FlinkEnvService;
import org.apache.streampark.console.core.service.FlinkSqlService;
@@ -66,9 +66,9 @@ import org.apache.streampark.console.core.service.ResourceService;
import org.apache.streampark.console.core.service.SavepointService;
import org.apache.streampark.console.core.service.SettingService;
import org.apache.streampark.console.core.service.VariableService;
-import org.apache.streampark.console.core.service.application.ApplicationActionService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationActionService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.util.ServiceHelper;
import org.apache.streampark.console.core.watcher.FlinkAppHttpWatcher;
import org.apache.streampark.console.core.watcher.FlinkClusterWatcher;
@@ -127,25 +127,25 @@ import java.util.concurrent.Executor;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
-public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper, Application>
+public class FlinkApplicationActionServiceImpl extends ServiceImpl<FlinkApplicationMapper, FlinkApplication>
implements
- ApplicationActionService {
+ FlinkApplicationActionService {
@Qualifier("streamparkDeployExecutor")
@Autowired
private Executor executorService;
@Autowired
- private ApplicationBackUpService backUpService;
+ private FlinkApplicationBackUpService backUpService;
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@Autowired
- private ApplicationConfigService configService;
+ private FlinkApplicationConfigService configService;
@Autowired
private ApplicationLogService applicationLogService;
@@ -192,7 +192,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
@Override
public void revoke(Long appId) throws ApplicationException {
- Application application = getById(appId);
+ FlinkApplication application = getById(appId);
ApiAlertException.throwIfNull(
application, String.format("The application id=%s not found, revoke failed.", appId));
@@ -209,21 +209,21 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
backUpService.revoke(application);
// 3) restore related status
- LambdaUpdateWrapper<Application> updateWrapper = Wrappers.lambdaUpdate();
- updateWrapper.eq(Application::getId, application.getId());
+ LambdaUpdateWrapper<FlinkApplication> updateWrapper = Wrappers.lambdaUpdate();
+ updateWrapper.eq(FlinkApplication::getId, application.getId());
if (application.isFlinkSqlJob()) {
- updateWrapper.set(Application::getRelease, ReleaseStateEnum.FAILED.get());
+ updateWrapper.set(FlinkApplication::getRelease, ReleaseStateEnum.FAILED.get());
} else {
- updateWrapper.set(Application::getRelease, ReleaseStateEnum.NEED_RELEASE.get());
+ updateWrapper.set(FlinkApplication::getRelease, ReleaseStateEnum.NEED_RELEASE.get());
}
if (!application.isRunning()) {
- updateWrapper.set(Application::getState, FlinkAppStateEnum.REVOKED.getValue());
+ updateWrapper.set(FlinkApplication::getState, FlinkAppStateEnum.REVOKED.getValue());
}
baseMapper.update(null, updateWrapper);
}
@Override
- public void restart(Application appParam) throws Exception {
+ public void restart(FlinkApplication appParam) throws Exception {
// For HA purposes, if the task is not processed locally, save the Distribution task and return
if (!distributedTaskService.isLocalProcessing(appParam.getId())) {
distributedTaskService.saveDistributedTask(appParam, false, DistributedTaskEnum.RESTART);
@@ -235,7 +235,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
@Override
public void abort(Long id) {
- Application application = this.baseMapper.selectApp(id);
+ FlinkApplication application = this.baseMapper.selectApp(id);
// For HA purposes, if the task is not processed locally, save the Distribution task and return
if (!distributedTaskService.isLocalProcessing(id)) {
distributedTaskService.saveDistributedTask(application, false, DistributedTaskEnum.ABORT);
@@ -259,14 +259,14 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
@Override
- public void cancel(Application appParam) throws Exception {
+ public void cancel(FlinkApplication appParam) throws Exception {
// For HA purposes, if the task is not processed locally, save the Distribution task and return
if (!distributedTaskService.isLocalProcessing(appParam.getId())) {
distributedTaskService.saveDistributedTask(appParam, false, DistributedTaskEnum.CANCEL);
return;
}
FlinkAppHttpWatcher.setOptionState(appParam.getId(), OptionStateEnum.CANCELLING);
- Application application = getById(appParam.getId());
+ FlinkApplication application = getById(appParam.getId());
application.setState(FlinkAppStateEnum.CANCELLING.getValue());
ApplicationLog applicationLog = new ApplicationLog();
@@ -305,7 +305,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
Map<String, Object> properties = new HashMap<>();
- if (FlinkExecutionMode.isRemoteMode(application.getFlinkExecutionMode())) {
+ if (FlinkDeployMode.isRemoteMode(application.getFlinkDeployMode())) {
FlinkCluster cluster = flinkClusterService.getById(application.getFlinkClusterId());
ApiAlertException.throwIfNull(
cluster,
@@ -325,7 +325,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
CancelRequest cancelRequest = new CancelRequest(
application.getId(),
flinkEnv.getFlinkVersion(),
- FlinkExecutionMode.of(application.getExecutionMode()),
+ FlinkDeployMode.of(application.getDeployMode()),
properties,
clusterId,
application.getJobId(),
@@ -381,7 +381,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
if (cancelResponse != null && cancelResponse.savepointDir() != null) {
String savepointDir = cancelResponse.savepointDir();
log.info("savepoint path: {}", savepointDir);
- Savepoint savepoint = new Savepoint();
+ FlinkSavepoint savepoint = new FlinkSavepoint();
savepoint.setPath(savepointDir);
savepoint.setAppId(application.getId());
savepoint.setLatest(true);
@@ -398,24 +398,24 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
@Override
- public void start(Application appParam, boolean auto) throws Exception {
+ public void start(FlinkApplication appParam, boolean auto) throws Exception {
// For HA purposes, if the task is not processed locally, save the Distribution task and return
if (!distributedTaskService.isLocalProcessing(appParam.getId())) {
distributedTaskService.saveDistributedTask(appParam, auto, DistributedTaskEnum.START);
return;
}
// 1) check application
- final Application application = getById(appParam.getId());
+ final FlinkApplication application = getById(appParam.getId());
AssertUtils.notNull(application);
ApiAlertException.throwIfTrue(
!application.isCanBeStart(), "[StreamPark] The application cannot be started repeatedly.");
- if (FlinkExecutionMode.isRemoteMode(application.getFlinkExecutionMode())
- || FlinkExecutionMode.isSessionMode(application.getFlinkExecutionMode())) {
+ if (FlinkDeployMode.isRemoteMode(application.getFlinkDeployMode())
+ || FlinkDeployMode.isSessionMode(application.getFlinkDeployMode())) {
checkBeforeStart(application);
}
- if (FlinkExecutionMode.isYarnMode(application.getFlinkExecutionMode())) {
+ if (FlinkDeployMode.isYarnMode(application.getFlinkDeployMode())) {
ApiAlertException.throwIfTrue(
!applicationInfoService.getYarnAppReport(application.getJobName()).isEmpty(),
"[StreamPark] The same task name is already running in the yarn queue");
@@ -457,7 +457,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
String appConf = userJarAndAppConf.t2;
BuildResult buildResult = buildPipeline.getBuildResult();
- if (FlinkExecutionMode.YARN_APPLICATION == application.getFlinkExecutionMode()) {
+ if (FlinkDeployMode.YARN_APPLICATION == application.getFlinkDeployMode()) {
buildResult = new ShadedBuildResponse(null, flinkUserJar, true);
}
@@ -476,10 +476,10 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
SubmitRequest submitRequest = new SubmitRequest(
flinkEnv.getFlinkVersion(),
- FlinkExecutionMode.of(application.getExecutionMode()),
+ FlinkDeployMode.of(application.getDeployMode()),
getProperties(application, dynamicProperties),
flinkEnv.getFlinkConf(),
- FlinkDevelopmentMode.of(application.getJobType()),
+ FlinkJobType.of(application.getJobType()),
application.getId(),
new JobID().toHexString(),
application.getJobName(),
@@ -515,7 +515,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
@Nonnull
- private ApplicationLog constructAppLog(Application application) {
+ private ApplicationLog constructAppLog(FlinkApplication application) {
ApplicationLog applicationLog = new ApplicationLog();
applicationLog.setOptionName(OperationEnum.START.getValue());
applicationLog.setAppId(application.getId());
@@ -525,10 +525,10 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
private void processForSuccess(
- Application appParam,
+ FlinkApplication appParam,
SubmitResponse response,
ApplicationLog applicationLog,
- Application application) {
+ FlinkApplication application) {
applicationLog.setSuccess(true);
if (response.flinkConfig() != null) {
String jmMemory = response.flinkConfig().get(ConfigKeys.KEY_FLINK_JM_PROCESS_MEMORY());
@@ -544,7 +544,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
application.setJobId(response.jobId());
}
- if (FlinkExecutionMode.isYarnMode(application.getExecutionMode())) {
+ if (FlinkDeployMode.isYarnMode(application.getDeployMode())) {
application.setClusterId(response.clusterId());
applicationLog.setYarnAppId(response.clusterId());
}
@@ -570,10 +570,10 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
applicationLogService.save(applicationLog);
}
- private void processForK8sApp(Application application, ApplicationLog applicationLog) {
+ private void processForK8sApp(FlinkApplication application, ApplicationLog applicationLog) {
application.setRelease(ReleaseStateEnum.DONE.get());
k8SFlinkTrackMonitor.doWatching(k8sWatcherWrapper.toTrackId(application));
- if (!FlinkExecutionMode.isKubernetesApplicationMode(application.getExecutionMode())) {
+ if (!FlinkDeployMode.isKubernetesApplicationMode(application.getDeployMode())) {
return;
}
String domainName = settingService.getIngressModeDefault();
@@ -593,10 +593,10 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
private void processForException(
- Application appParam,
+ FlinkApplication appParam,
Throwable throwable,
ApplicationLog applicationLog,
- Application application) {
+ FlinkApplication application) {
String exception = ExceptionUtils.stringifyException(throwable);
applicationLog.setException(exception);
applicationLog.setSuccess(false);
@@ -604,7 +604,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
if (throwable instanceof CancellationException) {
doAbort(application.getId());
} else {
- Application app = getById(appParam.getId());
+ FlinkApplication app = getById(appParam.getId());
app.setState(FlinkAppStateEnum.FAILED.getValue());
app.setOptionState(OptionStateEnum.NONE.getValue());
updateById(app);
@@ -641,18 +641,18 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
}
- private void starting(Application application) {
+ private void starting(FlinkApplication application) {
application.setState(FlinkAppStateEnum.STARTING.getValue());
application.setOptionTime(new Date());
updateById(application);
}
- private Tuple2<String, String> getUserJarAndAppConf(FlinkEnv flinkEnv, Application application) {
- FlinkExecutionMode executionModeEnum = application.getFlinkExecutionMode();
- ApplicationConfig applicationConfig = configService.getEffective(application.getId());
+ private Tuple2<String, String> getUserJarAndAppConf(FlinkEnv flinkEnv, FlinkApplication application) {
+ FlinkDeployMode deployModeEnum = application.getFlinkDeployMode();
+ FlinkApplicationConfig applicationConfig = configService.getEffective(application.getId());
ApiAlertException.throwIfNull(
- executionModeEnum, "ExecutionMode can't be null, start application failed.");
+ deployModeEnum, "DeployMode can't be null, start application failed.");
String flinkUserJar = null;
String appConf = null;
@@ -668,7 +668,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
? null
: String.format("yaml://%s", applicationConfig.getContent());
// 3) client
- if (FlinkExecutionMode.YARN_APPLICATION == executionModeEnum) {
+ if (FlinkDeployMode.YARN_APPLICATION == deployModeEnum) {
String clientPath = Workspace.remote().APP_CLIENT();
flinkUserJar = String.format("%s/%s", clientPath, sqlDistJar);
}
@@ -718,7 +718,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
}
- if (FlinkExecutionMode.YARN_APPLICATION == executionModeEnum) {
+ if (FlinkDeployMode.YARN_APPLICATION == deployModeEnum) {
switch (application.getApplicationType()) {
case STREAMPARK_FLINK:
flinkUserJar = String.format(
@@ -749,9 +749,9 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
return Tuple2.of(flinkUserJar, appConf);
}
- private Map<String, Object> getProperties(Application application, String runtimeProperties) {
+ private Map<String, Object> getProperties(FlinkApplication application, String runtimeProperties) {
Map<String, Object> properties = new HashMap<>(application.getOptionMap());
- if (FlinkExecutionMode.isRemoteMode(application.getFlinkExecutionMode())) {
+ if (FlinkDeployMode.isRemoteMode(application.getFlinkDeployMode())) {
FlinkCluster cluster = flinkClusterService.getById(application.getFlinkClusterId());
ApiAlertException.throwIfNull(
cluster,
@@ -762,8 +762,8 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
URI activeAddress = cluster.getRemoteURI();
properties.put(RestOptions.ADDRESS.key(), activeAddress.getHost());
properties.put(RestOptions.PORT.key(), activeAddress.getPort());
- } else if (FlinkExecutionMode.isYarnMode(application.getFlinkExecutionMode())) {
- if (FlinkExecutionMode.YARN_SESSION == application.getFlinkExecutionMode()) {
+ } else if (FlinkDeployMode.isYarnMode(application.getFlinkDeployMode())) {
+ if (FlinkDeployMode.YARN_SESSION == application.getFlinkDeployMode()) {
FlinkCluster cluster = flinkClusterService.getById(application.getFlinkClusterId());
ApiAlertException.throwIfNull(
cluster,
@@ -780,11 +780,11 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
Optional.ofNullable(yarnLabelExpr)
.ifPresent(yLabel -> properties.put(ConfigKeys.KEY_YARN_APP_NODE_LABEL(), yLabel));
}
- } else if (FlinkExecutionMode.isKubernetesMode(application.getFlinkExecutionMode())) {
+ } else if (FlinkDeployMode.isKubernetesMode(application.getFlinkDeployMode())) {
properties.put(ConfigKeys.KEY_K8S_IMAGE_PULL_POLICY(), "Always");
}
- if (FlinkExecutionMode.isKubernetesApplicationMode(application.getExecutionMode())) {
+ if (FlinkDeployMode.isKubernetesApplicationMode(application.getDeployMode())) {
properties.put(JobManagerOptions.ARCHIVE_DIR.key(), Workspace.ARCHIVES_FILE_PATH());
}
@@ -803,7 +803,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
private void doAbort(Long id) {
- Application application = getById(id);
+ FlinkApplication application = getById(id);
application.setOptionState(OptionStateEnum.NONE.getValue());
application.setState(FlinkAppStateEnum.CANCELED.getValue());
application.setOptionTime(new Date());
@@ -818,7 +818,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
FlinkAppHttpWatcher.unWatching(application.getId());
}
// kill application
- if (FlinkExecutionMode.isYarnMode(application.getFlinkExecutionMode())) {
+ if (FlinkDeployMode.isYarnMode(application.getFlinkDeployMode())) {
try {
List<ApplicationReport> applications = applicationInfoService
.getYarnAppReport(application.getJobName());
@@ -832,10 +832,10 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
}
- private String getSavepointPath(Application appParam) {
+ private String getSavepointPath(FlinkApplication appParam) {
if (appParam.getRestoreOrTriggerSavepoint()) {
if (StringUtils.isBlank(appParam.getSavepointPath())) {
- Savepoint savepoint = savepointService.getLatest(appParam.getId());
+ FlinkSavepoint savepoint = savepointService.getLatest(appParam.getId());
if (savepoint != null) {
return savepoint.getPath();
}
@@ -847,7 +847,7 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
/* check flink cluster before job start job */
- private void checkBeforeStart(Application application) {
+ private void checkBeforeStart(FlinkApplication application) {
FlinkEnv flinkEnv = flinkEnvService.getByAppId(application.getId());
ApiAlertException.throwIfNull(flinkEnv, "[StreamPark] can no found flink version");
@@ -862,11 +862,11 @@ public class ApplicationActionServiceImpl extends ServiceImpl<ApplicationMapper,
}
private Tuple3<String, String, FlinkK8sRestExposedType> getNamespaceClusterId(
- Application application) {
+ FlinkApplication application) {
String clusterId = null;
String k8sNamespace = null;
FlinkK8sRestExposedType exposedType = null;
- switch (application.getFlinkExecutionMode()) {
+ switch (application.getFlinkDeployMode()) {
case YARN_APPLICATION:
case YARN_PER_JOB:
case YARN_SESSION:
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationInfoServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/FlinkApplicationInfoServiceImpl.java
similarity index 89%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationInfoServiceImpl.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/FlinkApplicationInfoServiceImpl.java
index a105dbd26..dc596269d 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationInfoServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/FlinkApplicationInfoServiceImpl.java
@@ -18,7 +18,7 @@
package org.apache.streampark.console.core.service.application.impl;
import org.apache.streampark.common.enums.ApplicationType;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.common.util.ExceptionUtils;
import org.apache.streampark.common.util.HadoopUtils;
import org.apache.streampark.common.util.Utils;
@@ -27,19 +27,19 @@ import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.exception.ApiDetailException;
import org.apache.streampark.console.base.exception.ApplicationException;
import org.apache.streampark.console.base.util.WebUtils;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.FlinkEnv;
import org.apache.streampark.console.core.entity.Project;
import org.apache.streampark.console.core.enums.AppExistsStateEnum;
import org.apache.streampark.console.core.enums.FlinkAppStateEnum;
-import org.apache.streampark.console.core.mapper.ApplicationMapper;
+import org.apache.streampark.console.core.mapper.FlinkApplicationMapper;
import org.apache.streampark.console.core.metrics.flink.JobsOverview;
import org.apache.streampark.console.core.runner.EnvInitializer;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.FlinkEnvService;
import org.apache.streampark.console.core.service.SavepointService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
import org.apache.streampark.console.core.watcher.FlinkAppHttpWatcher;
import org.apache.streampark.console.core.watcher.FlinkClusterWatcher;
import org.apache.streampark.console.core.watcher.FlinkK8sWatcherWrapper;
@@ -79,9 +79,9 @@ import java.util.stream.Collectors;
@Slf4j
@Service
-public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, Application>
+public class FlinkApplicationInfoServiceImpl extends ServiceImpl<FlinkApplicationMapper, FlinkApplication>
implements
- ApplicationInfoService {
+ FlinkApplicationInfoService {
private static final int DEFAULT_HISTORY_RECORD_LIMIT = 25;
@@ -123,7 +123,7 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
Integer runningJob = 0;
// stat metrics from other than kubernetes mode
- for (Application app : FlinkAppHttpWatcher.getWatchingApps()) {
+ for (FlinkApplication app : FlinkAppHttpWatcher.getWatchingApps()) {
if (!teamId.equals(app.getTeamId())) {
continue;
}
@@ -212,8 +212,8 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
}
@Override
- public boolean checkEnv(Application appParam) throws ApplicationException {
- Application application = getById(appParam.getId());
+ public boolean checkEnv(FlinkApplication appParam) throws ApplicationException {
+ FlinkApplication application = getById(appParam.getId());
try {
FlinkEnv flinkEnv = flinkEnvService.getByIdOrDefault(application.getVersionId());
if (flinkEnv == null) {
@@ -222,8 +222,8 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
envInitializer.checkFlinkEnv(application.getStorageType(), flinkEnv);
envInitializer.storageInitialize(application.getStorageType());
- if (FlinkExecutionMode.YARN_SESSION == application.getFlinkExecutionMode()
- || FlinkExecutionMode.REMOTE == application.getFlinkExecutionMode()) {
+ if (FlinkDeployMode.YARN_SESSION == application.getFlinkDeployMode()
+ || FlinkDeployMode.REMOTE == application.getFlinkDeployMode()) {
FlinkCluster flinkCluster = flinkClusterService.getById(application.getFlinkClusterId());
boolean conned = flinkClusterWatcher.verifyClusterConnection(flinkCluster);
if (!conned) {
@@ -238,7 +238,7 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
}
@Override
- public boolean checkAlter(Application appParam) {
+ public boolean checkAlter(FlinkApplication appParam) {
Long appId = appParam.getId();
if (FlinkAppStateEnum.CANCELED != appParam.getStateEnum()
&& FlinkAppStateEnum.FINISHED != appParam.getStateEnum()) {
@@ -252,13 +252,13 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
@Override
public boolean existsByTeamId(Long teamId) {
return baseMapper.exists(
- new LambdaQueryWrapper<Application>().eq(Application::getTeamId, teamId));
+ new LambdaQueryWrapper<FlinkApplication>().eq(FlinkApplication::getTeamId, teamId));
}
@Override
public boolean existsByUserId(Long userId) {
return baseMapper.exists(
- new LambdaQueryWrapper<Application>().eq(Application::getUserId, userId));
+ new LambdaQueryWrapper<FlinkApplication>().eq(FlinkApplication::getUserId, userId));
}
@Override
@@ -274,14 +274,14 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
@Override
public boolean existsByClusterId(Long clusterId) {
return baseMapper.exists(
- new LambdaQueryWrapper<Application>().eq(Application::getFlinkClusterId, clusterId));
+ new LambdaQueryWrapper<FlinkApplication>().eq(FlinkApplication::getFlinkClusterId, clusterId));
}
@Override
public Integer countByClusterId(Long clusterId) {
return baseMapper
.selectCount(
- new LambdaQueryWrapper<Application>().eq(Application::getFlinkClusterId,
+ new LambdaQueryWrapper<FlinkApplication>().eq(FlinkApplication::getFlinkClusterId,
clusterId))
.intValue();
}
@@ -294,7 +294,7 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
@Override
public boolean existsByFlinkEnvId(Long flinkEnvId) {
return baseMapper.exists(
- new LambdaQueryWrapper<Application>().eq(Application::getVersionId, flinkEnvId));
+ new LambdaQueryWrapper<FlinkApplication>().eq(FlinkApplication::getVersionId, flinkEnvId));
}
@Override
@@ -303,8 +303,8 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
}
@Override
- public List<String> listRecentK8sClusterId(Integer executionMode) {
- return baseMapper.selectRecentK8sClusterIds(executionMode, DEFAULT_HISTORY_RECORD_LIMIT);
+ public List<String> listRecentK8sClusterId(Integer deployMode) {
+ return baseMapper.selectRecentK8sClusterIds(deployMode, DEFAULT_HISTORY_RECORD_LIMIT);
}
@Override
@@ -329,11 +329,11 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
@Override
public AppExistsStateEnum checkStart(Long id) {
- Application application = getById(id);
+ FlinkApplication application = getById(id);
if (application == null) {
return AppExistsStateEnum.INVALID;
}
- if (FlinkExecutionMode.isYarnMode(application.getExecutionMode())) {
+ if (FlinkDeployMode.isYarnMode(application.getDeployMode())) {
boolean exists = !getYarnAppReport(application.getJobName()).isEmpty();
return exists ? AppExistsStateEnum.IN_YARN : AppExistsStateEnum.NO;
}
@@ -366,12 +366,12 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
@Override
public String k8sStartLog(Long id, Integer offset, Integer limit) throws Exception {
- Application application = getById(id);
+ FlinkApplication application = getById(id);
ApiAlertException.throwIfNull(
application, String.format("The application id=%s can't be found.", id));
ApiAlertException.throwIfFalse(
- FlinkExecutionMode.isKubernetesMode(application.getFlinkExecutionMode()),
- "Job executionMode must be kubernetes-session|kubernetes-application.");
+ FlinkDeployMode.isKubernetesMode(application.getFlinkDeployMode()),
+ "Job deployMode must be kubernetes-session|kubernetes-application.");
CompletableFuture<String> future = CompletableFuture.supplyAsync(
() -> KubernetesDeploymentHelper.watchDeploymentLog(
@@ -423,7 +423,7 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
* @return The state of the application's existence.
*/
@Override
- public AppExistsStateEnum checkExists(Application appParam) {
+ public AppExistsStateEnum checkExists(FlinkApplication appParam) {
String jobName = appParam.getJobName();
Long appParamId = appParam.getId();
@@ -434,13 +434,13 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
return AppExistsStateEnum.INVALID;
}
- Application application = baseMapper.selectOne(
- new LambdaQueryWrapper<Application>().eq(Application::getJobName, jobName));
+ FlinkApplication application = baseMapper.selectOne(
+ new LambdaQueryWrapper<FlinkApplication>().eq(FlinkApplication::getJobName, jobName));
if (application != null && !application.getId().equals(appParamId)) {
return AppExistsStateEnum.IN_DB;
}
- if (FlinkExecutionMode.isYarnMode(appParam.getExecutionMode())
+ if (FlinkDeployMode.isYarnMode(appParam.getDeployMode())
&& YarnUtils.isContains(jobName)) {
return AppExistsStateEnum.IN_YARN;
}
@@ -462,7 +462,7 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
}
@Override
- public String getMain(Application appParam) {
+ public String getMain(FlinkApplication appParam) {
File jarFile;
if (appParam.getProjectId() == null) {
jarFile = new File(appParam.getJar());
@@ -476,7 +476,7 @@ public class ApplicationInfoServiceImpl extends ServiceImpl<ApplicationMapper, A
}
@Override
- public String checkSavepointPath(Application appParam) throws Exception {
+ public String checkSavepointPath(FlinkApplication appParam) throws Exception {
String savepointPath = appParam.getSavepointPath();
if (StringUtils.isBlank(savepointPath)) {
savepointPath = savepointService.getSavePointPath(appParam);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationManageServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/FlinkApplicationManageServiceImpl.java
similarity index 83%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationManageServiceImpl.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/FlinkApplicationManageServiceImpl.java
index 9f708ea69..974cfeb2c 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationManageServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/FlinkApplicationManageServiceImpl.java
@@ -19,7 +19,7 @@ package org.apache.streampark.console.core.service.application.impl;
import org.apache.streampark.common.conf.Workspace;
import org.apache.streampark.common.enums.ClusterState;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.common.enums.StorageType;
import org.apache.streampark.common.fs.HdfsOperator;
import org.apache.streampark.common.util.DeflaterUtils;
@@ -29,8 +29,8 @@ import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
import org.apache.streampark.console.base.util.ObjectUtils;
import org.apache.streampark.console.base.util.WebUtils;
import org.apache.streampark.console.core.bean.AppControl;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.FlinkSql;
import org.apache.streampark.console.core.entity.Resource;
@@ -39,12 +39,12 @@ import org.apache.streampark.console.core.enums.ChangeTypeEnum;
import org.apache.streampark.console.core.enums.FlinkAppStateEnum;
import org.apache.streampark.console.core.enums.OptionStateEnum;
import org.apache.streampark.console.core.enums.ReleaseStateEnum;
-import org.apache.streampark.console.core.mapper.ApplicationMapper;
+import org.apache.streampark.console.core.mapper.FlinkApplicationMapper;
import org.apache.streampark.console.core.service.AppBuildPipeService;
-import org.apache.streampark.console.core.service.ApplicationBackUpService;
-import org.apache.streampark.console.core.service.ApplicationConfigService;
import org.apache.streampark.console.core.service.ApplicationLogService;
import org.apache.streampark.console.core.service.EffectiveService;
+import org.apache.streampark.console.core.service.FlinkApplicationBackUpService;
+import org.apache.streampark.console.core.service.FlinkApplicationConfigService;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.FlinkSqlService;
import org.apache.streampark.console.core.service.ProjectService;
@@ -52,7 +52,7 @@ import org.apache.streampark.console.core.service.ResourceService;
import org.apache.streampark.console.core.service.SavepointService;
import org.apache.streampark.console.core.service.SettingService;
import org.apache.streampark.console.core.service.YarnQueueService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.util.ServiceHelper;
import org.apache.streampark.console.core.watcher.FlinkAppHttpWatcher;
import org.apache.streampark.console.core.watcher.FlinkClusterWatcher;
@@ -94,9 +94,9 @@ import java.util.stream.Collectors;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
-public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper, Application>
+public class FlinkApplicationManageServiceImpl extends ServiceImpl<FlinkApplicationMapper, FlinkApplication>
implements
- ApplicationManageService {
+ FlinkApplicationManageService {
private static final String ERROR_APP_QUEUE_HINT =
"Queue label '%s' isn't available for teamId '%d', please add it into the team first.";
@@ -105,10 +105,10 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
private ProjectService projectService;
@Autowired
- private ApplicationBackUpService backUpService;
+ private FlinkApplicationBackUpService backUpService;
@Autowired
- private ApplicationConfigService configService;
+ private FlinkApplicationConfigService configService;
@Autowired
private ApplicationLogService applicationLogService;
@@ -152,9 +152,9 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
}
@Override
- public void toEffective(Application appParam) {
+ public void toEffective(FlinkApplication appParam) {
// set latest to Effective
- ApplicationConfig config = configService.getLatest(appParam.getId());
+ FlinkApplicationConfig config = configService.getLatest(appParam.getId());
if (config != null) {
this.configService.toEffective(appParam.getId(), config.getId());
}
@@ -169,14 +169,14 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
}
@Override
- public void persistMetrics(Application appParam) {
+ public void persistMetrics(FlinkApplication appParam) {
this.baseMapper.persistMetrics(appParam);
}
@Override
- public boolean mapping(Application appParam) {
+ public boolean mapping(FlinkApplication appParam) {
boolean mapping = this.baseMapper.mapping(appParam);
- Application application = getById(appParam.getId());
+ FlinkApplication application = getById(appParam.getId());
if (application.isKubernetesModeJob()) {
// todo mark
k8SFlinkTrackMonitor.doWatching(k8sWatcherWrapper.toTrackId(application));
@@ -189,7 +189,7 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
@Override
public Boolean remove(Long appId) {
- Application application = getById(appId);
+ FlinkApplication application = getById(appId);
// 1) remove flink sql
flinkSqlService.removeByAppId(application.getId());
@@ -223,7 +223,7 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
return true;
}
- private void removeApp(Application application) {
+ private void removeApp(FlinkApplication application) {
Long appId = application.getId();
removeById(appId);
try {
@@ -241,11 +241,11 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
}
@Override
- public IPage<Application> page(Application appParam, RestRequest request) {
+ public IPage<FlinkApplication> page(FlinkApplication appParam, RestRequest request) {
if (appParam.getTeamId() == null) {
return null;
}
- Page<Application> page = MybatisPager.getPage(request);
+ Page<FlinkApplication> page = MybatisPager.getPage(request);
if (ArrayUtils.isNotEmpty(appParam.getStateArray())
&& Arrays.stream(appParam.getStateArray())
@@ -257,13 +257,13 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
appParam.setStateArray(newArray);
}
this.baseMapper.selectPage(page, appParam);
- List<Application> records = page.getRecords();
+ List<FlinkApplication> records = page.getRecords();
long now = System.currentTimeMillis();
- List<Long> appIds = records.stream().map(Application::getId).collect(Collectors.toList());
+ List<Long> appIds = records.stream().map(FlinkApplication::getId).collect(Collectors.toList());
Map<Long, PipelineStatusEnum> pipeStates = appBuildPipeService.listAppIdPipelineStatusMap(appIds);
- List<Application> newRecords = records.stream()
+ List<FlinkApplication> newRecords = records.stream()
.peek(
record -> {
// status of flink job on kubernetes mode had been automatically persisted
@@ -287,7 +287,7 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
return page;
}
- private void setAppDurationIfNeeded(Application record, long now) {
+ private void setAppDurationIfNeeded(FlinkApplication record, long now) {
if (record.getTracking() == 1
&& record.getStartTime() != null
&& record.getStartTime().getTime() > 0) {
@@ -295,7 +295,7 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
}
}
- private AppControl getAppControl(Application record) {
+ private AppControl getAppControl(FlinkApplication record) {
return new AppControl()
.setAllowBuild(
record.getBuildStatus() == null
@@ -310,15 +310,15 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
@Override
public void changeOwnership(Long userId, Long targetUserId) {
- LambdaUpdateWrapper<Application> updateWrapper = new LambdaUpdateWrapper<Application>()
- .eq(Application::getUserId, userId)
- .set(Application::getUserId, targetUserId);
+ LambdaUpdateWrapper<FlinkApplication> updateWrapper = new LambdaUpdateWrapper<FlinkApplication>()
+ .eq(FlinkApplication::getUserId, userId)
+ .set(FlinkApplication::getUserId, targetUserId);
this.baseMapper.update(null, updateWrapper);
}
@SneakyThrows
@Override
- public boolean create(Application appParam) {
+ public boolean create(FlinkApplication appParam) {
ApiAlertException.throwIfNull(
appParam.getTeamId(), "The teamId can't be null. Create application failed.");
appParam.setUserId(ServiceHelper.getUserId());
@@ -364,25 +364,25 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
private boolean existsByJobName(String jobName) {
return baseMapper.exists(
- new LambdaQueryWrapper<Application>().eq(Application::getJobName, jobName));
+ new LambdaQueryWrapper<FlinkApplication>().eq(FlinkApplication::getJobName, jobName));
}
@SuppressWarnings("checkstyle:WhitespaceAround")
@Override
@SneakyThrows
- public Long copy(Application appParam) {
+ public Long copy(FlinkApplication appParam) {
boolean existsByJobName = this.existsByJobName(appParam.getJobName());
ApiAlertException.throwIfFalse(
!existsByJobName,
"[StreamPark] Application names can't be repeated, copy application failed.");
- Application persist = getById(appParam.getId());
- Application newApp = new Application();
+ FlinkApplication persist = getById(appParam.getId());
+ FlinkApplication newApp = new FlinkApplication();
String jobName = appParam.getJobName();
newApp.setJobName(jobName);
newApp.setClusterId(
- FlinkExecutionMode.isSessionMode(persist.getFlinkExecutionMode())
+ FlinkDeployMode.isSessionMode(persist.getFlinkDeployMode())
? persist.getClusterId()
: null);
newApp.setArgs(appParam.getArgs() != null ? appParam.getArgs() : persist.getArgs());
@@ -394,7 +394,7 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
newApp.setOptions(persist.getOptions());
newApp.setDynamicProperties(persist.getDynamicProperties());
newApp.setResolveOrder(persist.getResolveOrder());
- newApp.setExecutionMode(persist.getExecutionMode());
+ newApp.setDeployMode(persist.getDeployMode());
newApp.setFlinkImage(persist.getFlinkImage());
newApp.setK8sNamespace(persist.getK8sNamespace());
newApp.setK8sRestExposedType(persist.getK8sRestExposedType());
@@ -438,9 +438,9 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
FlinkSql flinkSql = new FlinkSql(newApp);
flinkSqlService.create(flinkSql);
}
- ApplicationConfig copyConfig = configService.getEffective(appParam.getId());
+ FlinkApplicationConfig copyConfig = configService.getEffective(appParam.getId());
if (copyConfig != null) {
- ApplicationConfig config = new ApplicationConfig();
+ FlinkApplicationConfig config = new FlinkApplicationConfig();
config.setAppId(newApp.getId());
config.setFormat(copyConfig.getFormat());
config.setContent(copyConfig.getContent());
@@ -457,12 +457,12 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
}
@Override
- public boolean update(Application appParam) {
- Application application = getById(appParam.getId());
+ public boolean update(FlinkApplication appParam) {
+ FlinkApplication application = getById(appParam.getId());
/* If the original mode is remote, k8s-session, yarn-session, check cluster status */
- FlinkExecutionMode flinkExecutionMode = application.getFlinkExecutionMode();
- switch (flinkExecutionMode) {
+ FlinkDeployMode flinkDeployMode = application.getFlinkDeployMode();
+ switch (flinkDeployMode) {
case REMOTE:
case YARN_SESSION:
case KUBERNETES_NATIVE_SESSION:
@@ -526,7 +526,7 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
application.setOptions(appParam.getOptions());
application.setDynamicProperties(appParam.getDynamicProperties());
application.setResolveOrder(appParam.getResolveOrder());
- application.setExecutionMode(appParam.getExecutionMode());
+ application.setDeployMode(appParam.getDeployMode());
application.setFlinkImage(appParam.getFlinkImage());
application.setK8sNamespace(appParam.getK8sNamespace());
application.updateHotParams(appParam);
@@ -546,7 +546,7 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
application.setCpMaxFailureInterval(appParam.getCpMaxFailureInterval());
application.setTags(appParam.getTags());
- switch (appParam.getFlinkExecutionMode()) {
+ switch (appParam.getFlinkDeployMode()) {
case YARN_APPLICATION:
application.setHadoopUser(appParam.getHadoopUser());
break;
@@ -590,7 +590,7 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
* @param application
* @param appParam
*/
- private void updateFlinkSqlJob(Application application, Application appParam) {
+ private void updateFlinkSqlJob(FlinkApplication application, FlinkApplication appParam) {
FlinkSql effectiveFlinkSql = flinkSqlService.getEffective(application.getId(), true);
if (effectiveFlinkSql == null) {
effectiveFlinkSql = flinkSqlService.getCandidate(application.getId(), CandidateTypeEnum.NEW);
@@ -653,54 +653,54 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
}
@Override
- public void updateRelease(Application appParam) {
- LambdaUpdateWrapper<Application> updateWrapper = Wrappers.lambdaUpdate();
- updateWrapper.eq(Application::getId, appParam.getId());
- updateWrapper.set(Application::getRelease, appParam.getRelease());
- updateWrapper.set(Application::getBuild, appParam.getBuild());
+ public void updateRelease(FlinkApplication appParam) {
+ LambdaUpdateWrapper<FlinkApplication> updateWrapper = Wrappers.lambdaUpdate();
+ updateWrapper.eq(FlinkApplication::getId, appParam.getId());
+ updateWrapper.set(FlinkApplication::getRelease, appParam.getRelease());
+ updateWrapper.set(FlinkApplication::getBuild, appParam.getBuild());
if (appParam.getOptionState() != null) {
- updateWrapper.set(Application::getOptionState, appParam.getOptionState());
+ updateWrapper.set(FlinkApplication::getOptionState, appParam.getOptionState());
}
this.update(updateWrapper);
}
@Override
- public List<Application> listByProjectId(Long id) {
+ public List<FlinkApplication> listByProjectId(Long id) {
return baseMapper.selectAppsByProjectId(id);
}
@Override
- public List<Application> listByTeamId(Long teamId) {
+ public List<FlinkApplication> listByTeamId(Long teamId) {
return baseMapper.selectAppsByTeamId(teamId);
}
@Override
- public List<Application> listByTeamIdAndExecutionModes(
- Long teamId,
- @Nonnull Collection<FlinkExecutionMode> executionModeEnums) {
+ public List<FlinkApplication> listByTeamIdAndDeployModes(
+ Long teamId,
+ @Nonnull Collection<FlinkDeployMode> deployModeEnums) {
return getBaseMapper()
.selectList(
- new LambdaQueryWrapper<Application>()
- .eq((SFunction<Application, Long>) Application::getTeamId,
+ new LambdaQueryWrapper<FlinkApplication>()
+ .eq((SFunction<FlinkApplication, Long>) FlinkApplication::getTeamId,
teamId)
.in(
- Application::getExecutionMode,
- executionModeEnums.stream()
- .map(FlinkExecutionMode::getMode)
+ FlinkApplication::getDeployMode,
+ deployModeEnums.stream()
+ .map(FlinkDeployMode::getMode)
.collect(Collectors.toSet())));
}
@Override
- public boolean checkBuildAndUpdate(Application appParam) {
+ public boolean checkBuildAndUpdate(FlinkApplication appParam) {
boolean build = appParam.getBuild();
if (!build) {
- LambdaUpdateWrapper<Application> updateWrapper = Wrappers.lambdaUpdate();
- updateWrapper.eq(Application::getId, appParam.getId());
+ LambdaUpdateWrapper<FlinkApplication> updateWrapper = Wrappers.lambdaUpdate();
+ updateWrapper.eq(FlinkApplication::getId, appParam.getId());
if (appParam.isRunning()) {
- updateWrapper.set(Application::getRelease, ReleaseStateEnum.NEED_RESTART.get());
+ updateWrapper.set(FlinkApplication::getRelease, ReleaseStateEnum.NEED_RESTART.get());
} else {
- updateWrapper.set(Application::getRelease, ReleaseStateEnum.DONE.get());
- updateWrapper.set(Application::getOptionState, OptionStateEnum.NONE.getValue());
+ updateWrapper.set(FlinkApplication::getRelease, ReleaseStateEnum.DONE.get());
+ updateWrapper.set(FlinkApplication::getOptionState, OptionStateEnum.NONE.getValue());
}
this.update(updateWrapper);
@@ -723,15 +723,15 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
}
@Override
- public void clean(Application appParam) {
+ public void clean(FlinkApplication appParam) {
appParam.setRelease(ReleaseStateEnum.DONE.get());
this.updateRelease(appParam);
}
@Override
- public Application getApp(Long id) {
- Application application = this.baseMapper.selectApp(id);
- ApplicationConfig config = configService.getEffective(id);
+ public FlinkApplication getApp(Long id) {
+ FlinkApplication application = this.baseMapper.selectApp(id);
+ FlinkApplicationConfig config = configService.getEffective(id);
config = config == null ? configService.getLatest(id) : config;
if (config != null) {
config.setToApplication(application);
@@ -771,8 +771,8 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
* @return <code>true</code> if validate it successfully, <code>false</code> else.
*/
@VisibleForTesting
- public boolean validateQueueIfNeeded(Application appParam) {
- yarnQueueService.checkQueueLabel(appParam.getFlinkExecutionMode(), appParam.getYarnQueue());
+ public boolean validateQueueIfNeeded(FlinkApplication appParam) {
+ yarnQueueService.checkQueueLabel(appParam.getFlinkDeployMode(), appParam.getYarnQueue());
if (!isYarnNotDefaultQueue(appParam)) {
return true;
}
@@ -787,14 +787,14 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
* @return <code>true</code> if validate it successfully, <code>false</code> else.
*/
@VisibleForTesting
- public boolean validateQueueIfNeeded(Application oldApp, Application newApp) {
- yarnQueueService.checkQueueLabel(newApp.getFlinkExecutionMode(), newApp.getYarnQueue());
+ public boolean validateQueueIfNeeded(FlinkApplication oldApp, FlinkApplication newApp) {
+ yarnQueueService.checkQueueLabel(newApp.getFlinkDeployMode(), newApp.getYarnQueue());
if (!isYarnNotDefaultQueue(newApp)) {
return true;
}
oldApp.setYarnQueueByHotParams();
- if (FlinkExecutionMode.isYarnPerJobOrAppMode(newApp.getFlinkExecutionMode())
+ if (FlinkDeployMode.isYarnPerJobOrAppMode(newApp.getFlinkDeployMode())
&& StringUtils.equals(oldApp.getYarnQueue(), newApp.getYarnQueue())) {
return true;
}
@@ -806,16 +806,16 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
* empty queue label.
*
* @param application application entity.
- * @return If the executionMode is (Yarn PerJob or application mode) and the queue label is not
+ * @return If the deployMode is (Yarn PerJob or application mode) and the queue label is not
* (empty or default), return true, false else.
*/
- private boolean isYarnNotDefaultQueue(Application application) {
- return FlinkExecutionMode.isYarnPerJobOrAppMode(application.getFlinkExecutionMode())
+ private boolean isYarnNotDefaultQueue(FlinkApplication application) {
+ return FlinkDeployMode.isYarnPerJobOrAppMode(application.getFlinkDeployMode())
&& !yarnQueueService.isDefaultQueue(application.getYarnQueue());
}
- private boolean isK8sPodTemplateChanged(Application application, Application appParam) {
- return FlinkExecutionMode.isKubernetesMode(appParam.getExecutionMode())
+ private boolean isK8sPodTemplateChanged(FlinkApplication application, FlinkApplication appParam) {
+ return FlinkDeployMode.isKubernetesMode(appParam.getDeployMode())
&& (ObjectUtils.trimNoEquals(
application.getK8sRestExposedType(), appParam.getK8sRestExposedType())
|| ObjectUtils.trimNoEquals(
@@ -833,9 +833,9 @@ public class ApplicationManageServiceImpl extends ServiceImpl<ApplicationMapper,
appParam.getFlinkImage()));
}
- private boolean isYarnApplicationModeChange(Application application, Application appParam) {
- return !application.getExecutionMode().equals(appParam.getExecutionMode())
- && (FlinkExecutionMode.YARN_APPLICATION == appParam.getFlinkExecutionMode()
- || FlinkExecutionMode.YARN_APPLICATION == application.getFlinkExecutionMode());
+ private boolean isYarnApplicationModeChange(FlinkApplication application, FlinkApplication appParam) {
+ return !application.getDeployMode().equals(appParam.getDeployMode())
+ && (FlinkDeployMode.YARN_APPLICATION == appParam.getFlinkDeployMode()
+ || FlinkDeployMode.YARN_APPLICATION == application.getFlinkDeployMode());
}
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationActionServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationActionServiceImpl.java
index f68dc3ea1..e6e89b479 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationActionServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationActionServiceImpl.java
@@ -21,8 +21,8 @@ import org.apache.streampark.common.conf.ConfigKeys;
import org.apache.streampark.common.conf.Workspace;
import org.apache.streampark.common.constants.Constants;
import org.apache.streampark.common.enums.ApplicationType;
-import org.apache.streampark.common.enums.SparkDevelopmentMode;
-import org.apache.streampark.common.enums.SparkExecutionMode;
+import org.apache.streampark.common.enums.SparkDeployMode;
+import org.apache.streampark.common.enums.SparkJobType;
import org.apache.streampark.common.fs.FsOperator;
import org.apache.streampark.common.util.AssertUtils;
import org.apache.streampark.common.util.DeflaterUtils;
@@ -210,7 +210,7 @@ public class SparkApplicationActionServiceImpl
new StopRequest(
application.getId(),
sparkEnv.getSparkVersion(),
- SparkExecutionMode.of(application.getExecutionMode()),
+ SparkDeployMode.of(application.getDeployMode()),
stopProper,
application.getAppId());
@@ -255,7 +255,7 @@ public class SparkApplicationActionServiceImpl
SparkEnv sparkEnv = sparkEnvService.getByIdOrDefault(application.getVersionId());
ApiAlertException.throwIfNull(sparkEnv, "[StreamPark] can no found spark version");
- if (SparkExecutionMode.isYarnMode(application.getSparkExecutionMode())) {
+ if (SparkDeployMode.isYarnMode(application.getSparkDeployMode())) {
checkYarnBeforeStart(application);
}
@@ -298,7 +298,7 @@ public class SparkApplicationActionServiceImpl
String appConf = userJarAndAppConf.f1;
BuildResult buildResult = buildPipeline.getBuildResult();
- if (SparkExecutionMode.isYarnMode(application.getSparkExecutionMode())) {
+ if (SparkDeployMode.isYarnMode(application.getSparkDeployMode())) {
buildResult = new ShadedBuildResponse(null, sparkUserJar, true);
if (StringUtils.isNotBlank(application.getYarnQueueName())) {
extraParameter.put(ConfigKeys.KEY_SPARK_YARN_QUEUE_NAME(), application.getYarnQueueName());
@@ -314,9 +314,9 @@ public class SparkApplicationActionServiceImpl
SubmitRequest submitRequest = new SubmitRequest(
sparkEnv.getSparkVersion(),
- SparkExecutionMode.of(application.getExecutionMode()),
+ SparkDeployMode.of(application.getDeployMode()),
sparkEnv.getSparkConf(),
- SparkDevelopmentMode.valueOf(application.getJobType()),
+ SparkJobType.valueOf(application.getJobType()),
application.getId(),
application.getAppName(),
application.getMainClass(),
@@ -410,11 +410,11 @@ public class SparkApplicationActionServiceImpl
private Tuple2<String, String> getUserJarAndAppConf(
SparkEnv sparkEnv, SparkApplication application) {
- SparkExecutionMode executionModeEnum = application.getSparkExecutionMode();
+ SparkDeployMode deployModeEnum = application.getSparkDeployMode();
SparkApplicationConfig applicationConfig = configService.getEffective(application.getId());
ApiAlertException.throwIfNull(
- executionModeEnum, "ExecutionMode can't be null, start application failed.");
+ deployModeEnum, "DeployMode can't be null, start application failed.");
String sparkUserJar = null;
String appConf = null;
@@ -430,7 +430,7 @@ public class SparkApplicationActionServiceImpl
? null
: String.format("yaml://%s", applicationConfig.getContent());
// 3) client
- if (SparkExecutionMode.YARN_CLUSTER == executionModeEnum) {
+ if (SparkDeployMode.YARN_CLUSTER == deployModeEnum) {
String clientPath = Workspace.remote().APP_CLIENT();
sparkUserJar = String.format("%s/%s", clientPath, sqlDistJar);
}
@@ -483,7 +483,7 @@ public class SparkApplicationActionServiceImpl
}
}
- if (SparkExecutionMode.isYarnMode(executionModeEnum)) {
+ if (SparkDeployMode.isYarnMode(deployModeEnum)) {
switch (application.getApplicationType()) {
case STREAMPARK_SPARK:
sparkUserJar = String.format(
@@ -522,7 +522,7 @@ public class SparkApplicationActionServiceImpl
updateById(application);
SparkAppHttpWatcher.unWatching(application.getId());
// kill application
- if (SparkExecutionMode.isYarnMode(application.getSparkExecutionMode())) {
+ if (SparkDeployMode.isYarnMode(application.getSparkDeployMode())) {
try {
List<ApplicationReport> applications = applicationInfoService
.getYarnAppReport(application.getAppName());
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationInfoServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationInfoServiceImpl.java
index 9b27e5aa8..d7dfa8860 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationInfoServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationInfoServiceImpl.java
@@ -18,7 +18,7 @@
package org.apache.streampark.console.core.service.application.impl;
import org.apache.streampark.common.enums.ApplicationType;
-import org.apache.streampark.common.enums.SparkExecutionMode;
+import org.apache.streampark.common.enums.SparkDeployMode;
import org.apache.streampark.common.util.ExceptionUtils;
import org.apache.streampark.common.util.HadoopUtils;
import org.apache.streampark.common.util.YarnUtils;
@@ -216,7 +216,7 @@ public class SparkApplicationInfoServiceImpl
if (application == null) {
return AppExistsStateEnum.INVALID;
}
- if (SparkExecutionMode.isYarnMode(application.getExecutionMode())) {
+ if (SparkDeployMode.isYarnMode(application.getDeployMode())) {
boolean exists = !getYarnAppReport(application.getAppName()).isEmpty();
return exists ? AppExistsStateEnum.IN_YARN : AppExistsStateEnum.NO;
}
@@ -284,7 +284,7 @@ public class SparkApplicationInfoServiceImpl
// has stopped status
if (SparkAppStateEnum.isEndState(app.getState())) {
// check whether jobName exists on yarn
- if (SparkExecutionMode.isYarnMode(appParam.getExecutionMode())
+ if (SparkDeployMode.isYarnMode(appParam.getDeployMode())
&& YarnUtils.isContains(appParam.getAppName())) {
return AppExistsStateEnum.IN_YARN;
}
@@ -295,7 +295,7 @@ public class SparkApplicationInfoServiceImpl
}
// check whether jobName exists on yarn
- if (SparkExecutionMode.isYarnMode(appParam.getExecutionMode())
+ if (SparkDeployMode.isYarnMode(appParam.getDeployMode())
&& YarnUtils.isContains(appParam.getAppName())) {
return AppExistsStateEnum.IN_YARN;
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationManageServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationManageServiceImpl.java
index c08830524..c60667478 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationManageServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/SparkApplicationManageServiceImpl.java
@@ -19,7 +19,7 @@ package org.apache.streampark.console.core.service.application.impl;
import org.apache.streampark.common.conf.Workspace;
import org.apache.streampark.common.constants.Constants;
-import org.apache.streampark.common.enums.SparkExecutionMode;
+import org.apache.streampark.common.enums.SparkDeployMode;
import org.apache.streampark.common.enums.StorageType;
import org.apache.streampark.common.fs.HdfsOperator;
import org.apache.streampark.common.util.DeflaterUtils;
@@ -322,7 +322,7 @@ public class SparkApplicationManageServiceImpl
newApp.setAppType(oldApp.getAppType());
newApp.setVersionId(oldApp.getVersionId());
newApp.setAppName(appParam.getAppName());
- newApp.setExecutionMode(oldApp.getExecutionMode());
+ newApp.setDeployMode(oldApp.getDeployMode());
newApp.setResourceFrom(oldApp.getResourceFrom());
newApp.setProjectId(oldApp.getProjectId());
newApp.setModule(oldApp.getModule());
@@ -385,7 +385,7 @@ public class SparkApplicationManageServiceImpl
SparkApplication application = getById(appParam.getId());
/* If the original mode is remote, k8s-session, yarn-session, check cluster status */
- SparkExecutionMode sparkExecutionMode = application.getSparkExecutionMode();
+ SparkDeployMode sparkDeployMode = application.getSparkDeployMode();
boolean success = validateQueueIfNeeded(application, appParam);
ApiAlertException.throwIfFalse(
@@ -429,7 +429,7 @@ public class SparkApplicationManageServiceImpl
// changes to the following parameters need to be re-release to take effect
application.setVersionId(appParam.getVersionId());
application.setAppName(appParam.getAppName());
- application.setExecutionMode(appParam.getExecutionMode());
+ application.setDeployMode(appParam.getDeployMode());
application.setAppProperties(appParam.getAppProperties());
application.setAppArgs(appParam.getAppArgs());
application.setOptions(appParam.getOptions());
@@ -449,7 +449,7 @@ public class SparkApplicationManageServiceImpl
application.setRestartSize(appParam.getRestartSize());
application.setTags(appParam.getTags());
- switch (appParam.getSparkExecutionMode()) {
+ switch (appParam.getSparkDeployMode()) {
case YARN_CLUSTER:
case YARN_CLIENT:
application.setHadoopUser(appParam.getHadoopUser());
@@ -568,18 +568,18 @@ public class SparkApplicationManageServiceImpl
}
@Override
- public List<SparkApplication> listByTeamIdAndExecutionModes(
- Long teamId,
- Collection<SparkExecutionMode> executionModeEnums) {
+ public List<SparkApplication> listByTeamIdAndDeployModes(
+ Long teamId,
+ Collection<SparkDeployMode> deployModeEnums) {
return getBaseMapper()
.selectList(
new LambdaQueryWrapper<SparkApplication>()
.eq((SFunction<SparkApplication, Long>) SparkApplication::getTeamId,
teamId)
.in(
- SparkApplication::getExecutionMode,
- executionModeEnums.stream()
- .map(SparkExecutionMode::getMode)
+ SparkApplication::getDeployMode,
+ deployModeEnums.stream()
+ .map(SparkDeployMode::getMode)
.collect(Collectors.toSet())));
}
@@ -648,7 +648,7 @@ public class SparkApplicationManageServiceImpl
*/
@VisibleForTesting
public boolean validateQueueIfNeeded(SparkApplication appParam) {
- yarnQueueService.checkQueueLabel(appParam.getSparkExecutionMode(), appParam.getYarnQueue());
+ yarnQueueService.checkQueueLabel(appParam.getSparkDeployMode(), appParam.getYarnQueue());
if (!isYarnNotDefaultQueue(appParam)) {
return true;
}
@@ -664,13 +664,13 @@ public class SparkApplicationManageServiceImpl
*/
@VisibleForTesting
public boolean validateQueueIfNeeded(SparkApplication oldApp, SparkApplication newApp) {
- yarnQueueService.checkQueueLabel(newApp.getSparkExecutionMode(), newApp.getYarnQueue());
+ yarnQueueService.checkQueueLabel(newApp.getSparkDeployMode(), newApp.getYarnQueue());
if (!isYarnNotDefaultQueue(newApp)) {
return true;
}
oldApp.resolveYarnQueue();
- if (SparkExecutionMode.isYarnMode(newApp.getSparkExecutionMode())
+ if (SparkDeployMode.isYarnMode(newApp.getSparkDeployMode())
&& StringUtils.equals(oldApp.getYarnQueue(), newApp.getYarnQueue())) {
return true;
}
@@ -682,18 +682,18 @@ public class SparkApplicationManageServiceImpl
* empty queue label.
*
* @param application application entity.
- * @return If the executionMode is (Yarn PerJob or application mode) and the queue label is not
+ * @return If the deployMode is (Yarn PerJob or application mode) and the queue label is not
* (empty or default), return true, false else.
*/
private boolean isYarnNotDefaultQueue(SparkApplication application) {
- return SparkExecutionMode.isYarnMode(application.getSparkExecutionMode())
+ return SparkDeployMode.isYarnMode(application.getSparkDeployMode())
&& !yarnQueueService.isDefaultQueue(application.getYarnQueue());
}
private boolean isYarnApplicationModeChange(
SparkApplication application, SparkApplication appParam) {
- return !application.getExecutionMode().equals(appParam.getExecutionMode())
- && (SparkExecutionMode.YARN_CLIENT == appParam.getSparkExecutionMode()
- || SparkExecutionMode.YARN_CLUSTER == application.getSparkExecutionMode());
+ return !application.getDeployMode().equals(appParam.getDeployMode())
+ && (SparkDeployMode.YARN_CLIENT == appParam.getSparkDeployMode()
+ || SparkDeployMode.YARN_CLUSTER == application.getSparkDeployMode());
}
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java
index d78d2f751..bc17e47b0 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java
@@ -20,8 +20,8 @@ package org.apache.streampark.console.core.service.impl;
import org.apache.streampark.common.conf.Workspace;
import org.apache.streampark.common.constants.Constants;
import org.apache.streampark.common.enums.ApplicationType;
-import org.apache.streampark.common.enums.FlinkDevelopmentMode;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
+import org.apache.streampark.common.enums.FlinkJobType;
import org.apache.streampark.common.fs.FsOperator;
import org.apache.streampark.common.util.AssertUtils;
import org.apache.streampark.common.util.ExceptionUtils;
@@ -32,9 +32,9 @@ import org.apache.streampark.console.base.util.WebUtils;
import org.apache.streampark.console.core.bean.Dependency;
import org.apache.streampark.console.core.bean.DockerConfig;
import org.apache.streampark.console.core.entity.AppBuildPipeline;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
import org.apache.streampark.console.core.entity.ApplicationLog;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
import org.apache.streampark.console.core.entity.FlinkEnv;
import org.apache.streampark.console.core.entity.FlinkSql;
import org.apache.streampark.console.core.entity.Message;
@@ -46,17 +46,17 @@ import org.apache.streampark.console.core.enums.ReleaseStateEnum;
import org.apache.streampark.console.core.enums.ResourceTypeEnum;
import org.apache.streampark.console.core.mapper.ApplicationBuildPipelineMapper;
import org.apache.streampark.console.core.service.AppBuildPipeService;
-import org.apache.streampark.console.core.service.ApplicationBackUpService;
-import org.apache.streampark.console.core.service.ApplicationConfigService;
import org.apache.streampark.console.core.service.ApplicationLogService;
+import org.apache.streampark.console.core.service.FlinkApplicationBackUpService;
+import org.apache.streampark.console.core.service.FlinkApplicationConfigService;
import org.apache.streampark.console.core.service.FlinkEnvService;
import org.apache.streampark.console.core.service.FlinkSqlService;
import org.apache.streampark.console.core.service.MessageService;
import org.apache.streampark.console.core.service.ResourceService;
import org.apache.streampark.console.core.service.SettingService;
-import org.apache.streampark.console.core.service.application.ApplicationActionService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationActionService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.util.ServiceHelper;
import org.apache.streampark.console.core.watcher.FlinkAppHttpWatcher;
import org.apache.streampark.flink.packer.docker.DockerConf;
@@ -129,7 +129,7 @@ public class AppBuildPipeServiceImpl
private FlinkSqlService flinkSqlService;
@Autowired
- private ApplicationBackUpService backUpService;
+ private FlinkApplicationBackUpService backUpService;
@Autowired
private SettingService settingService;
@@ -138,10 +138,10 @@ public class AppBuildPipeServiceImpl
private MessageService messageService;
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@Autowired
private ApplicationLogService applicationLogService;
@@ -150,7 +150,7 @@ public class AppBuildPipeServiceImpl
private FlinkAppHttpWatcher flinkAppHttpWatcher;
@Autowired
- private ApplicationConfigService applicationConfigService;
+ private FlinkApplicationConfigService applicationConfigService;
@Autowired
private ResourceService resourceService;
@@ -180,7 +180,7 @@ public class AppBuildPipeServiceImpl
// check the build environment
checkBuildEnv(appId, forceBuild);
- Application app = applicationManageService.getById(appId);
+ FlinkApplication app = applicationManageService.getById(appId);
ApplicationLog applicationLog = getApplicationLog(app);
// check if you need to go through the build process (if the jar and pom have changed,
@@ -325,7 +325,7 @@ public class AppBuildPipeServiceImpl
applicationManageService.toEffective(app);
} else {
if (app.isStreamParkJob()) {
- ApplicationConfig config =
+ FlinkApplicationConfig config =
applicationConfigService.getLatest(app.getId());
if (config != null) {
config.setToApplication(app);
@@ -383,7 +383,7 @@ public class AppBuildPipeServiceImpl
return saved;
}
- private void registerDockerProgressWatcher(BuildPipeline pipeline, Application app) {
+ private void registerDockerProgressWatcher(BuildPipeline pipeline, FlinkApplication app) {
pipeline
.as(FlinkK8sApplicationBuildPipeline.class)
.registerDockerProgressWatcher(
@@ -407,7 +407,7 @@ public class AppBuildPipeServiceImpl
}
@Nonnull
- private ApplicationLog getApplicationLog(Application app) {
+ private ApplicationLog getApplicationLog(FlinkApplication app) {
ApplicationLog applicationLog = new ApplicationLog();
applicationLog.setOptionName(RELEASE.getValue());
applicationLog.setAppId(app.getId());
@@ -423,7 +423,7 @@ public class AppBuildPipeServiceImpl
* @param forceBuild forced start pipeline or not
*/
private void checkBuildEnv(Long appId, boolean forceBuild) {
- Application app = applicationManageService.getById(appId);
+ FlinkApplication app = applicationManageService.getById(appId);
// 1) check flink version
String checkEnvErrorMessage = "Check flink env failed, please check the flink version of this job";
@@ -444,7 +444,7 @@ public class AppBuildPipeServiceImpl
}
/** create building pipeline instance */
- private BuildPipeline createPipelineInstance(@Nonnull Application app) {
+ private BuildPipeline createPipelineInstance(@Nonnull FlinkApplication app) {
FlinkEnv flinkEnv = flinkEnvService.getByIdOrDefault(app.getVersionId());
String flinkUserJar = retrieveFlinkUserJar(flinkEnv, app);
@@ -455,13 +455,13 @@ public class AppBuildPipeServiceImpl
}
}
- FlinkExecutionMode executionModeEnum = app.getFlinkExecutionMode();
+ FlinkDeployMode deployModeEnum = app.getFlinkDeployMode();
String mainClass = Constants.STREAMPARK_FLINKSQL_CLIENT_CLASS;
- switch (executionModeEnum) {
+ switch (deployModeEnum) {
case YARN_APPLICATION:
String yarnProvidedPath = app.getAppLib();
String localWorkspace = app.getLocalAppHome().concat("/lib");
- if (FlinkDevelopmentMode.CUSTOM_CODE == app.getDevelopmentMode()
+ if (FlinkJobType.CUSTOM_CODE == app.getDevelopmentMode()
&& ApplicationType.APACHE_FLINK == app.getApplicationType()) {
yarnProvidedPath = app.getAppHome();
localWorkspace = app.getLocalAppHome();
@@ -490,13 +490,13 @@ public class AppBuildPipeServiceImpl
return FlinkK8sApplicationBuildPipeline.of(k8sApplicationBuildRequest);
default:
throw new UnsupportedOperationException(
- "Unsupported Building Application for ExecutionMode: " + app.getFlinkExecutionMode());
+ "Unsupported Building Application for DeployMode: " + app.getFlinkDeployMode());
}
}
@Nonnull
private FlinkYarnApplicationBuildRequest buildFlinkYarnApplicationBuildRequest(
- @Nonnull Application app,
+ @Nonnull FlinkApplication app,
String mainClass,
String localWorkspace,
String yarnProvidedPath) {
@@ -511,7 +511,7 @@ public class AppBuildPipeServiceImpl
@Nonnull
private FlinkK8sApplicationBuildRequest buildFlinkK8sApplicationBuildRequest(
- @Nonnull Application app,
+ @Nonnull FlinkApplication app,
String mainClass,
String flinkUserJar,
FlinkEnv flinkEnv,
@@ -521,7 +521,7 @@ public class AppBuildPipeServiceImpl
app.getLocalAppHome(),
mainClass,
flinkUserJar,
- app.getFlinkExecutionMode(),
+ app.getFlinkDeployMode(),
app.getDevelopmentMode(),
flinkEnv.getFlinkVersion(),
getMergedDependencyInfo(app),
@@ -541,14 +541,15 @@ public class AppBuildPipeServiceImpl
@Nonnull
private FlinkK8sSessionBuildRequest buildFlinkK8sSessionBuildRequest(
- @Nonnull Application app, String mainClass,
+ @Nonnull FlinkApplication app,
+ String mainClass,
String flinkUserJar, FlinkEnv flinkEnv) {
FlinkK8sSessionBuildRequest k8sSessionBuildRequest = new FlinkK8sSessionBuildRequest(
app.getJobName(),
app.getLocalAppHome(),
mainClass,
flinkUserJar,
- app.getFlinkExecutionMode(),
+ app.getFlinkDeployMode(),
app.getDevelopmentMode(),
flinkEnv.getFlinkVersion(),
getMergedDependencyInfo(app),
@@ -559,7 +560,8 @@ public class AppBuildPipeServiceImpl
@Nonnull
private FlinkRemotePerJobBuildRequest buildFlinkRemotePerJobBuildRequest(
- @Nonnull Application app, String mainClass,
+ @Nonnull FlinkApplication app,
+ String mainClass,
String flinkUserJar, FlinkEnv flinkEnv) {
return new FlinkRemotePerJobBuildRequest(
app.getJobName(),
@@ -567,14 +569,14 @@ public class AppBuildPipeServiceImpl
mainClass,
flinkUserJar,
app.isCustomCodeJob(),
- app.getFlinkExecutionMode(),
+ app.getFlinkDeployMode(),
app.getDevelopmentMode(),
flinkEnv.getFlinkVersion(),
getMergedDependencyInfo(app));
}
- /** copy from {@link ApplicationActionService#start(Application, boolean)} */
- private String retrieveFlinkUserJar(FlinkEnv flinkEnv, Application app) {
+ /** copy from {@link FlinkApplicationActionService#start(FlinkApplication, boolean)} */
+ private String retrieveFlinkUserJar(FlinkEnv flinkEnv, FlinkApplication app) {
switch (app.getDevelopmentMode()) {
case CUSTOM_CODE:
switch (app.getApplicationType()) {
@@ -592,7 +594,7 @@ public class AppBuildPipeServiceImpl
return String.format("%s/%s", app.getAppHome(), app.getJar());
case FLINK_SQL:
String sqlDistJar = ServiceHelper.getFlinkSqlClientJar(flinkEnv);
- if (app.getFlinkExecutionMode() == FlinkExecutionMode.YARN_APPLICATION) {
+ if (app.getFlinkDeployMode() == FlinkDeployMode.YARN_APPLICATION) {
String clientPath = Workspace.remote().APP_CLIENT();
return String.format("%s/%s", clientPath, sqlDistJar);
}
@@ -685,7 +687,7 @@ public class AppBuildPipeServiceImpl
* @param application
* @return DependencyInfo
*/
- private DependencyInfo getMergedDependencyInfo(Application application) {
+ private DependencyInfo getMergedDependencyInfo(FlinkApplication application) {
DependencyInfo dependencyInfo = application.getDependencyInfo();
if (StringUtils.isBlank(application.getTeamResource())) {
return dependencyInfo;
@@ -730,7 +732,7 @@ public class AppBuildPipeServiceImpl
}
private static void mergeDependency(
- Application application,
+ FlinkApplication application,
List<Artifact> mvnArtifacts,
List<String> jarLibs,
Resource resource) {
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/DistributedTaskServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/DistributedTaskServiceImpl.java
index 2af70aed4..68fdf6b5a 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/DistributedTaskServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/DistributedTaskServiceImpl.java
@@ -20,13 +20,13 @@ package org.apache.streampark.console.core.service.impl;
import org.apache.streampark.console.base.util.ConsistentHash;
import org.apache.streampark.console.base.util.JacksonUtils;
import org.apache.streampark.console.core.bean.FlinkTaskItem;
-import org.apache.streampark.console.core.entity.Application;
import org.apache.streampark.console.core.entity.DistributedTask;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.enums.DistributedTaskEnum;
import org.apache.streampark.console.core.enums.EngineTypeEnum;
import org.apache.streampark.console.core.mapper.DistributedTaskMapper;
import org.apache.streampark.console.core.service.DistributedTaskService;
-import org.apache.streampark.console.core.service.application.ApplicationActionService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationActionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -57,7 +57,7 @@ public class DistributedTaskServiceImpl extends ServiceImpl<DistributedTaskMappe
private Executor taskExecutor;
@Autowired
- private ApplicationActionService applicationActionService;
+ private FlinkApplicationActionService applicationActionService;
/**
* Server Id
@@ -119,7 +119,7 @@ public class DistributedTaskServiceImpl extends ServiceImpl<DistributedTaskMappe
// Execute Distributed task
log.info("Execute Distributed task: {}", DistributedTask);
FlinkTaskItem flinkTaskItem = getFlinkTaskItem(DistributedTask);
- Application appParam = getAppByFlinkTaskItem(flinkTaskItem);
+ FlinkApplication appParam = getAppByFlinkTaskItem(flinkTaskItem);
switch (DistributedTask.getAction()) {
case START:
applicationActionService.start(appParam, flinkTaskItem.getAutoStart());
@@ -147,7 +147,7 @@ public class DistributedTaskServiceImpl extends ServiceImpl<DistributedTaskMappe
* @return List<Application> List of tasks that need to be monitored
*/
@Override
- public List<Application> getMonitoredTaskList(List<Application> applications) {
+ public List<FlinkApplication> getMonitoredTaskList(List<FlinkApplication> applications) {
return applications.stream()
.filter(application -> isLocalProcessing(application.getId()))
.collect(Collectors.toList());
@@ -192,7 +192,7 @@ public class DistributedTaskServiceImpl extends ServiceImpl<DistributedTaskMappe
* @param action It may be one of the following values: START, RESTART, REVOKE, CANCEL, ABORT
*/
@Override
- public void saveDistributedTask(Application appParam, boolean autoStart, DistributedTaskEnum action) {
+ public void saveDistributedTask(FlinkApplication appParam, boolean autoStart, DistributedTaskEnum action) {
try {
DistributedTask DistributedTask = getDistributedTaskByApp(appParam, autoStart, action);
this.save(DistributedTask);
@@ -201,7 +201,7 @@ public class DistributedTaskServiceImpl extends ServiceImpl<DistributedTaskMappe
}
}
- public DistributedTask getDistributedTaskByApp(Application appParam, boolean autoStart,
+ public DistributedTask getDistributedTaskByApp(FlinkApplication appParam, boolean autoStart,
DistributedTaskEnum action) throws JsonProcessingException {
FlinkTaskItem flinkTaskItem = new FlinkTaskItem();
flinkTaskItem.setAppId(appParam.getId());
@@ -225,8 +225,8 @@ public class DistributedTaskServiceImpl extends ServiceImpl<DistributedTaskMappe
return JacksonUtils.read(DistributedTask.getProperties(), FlinkTaskItem.class);
}
- public Application getAppByFlinkTaskItem(FlinkTaskItem flinkTaskItem) {
- Application appParam = new Application();
+ public FlinkApplication getAppByFlinkTaskItem(FlinkTaskItem flinkTaskItem) {
+ FlinkApplication appParam = new FlinkApplication();
appParam.setId(flinkTaskItem.getAppId());
appParam.setArgs(flinkTaskItem.getArgs());
appParam.setDynamicProperties(flinkTaskItem.getDynamicProperties());
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ExternalLinkServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ExternalLinkServiceImpl.java
index c1fe57b62..9aad2476b 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ExternalLinkServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ExternalLinkServiceImpl.java
@@ -19,12 +19,12 @@ package org.apache.streampark.console.core.service.impl;
import org.apache.streampark.common.util.AssertUtils;
import org.apache.streampark.console.base.exception.ApiAlertException;
-import org.apache.streampark.console.core.entity.Application;
import org.apache.streampark.console.core.entity.ExternalLink;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.enums.PlaceholderTypeEnum;
import org.apache.streampark.console.core.mapper.ExternalLinkMapper;
import org.apache.streampark.console.core.service.ExternalLinkService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -47,7 +47,7 @@ public class ExternalLinkServiceImpl extends ServiceImpl<ExternalLinkMapper, Ext
implements
ExternalLinkService {
- private final ApplicationManageService applicationManageService;
+ private final FlinkApplicationManageService applicationManageService;
@Override
public void create(ExternalLink externalLink) {
@@ -73,7 +73,7 @@ public class ExternalLinkServiceImpl extends ServiceImpl<ExternalLinkMapper, Ext
@Override
public List<ExternalLink> render(Long appId) {
- Application app = applicationManageService.getById(appId);
+ FlinkApplication app = applicationManageService.getById(appId);
AssertUtils.notNull(app, "Application doesn't exist");
List<ExternalLink> externalLink = this.list();
if (externalLink != null && externalLink.size() > 0) {
@@ -83,7 +83,7 @@ public class ExternalLinkServiceImpl extends ServiceImpl<ExternalLinkMapper, Ext
return externalLink;
}
- private void renderLinkUrl(ExternalLink link, Application app) {
+ private void renderLinkUrl(ExternalLink link, FlinkApplication app) {
Map<String, String> placeholderValueMap = new HashMap<>();
placeholderValueMap.put(PlaceholderTypeEnum.ID.get(), String.valueOf(app.getId()));
placeholderValueMap.put(PlaceholderTypeEnum.JOB_ID.get(), app.getJobId());
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationBackUpServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkApplicationBackUpServiceImpl.java
similarity index 68%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationBackUpServiceImpl.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkApplicationBackUpServiceImpl.java
index 9b9434d6f..fdbc9a794 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationBackUpServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkApplicationBackUpServiceImpl.java
@@ -22,18 +22,18 @@ import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.exception.InternalException;
import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationBackUp;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationBackUp;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
import org.apache.streampark.console.core.entity.FlinkSql;
import org.apache.streampark.console.core.enums.EffectiveTypeEnum;
import org.apache.streampark.console.core.enums.ReleaseStateEnum;
-import org.apache.streampark.console.core.mapper.ApplicationBackUpMapper;
-import org.apache.streampark.console.core.service.ApplicationBackUpService;
-import org.apache.streampark.console.core.service.ApplicationConfigService;
+import org.apache.streampark.console.core.mapper.FlinkApplicationBackUpMapper;
import org.apache.streampark.console.core.service.EffectiveService;
+import org.apache.streampark.console.core.service.FlinkApplicationBackUpService;
+import org.apache.streampark.console.core.service.FlinkApplicationConfigService;
import org.apache.streampark.console.core.service.FlinkSqlService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -49,17 +49,17 @@ import org.springframework.transaction.annotation.Transactional;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
-public class ApplicationBackUpServiceImpl
+public class FlinkApplicationBackUpServiceImpl
extends
- ServiceImpl<ApplicationBackUpMapper, ApplicationBackUp>
+ ServiceImpl<FlinkApplicationBackUpMapper, FlinkApplicationBackUp>
implements
- ApplicationBackUpService {
+ FlinkApplicationBackUpService {
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
- private ApplicationConfigService configService;
+ private FlinkApplicationConfigService configService;
@Autowired
private EffectiveService effectiveService;
@@ -68,17 +68,17 @@ public class ApplicationBackUpServiceImpl
private FlinkSqlService flinkSqlService;
@Override
- public IPage<ApplicationBackUp> getPage(ApplicationBackUp bakParam, RestRequest request) {
- Page<ApplicationBackUp> page = MybatisPager.getPage(request);
- LambdaQueryWrapper<ApplicationBackUp> queryWrapper = new LambdaQueryWrapper<ApplicationBackUp>()
- .eq(ApplicationBackUp::getAppId, bakParam.getAppId());
+ public IPage<FlinkApplicationBackUp> getPage(FlinkApplicationBackUp bakParam, RestRequest request) {
+ Page<FlinkApplicationBackUp> page = MybatisPager.getPage(request);
+ LambdaQueryWrapper<FlinkApplicationBackUp> queryWrapper = new LambdaQueryWrapper<FlinkApplicationBackUp>()
+ .eq(FlinkApplicationBackUp::getAppId, bakParam.getAppId());
return this.baseMapper.selectPage(page, queryWrapper);
}
@Override
- public void rollback(ApplicationBackUp bakParam) {
+ public void rollback(FlinkApplicationBackUp bakParam) {
- Application application = applicationManageService.getById(bakParam.getAppId());
+ FlinkApplication application = applicationManageService.getById(bakParam.getAppId());
FsOperator fsOperator = application.getFsOperator();
// backup files not exist
@@ -125,23 +125,23 @@ public class ApplicationBackUpServiceImpl
// update restart status
applicationManageService.update(
- new UpdateWrapper<Application>()
+ new UpdateWrapper<FlinkApplication>()
.lambda()
- .eq(Application::getId, application.getId())
- .set(Application::getRelease, ReleaseStateEnum.NEED_RESTART.get()));
+ .eq(FlinkApplication::getId, application.getId())
+ .set(FlinkApplication::getRelease, ReleaseStateEnum.NEED_RESTART.get()));
}
@Override
- public void revoke(Application appParam) {
- Page<ApplicationBackUp> page = new Page<>();
+ public void revoke(FlinkApplication appParam) {
+ Page<FlinkApplicationBackUp> page = new Page<>();
page.setCurrent(0).setSize(1).setSearchCount(false);
- LambdaQueryWrapper<ApplicationBackUp> queryWrapper = new LambdaQueryWrapper<ApplicationBackUp>()
- .eq(ApplicationBackUp::getAppId, appParam.getId())
- .orderByDesc(ApplicationBackUp::getCreateTime);
+ LambdaQueryWrapper<FlinkApplicationBackUp> queryWrapper = new LambdaQueryWrapper<FlinkApplicationBackUp>()
+ .eq(FlinkApplicationBackUp::getAppId, appParam.getId())
+ .orderByDesc(FlinkApplicationBackUp::getCreateTime);
- Page<ApplicationBackUp> backUpPages = baseMapper.selectPage(page, queryWrapper);
+ Page<FlinkApplicationBackUp> backUpPages = baseMapper.selectPage(page, queryWrapper);
if (!backUpPages.getRecords().isEmpty()) {
- ApplicationBackUp backup = backUpPages.getRecords().get(0);
+ FlinkApplicationBackUp backup = backUpPages.getRecords().get(0);
String path = backup.getPath();
appParam.getFsOperator().move(path, appParam.getWorkspace().APP_WORKSPACE());
super.removeById(backup.getId());
@@ -149,11 +149,11 @@ public class ApplicationBackUpServiceImpl
}
@Override
- public void remove(Application appParam) {
+ public void remove(FlinkApplication appParam) {
try {
baseMapper.delete(
- new LambdaQueryWrapper<ApplicationBackUp>()
- .eq(ApplicationBackUp::getAppId, appParam.getId()));
+ new LambdaQueryWrapper<FlinkApplicationBackUp>()
+ .eq(FlinkApplicationBackUp::getAppId, appParam.getId()));
appParam
.getFsOperator()
.delete(
@@ -168,11 +168,11 @@ public class ApplicationBackUpServiceImpl
}
@Override
- public void rollbackFlinkSql(Application appParam, FlinkSql flinkSqlParam) {
- LambdaQueryWrapper<ApplicationBackUp> queryWrapper = new LambdaQueryWrapper<ApplicationBackUp>()
- .eq(ApplicationBackUp::getAppId, appParam.getId())
- .eq(ApplicationBackUp::getSqlId, flinkSqlParam.getId());
- ApplicationBackUp backUp = baseMapper.selectOne(queryWrapper);
+ public void rollbackFlinkSql(FlinkApplication appParam, FlinkSql flinkSqlParam) {
+ LambdaQueryWrapper<FlinkApplicationBackUp> queryWrapper = new LambdaQueryWrapper<FlinkApplicationBackUp>()
+ .eq(FlinkApplicationBackUp::getAppId, appParam.getId())
+ .eq(FlinkApplicationBackUp::getSqlId, flinkSqlParam.getId());
+ FlinkApplicationBackUp backUp = baseMapper.selectOne(queryWrapper);
ApiAlertException.throwIfNull(
backUp, "Application backup can't be null. Rollback flink sql failed.");
// rollback config and sql
@@ -182,9 +182,9 @@ public class ApplicationBackUpServiceImpl
@Override
public Boolean removeById(Long id) throws InternalException {
- ApplicationBackUp backUp = getById(id);
+ FlinkApplicationBackUp backUp = getById(id);
try {
- Application application = applicationManageService.getById(backUp.getAppId());
+ FlinkApplication application = applicationManageService.getById(backUp.getAppId());
application.getFsOperator().delete(backUp.getPath());
super.removeById(id);
return true;
@@ -194,7 +194,7 @@ public class ApplicationBackUpServiceImpl
}
@Override
- public void backup(Application appParam, FlinkSql flinkSqlParam) {
+ public void backup(FlinkApplication appParam, FlinkSql flinkSqlParam) {
// basic configuration file backup
String appHome = (appParam.isCustomCodeJob() && appParam.isCICDJob())
? appParam.getDistHome()
@@ -202,7 +202,7 @@ public class ApplicationBackUpServiceImpl
FsOperator fsOperator = appParam.getFsOperator();
if (fsOperator.exists(appHome)) {
// move files to back up directory
- ApplicationConfig config = configService.getEffective(appParam.getId());
+ FlinkApplicationConfig config = configService.getEffective(appParam.getId());
if (config != null) {
appParam.setConfigId(config.getId());
}
@@ -215,7 +215,7 @@ public class ApplicationBackUpServiceImpl
version = config.getVersion();
}
- ApplicationBackUp applicationBackUp = new ApplicationBackUp(appParam);
+ FlinkApplicationBackUp applicationBackUp = new FlinkApplicationBackUp(appParam);
applicationBackUp.setVersion(version);
this.save(applicationBackUp);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationConfigServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkApplicationConfigServiceImpl.java
similarity index 74%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationConfigServiceImpl.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkApplicationConfigServiceImpl.java
index 69da15f62..e9abadf0a 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationConfigServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkApplicationConfigServiceImpl.java
@@ -22,13 +22,13 @@ import org.apache.streampark.common.util.Utils;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
import org.apache.streampark.console.core.enums.ConfigFileTypeEnum;
import org.apache.streampark.console.core.enums.EffectiveTypeEnum;
-import org.apache.streampark.console.core.mapper.ApplicationConfigMapper;
-import org.apache.streampark.console.core.service.ApplicationConfigService;
+import org.apache.streampark.console.core.mapper.FlinkApplicationConfigMapper;
import org.apache.streampark.console.core.service.EffectiveService;
+import org.apache.streampark.console.core.service.FlinkApplicationConfigService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -52,11 +52,11 @@ import java.util.Scanner;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
-public class ApplicationConfigServiceImpl
+public class FlinkApplicationConfigServiceImpl
extends
- ServiceImpl<ApplicationConfigMapper, ApplicationConfig>
+ ServiceImpl<FlinkApplicationConfigMapper, FlinkApplicationConfig>
implements
- ApplicationConfigService {
+ FlinkApplicationConfigService {
private String flinkConfTemplate = null;
@@ -67,11 +67,11 @@ public class ApplicationConfigServiceImpl
private EffectiveService effectiveService;
@Override
- public synchronized void create(Application appParam, Boolean latest) {
+ public synchronized void create(FlinkApplication appParam, Boolean latest) {
String decode = new String(Base64.getDecoder().decode(appParam.getConfig()));
String config = DeflaterUtils.zipString(decode.trim());
- ApplicationConfig applicationConfig = new ApplicationConfig();
+ FlinkApplicationConfig applicationConfig = new FlinkApplicationConfig();
applicationConfig.setAppId(appParam.getId());
if (appParam.getFormat() != null) {
@@ -92,19 +92,19 @@ public class ApplicationConfigServiceImpl
}
public void setLatest(Long appId, Long configId) {
- LambdaUpdateWrapper<ApplicationConfig> updateWrapper = Wrappers.lambdaUpdate();
- updateWrapper.set(ApplicationConfig::getLatest, false).eq(ApplicationConfig::getAppId, appId);
+ LambdaUpdateWrapper<FlinkApplicationConfig> updateWrapper = Wrappers.lambdaUpdate();
+ updateWrapper.set(FlinkApplicationConfig::getLatest, false).eq(FlinkApplicationConfig::getAppId, appId);
this.update(updateWrapper);
updateWrapper.clear();
- updateWrapper.set(ApplicationConfig::getLatest, true).eq(ApplicationConfig::getId, configId);
+ updateWrapper.set(FlinkApplicationConfig::getLatest, true).eq(FlinkApplicationConfig::getId, configId);
this.update(updateWrapper);
}
@Override
- public synchronized void update(Application appParam, Boolean latest) {
+ public synchronized void update(FlinkApplication appParam, Boolean latest) {
// flink sql job
- ApplicationConfig latestConfig = getLatest(appParam.getId());
+ FlinkApplicationConfig latestConfig = getLatest(appParam.getId());
if (appParam.isFlinkSqlJob()) {
updateForFlinkSqlJob(appParam, latest, latestConfig);
} else {
@@ -112,13 +112,14 @@ public class ApplicationConfigServiceImpl
}
}
- private void updateForNonFlinkSqlJob(Application appParam, Boolean latest, ApplicationConfig latestConfig) {
+ private void updateForNonFlinkSqlJob(FlinkApplication appParam, Boolean latest,
+ FlinkApplicationConfig latestConfig) {
// may be re-selected a config file (without config id), or may be based on an original edit
// (with config Id).
Long configId = appParam.getConfigId();
// an original edit
if (configId != null) {
- ApplicationConfig config = this.getById(configId);
+ FlinkApplicationConfig config = this.getById(configId);
String decode = new String(Base64.getDecoder().decode(appParam.getConfig()));
String encode = DeflaterUtils.zipString(decode.trim());
// create...
@@ -131,7 +132,7 @@ public class ApplicationConfigServiceImpl
this.setLatestOrEffective(latest, configId, appParam.getId());
}
} else {
- ApplicationConfig config = getEffective(appParam.getId());
+ FlinkApplicationConfig config = getEffective(appParam.getId());
if (config != null) {
String decode = new String(Base64.getDecoder().decode(appParam.getConfig()));
String encode = DeflaterUtils.zipString(decode.trim());
@@ -146,9 +147,9 @@ public class ApplicationConfigServiceImpl
}
private void updateForFlinkSqlJob(
- Application appParam, Boolean latest, ApplicationConfig latestConfig) {
+ FlinkApplication appParam, Boolean latest, FlinkApplicationConfig latestConfig) {
// get effect config
- ApplicationConfig effectiveConfig = getEffective(appParam.getId());
+ FlinkApplicationConfig effectiveConfig = getEffective(appParam.getId());
if (Utils.isEmpty(appParam.getConfig())) {
if (effectiveConfig != null) {
effectiveService.remove(appParam.getId(), EffectiveTypeEnum.CONFIG);
@@ -186,25 +187,25 @@ public class ApplicationConfigServiceImpl
@Override
public void toEffective(Long appId, Long configId) {
- LambdaUpdateWrapper<ApplicationConfig> updateWrapper = Wrappers.lambdaUpdate();
- updateWrapper.eq(ApplicationConfig::getAppId, appId).set(ApplicationConfig::getLatest, false);
+ LambdaUpdateWrapper<FlinkApplicationConfig> updateWrapper = Wrappers.lambdaUpdate();
+ updateWrapper.eq(FlinkApplicationConfig::getAppId, appId).set(FlinkApplicationConfig::getLatest, false);
this.update(updateWrapper);
effectiveService.saveOrUpdate(appId, EffectiveTypeEnum.CONFIG, configId);
}
@Override
- public ApplicationConfig getLatest(Long appId) {
+ public FlinkApplicationConfig getLatest(Long appId) {
return baseMapper.selectLatest(appId);
}
@Override
- public ApplicationConfig getEffective(Long appId) {
+ public FlinkApplicationConfig getEffective(Long appId) {
return baseMapper.selectEffective(appId);
}
@Override
- public ApplicationConfig get(Long id) {
- ApplicationConfig config = getById(id);
+ public FlinkApplicationConfig get(Long id) {
+ FlinkApplicationConfig config = getById(id);
if (config.getContent() != null) {
String unzipString = DeflaterUtils.unzipString(config.getContent());
String encode = Base64.getEncoder().encodeToString(unzipString.getBytes());
@@ -214,21 +215,21 @@ public class ApplicationConfigServiceImpl
}
@Override
- public IPage<ApplicationConfig> getPage(ApplicationConfig config, RestRequest request) {
+ public IPage<FlinkApplicationConfig> getPage(FlinkApplicationConfig config, RestRequest request) {
request.setSortField("version");
- Page<ApplicationConfig> page = MybatisPager.getPage(request);
- IPage<ApplicationConfig> configList = this.baseMapper.selectPageByAppId(page, config.getAppId());
+ Page<FlinkApplicationConfig> page = MybatisPager.getPage(request);
+ IPage<FlinkApplicationConfig> configList = this.baseMapper.selectPageByAppId(page, config.getAppId());
fillEffectiveField(config.getAppId(), configList.getRecords());
return configList;
}
@Override
- public List<ApplicationConfig> list(Long appId) {
- LambdaQueryWrapper<ApplicationConfig> queryWrapper = new LambdaQueryWrapper<ApplicationConfig>()
- .eq(ApplicationConfig::getAppId, appId)
- .orderByDesc(ApplicationConfig::getVersion);
+ public List<FlinkApplicationConfig> list(Long appId) {
+ LambdaQueryWrapper<FlinkApplicationConfig> queryWrapper = new LambdaQueryWrapper<FlinkApplicationConfig>()
+ .eq(FlinkApplicationConfig::getAppId, appId)
+ .orderByDesc(FlinkApplicationConfig::getVersion);
- List<ApplicationConfig> configList = this.baseMapper.selectList(queryWrapper);
+ List<FlinkApplicationConfig> configList = this.baseMapper.selectList(queryWrapper);
fillEffectiveField(appId, configList);
return configList;
}
@@ -257,11 +258,11 @@ public class ApplicationConfigServiceImpl
@Override
public void removeByAppId(Long appId) {
baseMapper.delete(
- new LambdaQueryWrapper<ApplicationConfig>().eq(ApplicationConfig::getAppId, appId));
+ new LambdaQueryWrapper<FlinkApplicationConfig>().eq(FlinkApplicationConfig::getAppId, appId));
}
- private void fillEffectiveField(Long id, List<ApplicationConfig> configList) {
- ApplicationConfig effective = getEffective(id);
+ private void fillEffectiveField(Long id, List<FlinkApplicationConfig> configList) {
+ FlinkApplicationConfig effective = getEffective(id);
if (effective == null) {
return;
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/CatalogServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkCatalogServiceImpl.java
similarity index 96%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/CatalogServiceImpl.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkCatalogServiceImpl.java
index 199220fb0..9cc1e12c6 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/CatalogServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkCatalogServiceImpl.java
@@ -23,7 +23,7 @@ import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
import org.apache.streampark.console.core.bean.FlinkCatalogParams;
import org.apache.streampark.console.core.entity.FlinkCatalog;
-import org.apache.streampark.console.core.mapper.CatalogMapper;
+import org.apache.streampark.console.core.mapper.FlinkCatalogMapper;
import org.apache.streampark.console.core.service.CatalogService;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -44,7 +44,7 @@ import java.util.regex.Pattern;
@Service
@Slf4j
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = Exception.class)
-public class CatalogServiceImpl extends ServiceImpl<CatalogMapper, FlinkCatalog>
+public class FlinkCatalogServiceImpl extends ServiceImpl<FlinkCatalogMapper, FlinkCatalog>
implements
CatalogService {
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkClusterServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkClusterServiceImpl.java
index e2820d661..5f18bf364 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkClusterServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkClusterServiceImpl.java
@@ -18,7 +18,7 @@
package org.apache.streampark.console.core.service.impl;
import org.apache.streampark.common.enums.ClusterState;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.common.util.YarnUtils;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.exception.ApiAlertException;
@@ -30,7 +30,7 @@ import org.apache.streampark.console.core.mapper.FlinkClusterMapper;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.FlinkEnvService;
import org.apache.streampark.console.core.service.YarnQueueService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
import org.apache.streampark.console.core.watcher.FlinkClusterWatcher;
import org.apache.streampark.flink.client.FlinkClient;
import org.apache.streampark.flink.client.bean.DeployRequest;
@@ -86,7 +86,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
private FlinkEnvService flinkEnvService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@Autowired
private YarnQueueService yarnQueueService;
@@ -123,14 +123,14 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
}
// 3) Check connection
- if (FlinkExecutionMode.isRemoteMode(cluster.getFlinkExecutionModeEnum())
+ if (FlinkDeployMode.isRemoteMode(cluster.getFlinkDeployModeEnum())
&& cluster.getClusterId() != null
&& !flinkClusterWatcher.verifyClusterConnection(cluster)) {
result.setMsg("The remote cluster connection failed, please check!");
result.setStatus(3);
return result;
}
- if (FlinkExecutionMode.isYarnMode(cluster.getFlinkExecutionModeEnum())
+ if (FlinkDeployMode.isYarnMode(cluster.getFlinkDeployModeEnum())
&& cluster.getClusterId() != null
&& !flinkClusterWatcher.verifyClusterConnection(cluster)) {
result.setMsg("The flink cluster connection failed, please check!");
@@ -153,7 +153,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
ApiAlertException.throwIfFalse(
successful, String.format(ERROR_CLUSTER_QUEUE_HINT, flinkCluster.getYarnQueue()));
flinkCluster.setCreateTime(new Date());
- if (FlinkExecutionMode.isRemoteMode(flinkCluster.getFlinkExecutionModeEnum())) {
+ if (FlinkDeployMode.isRemoteMode(flinkCluster.getFlinkDeployModeEnum())) {
flinkCluster.setClusterState(ClusterState.RUNNING.getState());
flinkCluster.setStartTime(new Date());
flinkCluster.setEndTime(null);
@@ -161,7 +161,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
flinkCluster.setClusterState(ClusterState.CREATED.getState());
}
boolean ret = save(flinkCluster);
- if (ret && FlinkExecutionMode.isRemoteMode(flinkCluster.getExecutionMode())) {
+ if (ret && FlinkDeployMode.isRemoteMode(flinkCluster.getDeployMode())) {
FlinkClusterWatcher.addWatching(flinkCluster);
}
return ret;
@@ -175,7 +175,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
ApiAlertException.throwIfNull(
deployResponse,
"Deploy cluster failed, unknown reason,please check you params or StreamPark error log");
- if (FlinkExecutionMode.isYarnSessionMode(flinkCluster.getFlinkExecutionModeEnum())) {
+ if (FlinkDeployMode.isYarnSessionMode(flinkCluster.getFlinkDeployModeEnum())) {
String address = String.format(
"%s/proxy/%s/", YarnUtils.getRMWebAppURL(true), deployResponse.clusterId());
flinkCluster.setAddress(address);
@@ -208,7 +208,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
flinkCluster.setClusterName(paramOfCluster.getClusterName());
flinkCluster.setAlertId(paramOfCluster.getAlertId());
flinkCluster.setDescription(paramOfCluster.getDescription());
- if (FlinkExecutionMode.isRemoteMode(flinkCluster.getFlinkExecutionModeEnum())) {
+ if (FlinkDeployMode.isRemoteMode(flinkCluster.getFlinkDeployModeEnum())) {
updateFlinkClusterForRemoteMode(paramOfCluster, flinkCluster);
FlinkClusterWatcher.addWatching(flinkCluster);
} else {
@@ -296,15 +296,15 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
}
@Override
- public List<FlinkCluster> listByExecutionModes(
- Collection<FlinkExecutionMode> executionModeEnums) {
+ public List<FlinkCluster> listByDeployModes(
+ Collection<FlinkDeployMode> deployModeEnums) {
return getBaseMapper()
.selectList(
new LambdaQueryWrapper<FlinkCluster>()
.in(
- FlinkCluster::getExecutionMode,
- executionModeEnums.stream()
- .map(FlinkExecutionMode::getMode)
+ FlinkCluster::getDeployMode,
+ deployModeEnums.stream()
+ .map(FlinkDeployMode::getMode)
.collect(Collectors.toSet())));
}
@@ -343,8 +343,8 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
FlinkCluster flinkCluster = getById(id);
ApiAlertException.throwIfNull(flinkCluster, "Flink cluster not exist, please check.");
- if (FlinkExecutionMode.isYarnSessionMode(flinkCluster.getFlinkExecutionModeEnum())
- || FlinkExecutionMode.isKubernetesSessionMode(flinkCluster.getExecutionMode())) {
+ if (FlinkDeployMode.isYarnSessionMode(flinkCluster.getFlinkDeployModeEnum())
+ || FlinkDeployMode.isKubernetesSessionMode(flinkCluster.getDeployMode())) {
ApiAlertException.throwIfTrue(
ClusterState.isRunning(flinkCluster.getClusterStateEnum()),
"Flink cluster is running, cannot be delete, please check.");
@@ -364,7 +364,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
@VisibleForTesting
public boolean validateQueueIfNeeded(FlinkCluster clusterInfo) {
yarnQueueService.checkQueueLabel(
- clusterInfo.getFlinkExecutionModeEnum(), clusterInfo.getYarnQueue());
+ clusterInfo.getFlinkDeployModeEnum(), clusterInfo.getYarnQueue());
if (!isYarnNotDefaultQueue(clusterInfo)) {
return true;
}
@@ -381,12 +381,12 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
@VisibleForTesting
public boolean validateQueueIfNeeded(FlinkCluster oldCluster, FlinkCluster newCluster) {
yarnQueueService.checkQueueLabel(
- newCluster.getFlinkExecutionModeEnum(), newCluster.getYarnQueue());
+ newCluster.getFlinkDeployModeEnum(), newCluster.getYarnQueue());
if (!isYarnNotDefaultQueue(newCluster)) {
return true;
}
- if (FlinkExecutionMode.isYarnSessionMode(newCluster.getFlinkExecutionModeEnum())
+ if (FlinkDeployMode.isYarnSessionMode(newCluster.getFlinkDeployModeEnum())
&& StringUtils.equals(oldCluster.getYarnQueue(), newCluster.getYarnQueue())) {
return true;
}
@@ -398,11 +398,11 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
* label.
*
* @param cluster cluster.
- * @return If the executionMode is yarn session mode and the queue label is not (empty or
+ * @return If the deployMode is yarn session mode and the queue label is not (empty or
* default), return true, false else.
*/
private boolean isYarnNotDefaultQueue(FlinkCluster cluster) {
- return FlinkExecutionMode.isYarnSessionMode(cluster.getFlinkExecutionModeEnum())
+ return FlinkDeployMode.isYarnSessionMode(cluster.getFlinkDeployModeEnum())
&& !yarnQueueService.isDefaultQueue(cluster.getYarnQueue());
}
@@ -410,7 +410,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
String clusterId) throws InterruptedException, ExecutionException, TimeoutException {
ShutDownRequest stopRequest = new ShutDownRequest(
flinkEnvService.getById(flinkCluster.getVersionId()).getFlinkVersion(),
- flinkCluster.getFlinkExecutionModeEnum(),
+ flinkCluster.getFlinkDeployModeEnum(),
flinkCluster.getProperties(),
clusterId,
flinkCluster.getId(),
@@ -422,7 +422,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
private DeployResponse deployInternal(FlinkCluster flinkCluster) throws InterruptedException, ExecutionException, TimeoutException {
DeployRequest deployRequest = new DeployRequest(
flinkEnvService.getById(flinkCluster.getVersionId()).getFlinkVersion(),
- flinkCluster.getFlinkExecutionModeEnum(),
+ flinkCluster.getFlinkDeployModeEnum(),
flinkCluster.getProperties(),
flinkCluster.getClusterId(),
flinkCluster.getId(),
@@ -433,7 +433,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
}
private void checkActiveIfNeeded(FlinkCluster flinkCluster) {
- if (FlinkExecutionMode.isYarnSessionMode(flinkCluster.getFlinkExecutionModeEnum())) {
+ if (FlinkDeployMode.isYarnSessionMode(flinkCluster.getFlinkDeployModeEnum())) {
ApiAlertException.throwIfFalse(
ClusterState.isRunning(flinkCluster.getClusterStateEnum()),
"Current cluster is not active, please check!");
@@ -448,8 +448,8 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
@Nullable
private KubernetesDeployParam getKubernetesDeployDesc(
@Nonnull FlinkCluster flinkCluster, String action) {
- FlinkExecutionMode executionModeEnum = flinkCluster.getFlinkExecutionModeEnum();
- switch (executionModeEnum) {
+ FlinkDeployMode deployModeEnum = flinkCluster.getFlinkDeployModeEnum();
+ switch (deployModeEnum) {
case YARN_SESSION:
break;
case KUBERNETES_NATIVE_SESSION:
@@ -463,7 +463,7 @@ public class FlinkClusterServiceImpl extends ServiceImpl<FlinkClusterMapper, Fli
default:
throw new ApiAlertException(
String.format(
- "The FlinkExecutionMode %s can't %s!", executionModeEnum.getName(),
+ "The FlinkDeployMode %s can't %s!", deployModeEnum.getName(),
action));
}
return null;
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkEnvServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkEnvServiceImpl.java
index a58a918d0..84e1620e3 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkEnvServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkEnvServiceImpl.java
@@ -26,7 +26,7 @@ import org.apache.streampark.console.core.enums.FlinkEnvCheckEnum;
import org.apache.streampark.console.core.mapper.FlinkEnvMapper;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.FlinkEnvService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -51,7 +51,7 @@ public class FlinkEnvServiceImpl extends ServiceImpl<FlinkEnvMapper, FlinkEnv>
@Autowired
private FlinkClusterService flinkClusterService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
/**
* two places will be checked: <br>
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkGateWayServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkGateWayServiceImpl.java
deleted file mode 100644
index c42ad485f..000000000
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkGateWayServiceImpl.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.streampark.console.core.service.impl;
-
-import org.apache.streampark.common.util.HttpClientUtils;
-import org.apache.streampark.console.base.exception.ApiAlertException;
-import org.apache.streampark.console.base.util.JacksonUtils;
-import org.apache.streampark.console.core.entity.FlinkGateWay;
-import org.apache.streampark.console.core.enums.GatewayTypeEnum;
-import org.apache.streampark.console.core.mapper.FlinkGateWayMapper;
-import org.apache.streampark.console.core.service.FlinkGateWayService;
-import org.apache.streampark.gateway.flink.client.dto.GetApiVersionResponseBody;
-
-import org.apache.hc.client5.http.config.RequestConfig;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.concurrent.TimeUnit;
-
-@Slf4j
-@Service
-@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
-public class FlinkGateWayServiceImpl extends ServiceImpl<FlinkGateWayMapper, FlinkGateWay>
- implements
- FlinkGateWayService {
-
- private void preHandleGatewayInfo(FlinkGateWay flinkGateWay) {
- // validate gateway name
- ApiAlertException.throwIfTrue(
- existsByGatewayName(flinkGateWay.getGatewayName()), "gateway name already exists");
-
- // validate gateway address and set gateway type
- flinkGateWay.setGatewayType(getGatewayVersion(flinkGateWay.getAddress()));
- }
-
- @Override
- public void create(FlinkGateWay flinkGateWay) {
- preHandleGatewayInfo(flinkGateWay);
- this.save(flinkGateWay);
- }
-
- @Override
- public void update(FlinkGateWay flinkGateWay) {
- preHandleGatewayInfo(flinkGateWay);
- this.saveOrUpdate(flinkGateWay);
- }
-
- @Override
- public boolean existsByGatewayName(String name) {
- return getBaseMapper()
- .exists(new LambdaQueryWrapper<FlinkGateWay>().eq(FlinkGateWay::getGatewayName, name));
- }
-
- @Override
- public GatewayTypeEnum getGatewayVersion(String address) {
- String restUrl = address + "/api_versions";
- try {
- String result = HttpClientUtils.httpGetRequest(
- restUrl,
- RequestConfig.custom().setConnectTimeout(2000, TimeUnit.MILLISECONDS).build());
- if (result != null) {
- String versionStr = JacksonUtils.read(result, GetApiVersionResponseBody.class).getVersions().get(0);
- return "V1".equals(versionStr) ? GatewayTypeEnum.FLINK_V1 : GatewayTypeEnum.FLINK_V2;
- }
- } catch (Exception e) {
- log.error("get gateway version failed", e);
- }
- throw new ApiAlertException("get gateway version failed");
- }
-}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SavepointServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkSavepointServiceImpl.java
similarity index 79%
rename from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SavepointServiceImpl.java
rename to streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkSavepointServiceImpl.java
index af0a3a36a..e075e5da4 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SavepointServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkSavepointServiceImpl.java
@@ -17,7 +17,7 @@
package org.apache.streampark.console.core.service.impl;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.common.util.AssertUtils;
import org.apache.streampark.common.util.CompletableFutureUtils;
import org.apache.streampark.common.util.ExceptionUtils;
@@ -25,22 +25,22 @@ import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.exception.InternalException;
import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
import org.apache.streampark.console.core.entity.ApplicationLog;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.FlinkEnv;
-import org.apache.streampark.console.core.entity.Savepoint;
+import org.apache.streampark.console.core.entity.FlinkSavepoint;
import org.apache.streampark.console.core.enums.CheckPointTypeEnum;
import org.apache.streampark.console.core.enums.OperationEnum;
import org.apache.streampark.console.core.enums.OptionStateEnum;
-import org.apache.streampark.console.core.mapper.SavepointMapper;
-import org.apache.streampark.console.core.service.ApplicationConfigService;
+import org.apache.streampark.console.core.mapper.FlinkSavepointMapper;
import org.apache.streampark.console.core.service.ApplicationLogService;
+import org.apache.streampark.console.core.service.FlinkApplicationConfigService;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.FlinkEnvService;
import org.apache.streampark.console.core.service.SavepointService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.util.ServiceHelper;
import org.apache.streampark.console.core.watcher.FlinkAppHttpWatcher;
import org.apache.streampark.flink.client.FlinkClient;
@@ -86,7 +86,7 @@ import static org.apache.streampark.console.core.enums.CheckPointTypeEnum.CHECKP
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
-public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint>
+public class FlinkSavepointServiceImpl extends ServiceImpl<FlinkSavepointMapper, FlinkSavepoint>
implements
SavepointService {
@@ -94,10 +94,10 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
private FlinkEnvService flinkEnvService;
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
- private ApplicationConfigService configService;
+ private FlinkApplicationConfigService configService;
@Autowired
private FlinkClusterService flinkClusterService;
@@ -114,30 +114,31 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
@Override
public void expire(Long appId) {
- Savepoint savepoint = new Savepoint();
+ FlinkSavepoint savepoint = new FlinkSavepoint();
savepoint.setLatest(false);
- LambdaQueryWrapper<Savepoint> queryWrapper = new LambdaQueryWrapper<Savepoint>().eq(Savepoint::getAppId, appId);
+ LambdaQueryWrapper<FlinkSavepoint> queryWrapper =
+ new LambdaQueryWrapper<FlinkSavepoint>().eq(FlinkSavepoint::getAppId, appId);
this.update(savepoint, queryWrapper);
}
@Override
- public boolean save(Savepoint entity) {
+ public boolean save(FlinkSavepoint entity) {
this.expire(entity);
this.expire(entity.getAppId());
return super.save(entity);
}
@Override
- public Savepoint getLatest(Long id) {
- LambdaQueryWrapper<Savepoint> queryWrapper = new LambdaQueryWrapper<Savepoint>()
- .eq(Savepoint::getAppId, id)
- .eq(Savepoint::getLatest, true);
+ public FlinkSavepoint getLatest(Long id) {
+ LambdaQueryWrapper<FlinkSavepoint> queryWrapper = new LambdaQueryWrapper<FlinkSavepoint>()
+ .eq(FlinkSavepoint::getAppId, id)
+ .eq(FlinkSavepoint::getLatest, true);
return this.getOne(queryWrapper);
}
@Override
- public String getSavePointPath(Application appParam) throws Exception {
- Application application = applicationManageService.getById(appParam.getId());
+ public String getSavePointPath(FlinkApplication appParam) throws Exception {
+ FlinkApplication application = applicationManageService.getById(appParam.getId());
// 1) properties have the highest priority, read the properties are set: -Dstate.savepoints.dir
String savepointPath = getSavepointFromDynamicProps(application.getDynamicProperties());
@@ -164,7 +165,7 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
@Override
public void trigger(Long appId, @Nullable String savepointPath, @Nullable Boolean nativeFormat) {
log.info("Start to trigger savepoint for app {}", appId);
- Application application = applicationManageService.getById(appId);
+ FlinkApplication application = applicationManageService.getById(appId);
ApplicationLog applicationLog = getApplicationLog(application);
FlinkAppHttpWatcher.addSavepoint(application.getId());
@@ -186,7 +187,7 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
}
@Nonnull
- private ApplicationLog getApplicationLog(Application application) {
+ private ApplicationLog getApplicationLog(FlinkApplication application) {
ApplicationLog applicationLog = new ApplicationLog();
applicationLog.setOptionName(OperationEnum.SAVEPOINT.getValue());
applicationLog.setAppId(application.getId());
@@ -198,8 +199,8 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
}
@Override
- public Boolean remove(Long id, Application appParam) throws InternalException {
- Savepoint savepoint = getById(id);
+ public Boolean remove(Long id, FlinkApplication appParam) throws InternalException {
+ FlinkSavepoint savepoint = getById(id);
try {
if (StringUtils.isNotBlank(savepoint.getPath())) {
appParam.getFsOperator().delete(savepoint.getPath());
@@ -211,19 +212,21 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
}
@Override
- public IPage<Savepoint> getPage(Savepoint savepoint, RestRequest request) {
+ public IPage<FlinkSavepoint> getPage(FlinkSavepoint savepoint, RestRequest request) {
request.setSortField("trigger_time");
- Page<Savepoint> page = MybatisPager.getPage(request);
- LambdaQueryWrapper<Savepoint> queryWrapper = new LambdaQueryWrapper<Savepoint>().eq(Savepoint::getAppId,
- savepoint.getAppId());
+ Page<FlinkSavepoint> page = MybatisPager.getPage(request);
+ LambdaQueryWrapper<FlinkSavepoint> queryWrapper =
+ new LambdaQueryWrapper<FlinkSavepoint>().eq(FlinkSavepoint::getAppId,
+ savepoint.getAppId());
return this.page(page, queryWrapper);
}
@Override
- public void remove(Application appParam) {
+ public void remove(FlinkApplication appParam) {
Long appId = appParam.getId();
- LambdaQueryWrapper<Savepoint> queryWrapper = new LambdaQueryWrapper<Savepoint>().eq(Savepoint::getAppId, appId);
+ LambdaQueryWrapper<FlinkSavepoint> queryWrapper =
+ new LambdaQueryWrapper<FlinkSavepoint>().eq(FlinkSavepoint::getAppId, appId);
this.remove(queryWrapper);
try {
@@ -238,7 +241,7 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
// private methods.
private void handleSavepointResponseFuture(
- Application application,
+ FlinkApplication application,
ApplicationLog applicationLog,
CompletableFuture<SavepointResponse> savepointFuture) {
CompletableFutureUtils.runTimeout(
@@ -270,7 +273,7 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
});
}
- private String getFinalSavepointDir(@Nullable String savepointPath, Application application) {
+ private String getFinalSavepointDir(@Nullable String savepointPath, FlinkApplication application) {
String result = savepointPath;
if (StringUtils.isBlank(savepointPath)) {
try {
@@ -286,10 +289,10 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
}
@Nonnull
- private Map<String, Object> tryGetRestProps(Application application, FlinkCluster cluster) {
+ private Map<String, Object> tryGetRestProps(FlinkApplication application, FlinkCluster cluster) {
Map<String, Object> properties = new HashMap<>();
- if (FlinkExecutionMode.isRemoteMode(application.getFlinkExecutionMode())) {
+ if (FlinkDeployMode.isRemoteMode(application.getFlinkDeployMode())) {
AssertUtils.notNull(
cluster,
String.format(
@@ -302,13 +305,13 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
return properties;
}
- private String getClusterId(Application application, FlinkCluster cluster) {
- if (FlinkExecutionMode.isKubernetesMode(application.getExecutionMode())) {
- return FlinkExecutionMode.isKubernetesSessionMode(application.getExecutionMode())
+ private String getClusterId(FlinkApplication application, FlinkCluster cluster) {
+ if (FlinkDeployMode.isKubernetesMode(application.getDeployMode())) {
+ return FlinkDeployMode.isKubernetesSessionMode(application.getDeployMode())
? cluster.getClusterId()
: application.getClusterId();
- } else if (FlinkExecutionMode.isYarnMode(application.getExecutionMode())) {
- if (FlinkExecutionMode.YARN_SESSION.equals(application.getFlinkExecutionMode())) {
+ } else if (FlinkDeployMode.isYarnMode(application.getDeployMode())) {
+ if (FlinkDeployMode.YARN_SESSION.equals(application.getFlinkDeployMode())) {
AssertUtils.notNull(
cluster,
String.format(
@@ -344,11 +347,11 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
*/
@VisibleForTesting
@Nullable
- public String getSavepointFromConfig(Application application) {
+ public String getSavepointFromConfig(FlinkApplication application) {
if (!application.isStreamParkJob() && !application.isFlinkSqlJob()) {
return null;
}
- ApplicationConfig applicationConfig = configService.getEffective(application.getId());
+ FlinkApplicationConfig applicationConfig = configService.getEffective(application.getId());
if (applicationConfig == null) {
return null;
}
@@ -368,9 +371,9 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
*/
@VisibleForTesting
@Nullable
- public String getSavepointFromDeployLayer(Application application) throws JsonProcessingException {
+ public String getSavepointFromDeployLayer(FlinkApplication application) throws JsonProcessingException {
// At the yarn or k8s mode, then read the savepoint in flink-conf.yml in the bound flink
- if (!FlinkExecutionMode.isRemoteMode(application.getExecutionMode())) {
+ if (!FlinkDeployMode.isRemoteMode(application.getDeployMode())) {
FlinkEnv flinkEnv = flinkEnvService.getById(application.getVersionId());
return flinkEnv.convertFlinkYamlAsMap().get(SAVEPOINT_DIRECTORY.key());
}
@@ -409,7 +412,7 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
/** Try get the 'state.checkpoints.num-retained' from the flink env. */
private int getChkNumRetainedFromFlinkEnv(
- @Nonnull FlinkEnv flinkEnv, @Nonnull Application application) {
+ @Nonnull FlinkEnv flinkEnv, @Nonnull FlinkApplication application) {
String flinkConfNumRetained = flinkEnv.convertFlinkYamlAsMap().get(MAX_RETAINED_CHECKPOINTS.key());
if (StringUtils.isBlank(flinkConfNumRetained)) {
log.info(
@@ -437,9 +440,9 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
return MAX_RETAINED_CHECKPOINTS.defaultValue();
}
- private void expire(Savepoint entity) {
+ private void expire(FlinkSavepoint entity) {
FlinkEnv flinkEnv = flinkEnvService.getByAppId(entity.getAppId());
- Application application = applicationManageService.getById(entity.getAppId());
+ FlinkApplication application = applicationManageService.getById(entity.getAppId());
AssertUtils.notNull(flinkEnv);
AssertUtils.notNull(application);
@@ -448,29 +451,29 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
cpThreshold = CHECKPOINT == CheckPointTypeEnum.of(entity.getType()) ? cpThreshold - 1 : cpThreshold;
if (cpThreshold == 0) {
- LambdaQueryWrapper<Savepoint> queryWrapper = new LambdaQueryWrapper<Savepoint>()
- .eq(Savepoint::getAppId, entity.getAppId())
- .eq(Savepoint::getType, CHECKPOINT.get());
+ LambdaQueryWrapper<FlinkSavepoint> queryWrapper = new LambdaQueryWrapper<FlinkSavepoint>()
+ .eq(FlinkSavepoint::getAppId, entity.getAppId())
+ .eq(FlinkSavepoint::getType, CHECKPOINT.get());
this.remove(queryWrapper);
return;
}
- LambdaQueryWrapper<Savepoint> queryWrapper = new LambdaQueryWrapper<Savepoint>()
- .select(Savepoint::getTriggerTime)
- .eq(Savepoint::getAppId, entity.getAppId())
- .eq(Savepoint::getType, CHECKPOINT.get())
- .orderByDesc(Savepoint::getTriggerTime);
+ LambdaQueryWrapper<FlinkSavepoint> queryWrapper = new LambdaQueryWrapper<FlinkSavepoint>()
+ .select(FlinkSavepoint::getTriggerTime)
+ .eq(FlinkSavepoint::getAppId, entity.getAppId())
+ .eq(FlinkSavepoint::getType, CHECKPOINT.get())
+ .orderByDesc(FlinkSavepoint::getTriggerTime);
- Page<Savepoint> savepointPage = this.baseMapper.selectPage(new Page<>(1, cpThreshold + 1), queryWrapper);
+ Page<FlinkSavepoint> savepointPage = this.baseMapper.selectPage(new Page<>(1, cpThreshold + 1), queryWrapper);
if (CollectionUtils.isEmpty(savepointPage.getRecords())
|| savepointPage.getRecords().size() <= cpThreshold) {
return;
}
- Savepoint savepoint = savepointPage.getRecords().get(cpThreshold - 1);
- LambdaQueryWrapper<Savepoint> lambdaQueryWrapper = new LambdaQueryWrapper<Savepoint>()
- .eq(Savepoint::getAppId, entity.getAppId())
- .eq(Savepoint::getType, CHECKPOINT.get())
- .lt(Savepoint::getTriggerTime, savepoint.getTriggerTime());
+ FlinkSavepoint savepoint = savepointPage.getRecords().get(cpThreshold - 1);
+ LambdaQueryWrapper<FlinkSavepoint> lambdaQueryWrapper = new LambdaQueryWrapper<FlinkSavepoint>()
+ .eq(FlinkSavepoint::getAppId, entity.getAppId())
+ .eq(FlinkSavepoint::getType, CHECKPOINT.get())
+ .lt(FlinkSavepoint::getTriggerTime, savepoint.getTriggerTime());
this.remove(lambdaQueryWrapper);
}
@@ -478,7 +481,7 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
private TriggerSavepointRequest renderTriggerSavepointRequest(
@Nullable String savepointPath,
Boolean nativeFormat,
- Application application,
+ FlinkApplication application,
FlinkEnv flinkEnv) {
String customSavepoint = this.getFinalSavepointDir(savepointPath, application);
@@ -490,7 +493,7 @@ public class SavepointServiceImpl extends ServiceImpl<SavepointMapper, Savepoint
return new TriggerSavepointRequest(
application.getId(),
flinkEnv.getFlinkVersion(),
- application.getFlinkExecutionMode(),
+ application.getFlinkDeployMode(),
properties,
clusterId,
application.getJobId(),
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkSqlServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkSqlServiceImpl.java
index f117c9513..c95cb3b7c 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkSqlServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkSqlServiceImpl.java
@@ -22,14 +22,14 @@ import org.apache.streampark.common.util.DeflaterUtils;
import org.apache.streampark.common.util.ExceptionUtils;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkEnv;
import org.apache.streampark.console.core.entity.FlinkSql;
import org.apache.streampark.console.core.enums.CandidateTypeEnum;
import org.apache.streampark.console.core.enums.EffectiveTypeEnum;
import org.apache.streampark.console.core.mapper.FlinkSqlMapper;
-import org.apache.streampark.console.core.service.ApplicationBackUpService;
import org.apache.streampark.console.core.service.EffectiveService;
+import org.apache.streampark.console.core.service.FlinkApplicationBackUpService;
import org.apache.streampark.console.core.service.FlinkEnvService;
import org.apache.streampark.console.core.service.FlinkSqlService;
import org.apache.streampark.flink.core.FlinkSqlValidationResult;
@@ -61,7 +61,7 @@ public class FlinkSqlServiceImpl extends ServiceImpl<FlinkSqlMapper, FlinkSql>
private EffectiveService effectiveService;
@Autowired
- private ApplicationBackUpService backUpService;
+ private FlinkApplicationBackUpService backUpService;
@Autowired
private FlinkEnvService flinkEnvService;
@@ -171,7 +171,7 @@ public class FlinkSqlServiceImpl extends ServiceImpl<FlinkSqlMapper, FlinkSql>
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
- public void rollback(Application application) {
+ public void rollback(FlinkApplication application) {
FlinkSql sql = getCandidate(application.getId(), CandidateTypeEnum.HISTORY);
AssertUtils.notNull(sql);
try {
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java
index 9a1c9047b..f067778de 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java
@@ -33,14 +33,14 @@ import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
import org.apache.streampark.console.base.util.GZipUtils;
import org.apache.streampark.console.base.util.GitUtils;
import org.apache.streampark.console.base.util.ObjectUtils;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.Project;
import org.apache.streampark.console.core.enums.BuildStateEnum;
import org.apache.streampark.console.core.enums.GitAuthorizedErrorEnum;
import org.apache.streampark.console.core.enums.ReleaseStateEnum;
import org.apache.streampark.console.core.mapper.ProjectMapper;
import org.apache.streampark.console.core.service.ProjectService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.task.ProjectBuildTask;
import org.apache.streampark.console.core.watcher.FlinkAppHttpWatcher;
@@ -85,7 +85,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project>
ProjectService {
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
private FlinkAppHttpWatcher flinkAppHttpWatcher;
@@ -158,7 +158,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project>
if (projectParam.getBuildState() != null) {
project.setBuildState(projectParam.getBuildState());
if (BuildStateEnum.of(projectParam.getBuildState()).equals(BuildStateEnum.NEED_REBUILD)) {
- List<Application> applications = listApps(project);
+ List<FlinkApplication> applications = listApps(project);
// Update deployment status
applications.forEach(
(app) -> {
@@ -177,8 +177,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project>
public boolean removeById(Long id) {
Project project = getById(id);
AssertUtils.notNull(project);
- LambdaQueryWrapper<Application> queryWrapper = new LambdaQueryWrapper<Application>()
- .eq(Application::getProjectId, id);
+ LambdaQueryWrapper<FlinkApplication> queryWrapper = new LambdaQueryWrapper<FlinkApplication>()
+ .eq(FlinkApplication::getProjectId, id);
long count = applicationManageService.count(queryWrapper);
if (count > 0) {
return false;
@@ -230,7 +230,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project>
flinkAppHttpWatcher.init();
},
fileLogger -> {
- List<Application> applications =
+ List<FlinkApplication> applications =
this.applicationManageService.listByProjectId(project.getId());
applications.forEach(
(app) -> {
@@ -287,7 +287,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project>
}
@Override
- public List<Application> listApps(Project project) {
+ public List<FlinkApplication> listApps(Project project) {
return this.applicationManageService.listByProjectId(project.getId());
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProxyServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProxyServiceImpl.java
index 7edc1e38b..590b373c2 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProxyServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProxyServiceImpl.java
@@ -19,8 +19,8 @@ package org.apache.streampark.console.core.service.impl;
import org.apache.streampark.common.util.HadoopUtils;
import org.apache.streampark.common.util.YarnUtils;
-import org.apache.streampark.console.core.entity.Application;
import org.apache.streampark.console.core.entity.ApplicationLog;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.SparkApplicationLog;
import org.apache.streampark.console.core.service.FlinkClusterService;
@@ -93,11 +93,11 @@ public class ProxyServiceImpl implements ProxyService {
}
@Override
- public ResponseEntity<?> proxyFlink(HttpServletRequest request, Application app) throws Exception {
+ public ResponseEntity<?> proxyFlink(HttpServletRequest request, FlinkApplication app) throws Exception {
ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE);
String url = null;
- switch (app.getFlinkExecutionMode()) {
+ switch (app.getFlinkDeployMode()) {
case YARN_PER_JOB:
case YARN_APPLICATION:
case YARN_SESSION:
@@ -115,7 +115,7 @@ public class ProxyServiceImpl implements ProxyService {
break;
default:
throw new UnsupportedOperationException(
- "unsupported executionMode ".concat(app.getFlinkExecutionMode().getName()));
+ "unsupported deployMode ".concat(app.getFlinkDeployMode().getName()));
}
if (url == null) {
@@ -179,7 +179,7 @@ public class ProxyServiceImpl implements ProxyService {
}
url += getRequestURL(request, "/proxy/cluster/" + clusterId);
- switch (cluster.getFlinkExecutionModeEnum()) {
+ switch (cluster.getFlinkDeployModeEnum()) {
case YARN_PER_JOB:
case YARN_APPLICATION:
case YARN_SESSION:
@@ -190,7 +190,7 @@ public class ProxyServiceImpl implements ProxyService {
return proxyRequest(request, url);
default:
throw new UnsupportedOperationException(
- "unsupported executionMode ".concat(cluster.getFlinkExecutionModeEnum().getName()));
+ "unsupported deployMode ".concat(cluster.getFlinkDeployModeEnum().getName()));
}
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ResourceServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ResourceServiceImpl.java
index 18e83d35f..95e6ed6a5 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ResourceServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ResourceServiceImpl.java
@@ -34,14 +34,14 @@ import org.apache.streampark.console.core.bean.Dependency;
import org.apache.streampark.console.core.bean.FlinkConnector;
import org.apache.streampark.console.core.bean.MavenPom;
import org.apache.streampark.console.core.bean.UploadResponse;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkSql;
import org.apache.streampark.console.core.entity.Resource;
import org.apache.streampark.console.core.enums.ResourceTypeEnum;
import org.apache.streampark.console.core.mapper.ResourceMapper;
import org.apache.streampark.console.core.service.FlinkSqlService;
import org.apache.streampark.console.core.service.ResourceService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.util.ServiceHelper;
import org.apache.streampark.flink.packer.maven.Artifact;
import org.apache.streampark.flink.packer.maven.MavenTool;
@@ -102,7 +102,7 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource>
public static final String EXCEPTION = "exception";
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
private FlinkSqlService flinkSqlService;
@@ -486,11 +486,11 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource>
return CollectionUtils.isNotEmpty(getResourceApplicationsById(resource));
}
- private List<Application> getResourceApplicationsById(Resource resource) {
- List<Application> dependApplications = new ArrayList<>();
- List<Application> applications = applicationManageService.listByTeamId(resource.getTeamId());
- Map<Long, Application> applicationMap = applications.stream()
- .collect(Collectors.toMap(Application::getId, application -> application));
+ private List<FlinkApplication> getResourceApplicationsById(Resource resource) {
+ List<FlinkApplication> dependApplications = new ArrayList<>();
+ List<FlinkApplication> applications = applicationManageService.listByTeamId(resource.getTeamId());
+ Map<Long, FlinkApplication> applicationMap = applications.stream()
+ .collect(Collectors.toMap(FlinkApplication::getId, application -> application));
// Get the application that depends on this resource
List<FlinkSql> flinkSqls = flinkSqlService.listByTeamId(resource.getTeamId());
@@ -498,7 +498,7 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource>
String sqlTeamResource = flinkSql.getTeamResource();
if (sqlTeamResource != null
&& sqlTeamResource.contains(String.valueOf(resource.getTeamId()))) {
- Application app = applicationMap.get(flinkSql.getAppId());
+ FlinkApplication app = applicationMap.get(flinkSql.getAppId());
if (!dependApplications.contains(app)) {
dependApplications.add(applicationMap.get(flinkSql.getAppId()));
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SparkAppBuildPipeServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SparkAppBuildPipeServiceImpl.java
index 61b17c53c..315886161 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SparkAppBuildPipeServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SparkAppBuildPipeServiceImpl.java
@@ -20,7 +20,7 @@ package org.apache.streampark.console.core.service.impl;
import org.apache.streampark.common.conf.Workspace;
import org.apache.streampark.common.constants.Constants;
import org.apache.streampark.common.enums.ApplicationType;
-import org.apache.streampark.common.enums.SparkExecutionMode;
+import org.apache.streampark.common.enums.SparkDeployMode;
import org.apache.streampark.common.fs.FsOperator;
import org.apache.streampark.common.util.AssertUtils;
import org.apache.streampark.common.util.ExceptionUtils;
@@ -370,9 +370,9 @@ public class SparkAppBuildPipeServiceImpl
}
}
- SparkExecutionMode executionModeEnum = app.getSparkExecutionMode();
+ SparkDeployMode deployModeEnum = app.getSparkDeployMode();
String mainClass = Constants.STREAMPARK_SPARKSQL_CLIENT_CLASS;
- switch (executionModeEnum) {
+ switch (deployModeEnum) {
case YARN_CLUSTER:
case YARN_CLIENT:
String yarnProvidedPath = app.getAppLib();
@@ -392,7 +392,7 @@ public class SparkAppBuildPipeServiceImpl
return SparkYarnApplicationBuildPipeline.of(yarnAppRequest);
default:
throw new UnsupportedOperationException(
- "Unsupported Building Application for ExecutionMode: " + app.getSparkExecutionMode());
+ "Unsupported Building Application for DeployMode: " + app.getSparkDeployMode());
}
}
@@ -416,7 +416,7 @@ public class SparkAppBuildPipeServiceImpl
case SPARK_SQL:
String sqlDistJar = ServiceHelper.getSparkSqlClientJar(sparkEnv);
- if (app.getSparkExecutionMode() == SparkExecutionMode.YARN_CLUSTER) {
+ if (app.getSparkDeployMode() == SparkDeployMode.YARN_CLUSTER) {
String clientPath = Workspace.remote().APP_CLIENT();
return String.format("%s/%s", clientPath, sqlDistJar);
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SparkEnvServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SparkEnvServiceImpl.java
index 739c6a605..2a05a7580 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SparkEnvServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SparkEnvServiceImpl.java
@@ -21,14 +21,11 @@ import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.core.entity.SparkEnv;
import org.apache.streampark.console.core.enums.FlinkEnvCheckEnum;
import org.apache.streampark.console.core.mapper.SparkEnvMapper;
-import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.SparkEnvService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@@ -44,11 +41,6 @@ public class SparkEnvServiceImpl extends ServiceImpl<SparkEnvMapper, SparkEnv>
implements
SparkEnvService {
- @Autowired
- private FlinkClusterService flinkClusterService;
- @Autowired
- private ApplicationInfoService applicationInfoService;
-
/**
* two places will be checked: <br>
* 1) name repeated <br>
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SqlWorkBenchServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SqlWorkBenchServiceImpl.java
deleted file mode 100644
index f7267d808..000000000
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SqlWorkBenchServiceImpl.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.streampark.console.core.service.impl;
-
-import org.apache.streampark.common.enums.FlinkExecutionMode;
-import org.apache.streampark.common.util.HadoopConfigUtils;
-import org.apache.streampark.console.core.entity.FlinkCluster;
-import org.apache.streampark.console.core.entity.FlinkEnv;
-import org.apache.streampark.console.core.entity.FlinkGateWay;
-import org.apache.streampark.console.core.service.FlinkClusterService;
-import org.apache.streampark.console.core.service.FlinkEnvService;
-import org.apache.streampark.console.core.service.FlinkGateWayService;
-import org.apache.streampark.console.core.service.SqlWorkBenchService;
-import org.apache.streampark.flink.kubernetes.KubernetesRetriever;
-import org.apache.streampark.flink.kubernetes.enums.FlinkK8sExecuteMode;
-import org.apache.streampark.flink.kubernetes.ingress.IngressController;
-import org.apache.streampark.gateway.OperationHandle;
-import org.apache.streampark.gateway.factories.FactoryUtil;
-import org.apache.streampark.gateway.factories.SqlGatewayServiceFactoryUtils;
-import org.apache.streampark.gateway.flink.FlinkSqlGatewayServiceFactory;
-import org.apache.streampark.gateway.results.Column;
-import org.apache.streampark.gateway.results.GatewayInfo;
-import org.apache.streampark.gateway.results.OperationInfo;
-import org.apache.streampark.gateway.results.ResultQueryCondition;
-import org.apache.streampark.gateway.results.ResultSet;
-import org.apache.streampark.gateway.service.SqlGatewayService;
-import org.apache.streampark.gateway.session.SessionEnvironment;
-import org.apache.streampark.gateway.session.SessionHandle;
-
-import org.apache.flink.client.program.ClusterClient;
-
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import java.net.URI;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.UUID;
-
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class SqlWorkBenchServiceImpl implements SqlWorkBenchService {
-
- private final FlinkClusterService flinkClusterService;
- private final FlinkGateWayService flinkGateWayService;
- private final FlinkEnvService flinkEnvService;
-
- /** Get SqlGatewayService instance by flinkGatewayId */
- private SqlGatewayService getSqlGateWayService(Long flinkGatewayId) {
- FlinkGateWay flinkGateWay = flinkGateWayService.getById(flinkGatewayId);
- if (flinkGateWay == null) {
- throw new IllegalArgumentException(
- "flinkGateWay is not exist, please check your config, id: " + flinkGatewayId);
- }
- Map<String, String> config = new HashMap<>(2);
- config.put(
- FactoryUtil.SQL_GATEWAY_SERVICE_TYPE.getKey(),
- flinkGateWay.getGatewayType().getIdentifier());
- config.put(FlinkSqlGatewayServiceFactory.BASE_URI.getKey(), flinkGateWay.getAddress());
- List<SqlGatewayService> actual = SqlGatewayServiceFactoryUtils.createSqlGatewayService(config);
- if (actual.size() > 1) {
- log.warn("There are more than one SqlGatewayService instance, please check your config");
- }
- return actual.get(0);
- }
-
- @Override
- public GatewayInfo getGatewayInfo(Long flinkGatewayId) {
- SqlGatewayService sqlGateWayService = getSqlGateWayService(flinkGatewayId);
- return sqlGateWayService.getGatewayInfo();
- }
-
- @Override
- public SessionHandle openSession(Long flinkGatewayId, Long flinkClusterId) {
- Map<String, String> streamParkConf = new HashMap<>();
- SqlGatewayService sqlGateWayService = getSqlGateWayService(flinkGatewayId);
- FlinkCluster flinkCluster = flinkClusterService.getById(flinkClusterId);
- URI remoteURI = flinkCluster.getRemoteURI();
- String host = remoteURI.getHost();
- String port = String.valueOf(remoteURI.getPort());
- String clusterId = flinkCluster.getClusterId();
- FlinkExecutionMode executionModeEnum = FlinkExecutionMode.of(flinkCluster.getExecutionMode());
-
- streamParkConf.put("execution.target", executionModeEnum.getName());
- renderConfByFlinkExecutionMode(
- executionModeEnum, streamParkConf, host, port, clusterId, flinkCluster);
-
- return sqlGateWayService.openSession(
- new SessionEnvironment(
- flinkGatewayId + flinkClusterId + UUID.randomUUID().toString(), null,
- streamParkConf));
- }
-
- private void renderConfByFlinkExecutionMode(
- FlinkExecutionMode executionModeEnum,
- Map<String, String> streamParkConf,
- String host,
- String port,
- String clusterId,
- FlinkCluster flinkCluster) {
- switch (Objects.requireNonNull(executionModeEnum)) {
- case REMOTE:
- streamParkConf.put("rest.address", host);
- streamParkConf.put("rest.port", port);
- break;
- case YARN_SESSION:
- streamParkConf.put("yarn.application.id", clusterId);
- HadoopConfigUtils.readSystemHadoopConf()
- .forEach((k, v) -> streamParkConf.put("flink.hadoop." + k, v));
- break;
- case KUBERNETES_NATIVE_SESSION:
- String k8sNamespace = flinkCluster.getK8sNamespace();
- String restAddress;
- try (
- ClusterClient<?> clusterClient =
- (ClusterClient<?>) KubernetesRetriever.newFinkClusterClient(
- clusterId, k8sNamespace,
- FlinkK8sExecuteMode.of(executionModeEnum))) {
- restAddress = IngressController.getIngressUrlAddress(k8sNamespace, clusterId, clusterClient);
- } catch (Exception e) {
- throw new IllegalArgumentException("get k8s rest address error", e);
- }
- streamParkConf.put("kubernetes.cluster-id", clusterId);
- streamParkConf.put(
- "kubernetes.jobmanager.service-account", flinkCluster.getServiceAccount());
- streamParkConf.put("kubernetes.namespace", k8sNamespace);
- streamParkConf.put("rest.address", restAddress);
- break;
- default:
- throw new IllegalArgumentException("Unsupported execution mode: " + executionModeEnum);
- }
- }
-
- @Override
- public void closeSession(Long flinkGatewayId, String sessionHandleUUIDStr) {
- SqlGatewayService sqlGateWayService = getSqlGateWayService(flinkGatewayId);
- sqlGateWayService.closeSession(new SessionHandle(sessionHandleUUIDStr));
- }
-
- @Override
- public void cancelOperation(
- Long flinkGatewayId, String sessionHandleUUIDStr, String operationId) {
- getSqlGateWayService(flinkGatewayId)
- .cancelOperation(new SessionHandle(sessionHandleUUIDStr), new OperationHandle(operationId));
- }
-
- @Override
- public void closeOperation(Long flinkGatewayId, String sessionHandleUUIDStr, String operationId) {
- getSqlGateWayService(flinkGatewayId)
- .closeOperation(new SessionHandle(sessionHandleUUIDStr), new OperationHandle(operationId));
- }
-
- @Override
- public OperationInfo getOperationInfo(
- Long flinkGatewayId, String sessionHandleUUIDStr, String operationId) {
- return getSqlGateWayService(flinkGatewayId)
- .getOperationInfo(
- new SessionHandle(sessionHandleUUIDStr), new OperationHandle(operationId));
- }
-
- @Override
- public Column getOperationResultSchema(
- Long flinkGatewayId, String sessionHandleUUIDStr, String operationId) {
- return getSqlGateWayService(flinkGatewayId)
- .getOperationResultSchema(
- new SessionHandle(sessionHandleUUIDStr), new OperationHandle(operationId));
- }
-
- @Override
- public OperationHandle executeStatement(
- Long flinkGatewayId, String sessionHandleUUIDStr, String statement) {
- return getSqlGateWayService(flinkGatewayId)
- .executeStatement(new SessionHandle(sessionHandleUUIDStr), statement, 10000L, null);
- }
-
- @Override
- public ResultSet fetchResults(
- Long flinkGatewayId,
- String sessionHandleUUIDStr,
- String operationId,
- ResultQueryCondition resultQueryCondition) {
- return getSqlGateWayService(flinkGatewayId)
- .fetchResults(
- new SessionHandle(sessionHandleUUIDStr),
- new OperationHandle(operationId),
- resultQueryCondition);
- }
-
- @Override
- public void heartbeat(Long flinkGatewayId, String sessionHandle) {
- getSqlGateWayService(flinkGatewayId).heartbeat(new SessionHandle(sessionHandle));
- }
-
- @Override
- public boolean check(Long flinkGatewayId, Long flinkClusterId) {
- FlinkCluster flinkCluster = flinkClusterService.getById(flinkClusterId);
- if (flinkCluster == null) {
- throw new IllegalArgumentException("FlinkCluster not found");
- }
- FlinkEnv flinkEnv = flinkEnvService.getById(flinkCluster.getVersionId());
- if (flinkEnv == null) {
- throw new IllegalArgumentException("FlinkEnv not found");
- }
- return getSqlGateWayService(flinkGatewayId).check(flinkEnv.getFlinkVersion().majorVersion());
- }
-}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/VariableServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/VariableServiceImpl.java
index 4264aa355..e07bfbd1f 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/VariableServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/VariableServiceImpl.java
@@ -21,14 +21,14 @@ import org.apache.streampark.common.util.DeflaterUtils;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkSql;
import org.apache.streampark.console.core.entity.Variable;
import org.apache.streampark.console.core.enums.ReleaseStateEnum;
import org.apache.streampark.console.core.mapper.VariableMapper;
import org.apache.streampark.console.core.service.FlinkSqlService;
import org.apache.streampark.console.core.service.VariableService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.util.ServiceHelper;
import org.apache.commons.collections.CollectionUtils;
@@ -66,7 +66,7 @@ public class VariableServiceImpl extends ServiceImpl<VariableMapper, Variable>
private static final String PLACEHOLDER_END = "}";
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
private FlinkSqlService flinkSqlService;
@@ -99,10 +99,10 @@ public class VariableServiceImpl extends ServiceImpl<VariableMapper, Variable>
}
@Override
- public IPage<Application> getDependAppsPage(Variable variable, RestRequest request) {
- List<Application> applications = getDependApplicationsByCode(variable);
+ public IPage<FlinkApplication> getDependAppsPage(Variable variable, RestRequest request) {
+ List<FlinkApplication> applications = getDependApplicationsByCode(variable);
- IPage<Application> page = new Page<>();
+ IPage<FlinkApplication> page = new Page<>();
if (CollectionUtils.isEmpty(applications)) {
return page;
}
@@ -129,16 +129,16 @@ public class VariableServiceImpl extends ServiceImpl<VariableMapper, Variable>
// endregion
// set Application's field release to NEED_RESTART
- List<Application> applications = getDependApplicationsByCode(variable);
+ List<FlinkApplication> applications = getDependApplicationsByCode(variable);
if (CollectionUtils.isNotEmpty(applications)) {
applicationManageService.update(
- new UpdateWrapper<Application>()
+ new UpdateWrapper<FlinkApplication>()
.lambda()
.in(
- Application::getId,
- applications.stream().map(Application::getId)
+ FlinkApplication::getId,
+ applications.stream().map(FlinkApplication::getId)
.collect(Collectors.toList()))
- .set(Application::getRelease, ReleaseStateEnum.NEED_RESTART.get()));
+ .set(FlinkApplication::getRelease, ReleaseStateEnum.NEED_RESTART.get()));
}
}
@@ -208,14 +208,14 @@ public class VariableServiceImpl extends ServiceImpl<VariableMapper, Variable>
return CollectionUtils.isNotEmpty(getDependApplicationsByCode(variable));
}
- private List<Application> getDependApplicationsByCode(Variable variable) {
- List<Application> dependApplications = new ArrayList<>();
- List<Application> applications = applicationManageService.listByTeamId(variable.getTeamId());
- Map<Long, Application> applicationMap = applications.stream()
- .collect(Collectors.toMap(Application::getId, application -> application));
+ private List<FlinkApplication> getDependApplicationsByCode(Variable variable) {
+ List<FlinkApplication> dependApplications = new ArrayList<>();
+ List<FlinkApplication> applications = applicationManageService.listByTeamId(variable.getTeamId());
+ Map<Long, FlinkApplication> applicationMap = applications.stream()
+ .collect(Collectors.toMap(FlinkApplication::getId, application -> application));
// Get applications that depend on this variable in application args
- for (Application app : applications) {
+ for (FlinkApplication app : applications) {
if (isDepend(variable.getVariableCode(), app.getArgs())) {
dependApplications.add(app);
}
@@ -225,7 +225,7 @@ public class VariableServiceImpl extends ServiceImpl<VariableMapper, Variable>
List<FlinkSql> flinkSqls = flinkSqlService.listByTeamId(variable.getTeamId());
for (FlinkSql flinkSql : flinkSqls) {
if (isDepend(variable.getVariableCode(), DeflaterUtils.unzipString(flinkSql.getSql()))) {
- Application app = applicationMap.get(flinkSql.getAppId());
+ FlinkApplication app = applicationMap.get(flinkSql.getAppId());
if (!dependApplications.contains(app)) {
dependApplications.add(applicationMap.get(flinkSql.getAppId()));
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/YarnQueueServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/YarnQueueServiceImpl.java
index b87c4ca44..3b7367482 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/YarnQueueServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/YarnQueueServiceImpl.java
@@ -17,20 +17,20 @@
package org.apache.streampark.console.core.service.impl;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
-import org.apache.streampark.common.enums.SparkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
+import org.apache.streampark.common.enums.SparkDeployMode;
import org.apache.streampark.common.util.AssertUtils;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
import org.apache.streampark.console.core.bean.ResponseResult;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.YarnQueue;
import org.apache.streampark.console.core.mapper.YarnQueueMapper;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.YarnQueueService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@@ -70,7 +70,7 @@ public class YarnQueueServiceImpl extends ServiceImpl<YarnQueueMapper, YarnQueue
public static final String QUEUE_AVAILABLE_HINT = "The queue label is available.";
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
private FlinkClusterService flinkClusterService;
@@ -175,19 +175,19 @@ public class YarnQueueServiceImpl extends ServiceImpl<YarnQueueMapper, YarnQueue
* Only check the validation of queue-labelExpression when using yarn application or yarn-session
* mode or yarn-perjob mode.
*
- * @param executionModeEnum execution mode.
+ * @param deployModeEnum execution mode.
* @param queueLabel queueLabel expression.
*/
@Override
- public void checkQueueLabel(FlinkExecutionMode executionModeEnum, String queueLabel) {
- if (FlinkExecutionMode.isYarnMode(executionModeEnum)) {
+ public void checkQueueLabel(FlinkDeployMode deployModeEnum, String queueLabel) {
+ if (FlinkDeployMode.isYarnMode(deployModeEnum)) {
ApiAlertException.throwIfFalse(isValid(queueLabel, true), ERR_FORMAT_HINTS);
}
}
@Override
- public void checkQueueLabel(SparkExecutionMode executionModeEnum, String queueLabel) {
- if (SparkExecutionMode.isYarnMode(executionModeEnum)) {
+ public void checkQueueLabel(SparkDeployMode deployModeEnum, String queueLabel) {
+ if (SparkDeployMode.isYarnMode(deployModeEnum)) {
ApiAlertException.throwIfFalse(isValid(queueLabel, true), ERR_FORMAT_HINTS);
}
}
@@ -227,7 +227,7 @@ public class YarnQueueServiceImpl extends ServiceImpl<YarnQueueMapper, YarnQueue
public void checkNotReferencedByFlinkClusters(
@Nonnull String queueLabel, @Nonnull String operation) {
List<FlinkCluster> clustersReferenceYarnQueueLabel = flinkClusterService
- .listByExecutionModes(Sets.newHashSet(FlinkExecutionMode.YARN_SESSION))
+ .listByDeployModes(Sets.newHashSet(FlinkDeployMode.YARN_SESSION))
.stream()
.filter(flinkCluster -> StringUtils.equals(flinkCluster.getYarnQueue(), queueLabel))
.collect(Collectors.toList());
@@ -240,12 +240,12 @@ public class YarnQueueServiceImpl extends ServiceImpl<YarnQueueMapper, YarnQueue
public void checkNotReferencedByApplications(
@Nonnull Long teamId, @Nonnull String queueLabel,
@Nonnull String operation) {
- List<Application> appsReferenceQueueLabel = applicationManageService
- .listByTeamIdAndExecutionModes(
+ List<FlinkApplication> appsReferenceQueueLabel = applicationManageService
+ .listByTeamIdAndDeployModes(
teamId,
Sets.newHashSet(
- FlinkExecutionMode.YARN_APPLICATION,
- FlinkExecutionMode.YARN_PER_JOB))
+ FlinkDeployMode.YARN_APPLICATION,
+ FlinkDeployMode.YARN_PER_JOB))
.stream()
.filter(
application -> {
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/ApplicationBackUpCleanTask.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/ApplicationBackUpCleanTask.java
index 4d0cc5db3..22fa38e0f 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/ApplicationBackUpCleanTask.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/ApplicationBackUpCleanTask.java
@@ -17,8 +17,8 @@
package org.apache.streampark.console.core.task;
-import org.apache.streampark.console.core.entity.ApplicationBackUp;
-import org.apache.streampark.console.core.service.ApplicationBackUpService;
+import org.apache.streampark.console.core.entity.FlinkApplicationBackUp;
+import org.apache.streampark.console.core.service.FlinkApplicationBackUpService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -31,7 +31,7 @@ import org.springframework.stereotype.Component;
@RequiredArgsConstructor
public class ApplicationBackUpCleanTask {
- private final ApplicationBackUpService backUpService;
+ private final FlinkApplicationBackUpService backUpService;
@Value("${streampark.backup-clean.max-backup-num:5}")
public Integer maxBackupNum;
@@ -40,15 +40,15 @@ public class ApplicationBackUpCleanTask {
public void backUpClean() {
log.info("Start to clean application backup");
// select all application backup which count > maxBackupNum group by app_id
- backUpService.lambdaQuery().groupBy(ApplicationBackUp::getAppId)
+ backUpService.lambdaQuery().groupBy(FlinkApplicationBackUp::getAppId)
.having("count(*) > " + maxBackupNum).list().stream()
- .map(ApplicationBackUp::getAppId)
+ .map(FlinkApplicationBackUp::getAppId)
.forEach(
appId -> {
// order by create_time desc and skip first maxBackupNum records and delete
// others
- backUpService.lambdaQuery().eq(ApplicationBackUp::getAppId, appId)
- .orderByDesc(ApplicationBackUp::getCreateTime).list()
+ backUpService.lambdaQuery().eq(FlinkApplicationBackUp::getAppId, appId)
+ .orderByDesc(FlinkApplicationBackUp::getCreateTime).list()
.stream()
.skip(maxBackupNum)
.forEach(
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/utils/AlertTemplateUtils.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/utils/AlertTemplateUtils.java
index 87ccdabca..5b9675a5a 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/utils/AlertTemplateUtils.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/utils/AlertTemplateUtils.java
@@ -21,7 +21,7 @@ import org.apache.streampark.common.enums.ClusterState;
import org.apache.streampark.common.util.DateUtils;
import org.apache.streampark.console.core.bean.AlertProbeMsg;
import org.apache.streampark.console.core.bean.AlertTemplate;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.SparkApplication;
import org.apache.streampark.console.core.enums.AlertTypeEnum;
@@ -40,11 +40,11 @@ public class AlertTemplateUtils {
private static final String PROBE = "PROBE";
- public static AlertTemplate createAlertTemplate(Application application, FlinkAppStateEnum appState) {
+ public static AlertTemplate createAlertTemplate(FlinkApplication application, FlinkAppStateEnum appState) {
return AlertTemplate.builder()
.duration(application.getStartTime(), application.getEndTime())
.jobName(application.getJobName())
- .link(application.getFlinkExecutionMode(), application.getClusterId())
+ .link(application.getFlinkDeployMode(), application.getClusterId())
.startTime(application.getStartTime())
.endTime(application.getEndTime())
.restart(application.isNeedRestartOnFailed(), application.getRestartCount())
@@ -62,11 +62,11 @@ public class AlertTemplateUtils {
.build();
}
- public static AlertTemplate createAlertTemplate(Application application, CheckPointStatusEnum statusEnum) {
+ public static AlertTemplate createAlertTemplate(FlinkApplication application, CheckPointStatusEnum statusEnum) {
return AlertTemplate.builder()
.duration(application.getStartTime(), application.getEndTime())
.jobName(application.getJobName())
- .link(application.getFlinkExecutionMode(), application.getClusterId())
+ .link(application.getFlinkDeployMode(), application.getClusterId())
.startTime(application.getStartTime())
.type(AlertTypeEnum.DING_TALK.getCode())
.cpFailureRateInterval(
@@ -86,7 +86,7 @@ public class AlertTemplateUtils {
return AlertTemplate.builder()
.duration(cluster.getStartTime(), cluster.getEndTime())
.jobName(cluster.getClusterName())
- .link(cluster.getFlinkExecutionModeEnum(), cluster.getClusterId())
+ .link(cluster.getFlinkDeployModeEnum(), cluster.getClusterId())
.startTime(cluster.getStartTime())
.endTime(cluster.getEndTime())
.type(3)
@@ -120,7 +120,7 @@ public class AlertTemplateUtils {
return AlertTemplate.builder()
.duration(application.getStartTime(), application.getEndTime())
.jobName(application.getAppName())
- .link(application.getSparkExecutionMode(), application.getAppId())
+ .link(application.getSparkDeployMode(), application.getAppId())
.startTime(application.getStartTime())
.endTime(application.getEndTime())
.restart(application.isNeedRestartOnFailed(), application.getRestartCount())
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkAppHttpWatcher.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkAppHttpWatcher.java
index b15c9ab31..7b19f853a 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkAppHttpWatcher.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkAppHttpWatcher.java
@@ -17,14 +17,14 @@
package org.apache.streampark.console.core.watcher;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.common.util.DateUtils;
import org.apache.streampark.common.util.HttpClientUtils;
import org.apache.streampark.common.util.YarnUtils;
import org.apache.streampark.console.base.util.JacksonUtils;
import org.apache.streampark.console.core.bean.AlertTemplate;
import org.apache.streampark.console.core.component.FlinkCheckpointProcessor;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.FlinkStateChangeEvent;
import org.apache.streampark.console.core.enums.FlinkAppStateEnum;
@@ -39,9 +39,9 @@ import org.apache.streampark.console.core.service.DistributedTaskService;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.SavepointService;
import org.apache.streampark.console.core.service.alert.AlertService;
-import org.apache.streampark.console.core.service.application.ApplicationActionService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationActionService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.utils.AlertTemplateUtils;
import org.apache.commons.lang3.StringUtils;
@@ -79,13 +79,13 @@ import java.util.stream.Collectors;
public class FlinkAppHttpWatcher {
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
- private ApplicationActionService applicationActionService;
+ private FlinkApplicationActionService applicationActionService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@Autowired
private AlertService alertService;
@@ -133,7 +133,7 @@ public class FlinkAppHttpWatcher {
Caffeine.newBuilder().expireAfterWrite(5, TimeUnit.MINUTES).build();
/** tracking task list */
- private static final Map<Long, Application> WATCHING_APPS = new ConcurrentHashMap<>(0);
+ private static final Map<Long, FlinkApplication> WATCHING_APPS = new ConcurrentHashMap<>(0);
/**
*
@@ -180,10 +180,10 @@ public class FlinkAppHttpWatcher {
@PostConstruct
public void init() {
WATCHING_APPS.clear();
- List<Application> applications = distributedTaskService.getMonitoredTaskList(applicationManageService.list(
- new LambdaQueryWrapper<Application>()
- .eq(Application::getTracking, 1)
- .notIn(Application::getExecutionMode, FlinkExecutionMode.getKubernetesMode())));
+ List<FlinkApplication> applications = distributedTaskService.getMonitoredTaskList(applicationManageService.list(
+ new LambdaQueryWrapper<FlinkApplication>()
+ .eq(FlinkApplication::getTracking, 1)
+ .notIn(FlinkApplication::getDeployMode, FlinkDeployMode.getKubernetesMode())));
applications.forEach(
(app) -> {
WATCHING_APPS.put(app.getId(), app);
@@ -218,7 +218,7 @@ public class FlinkAppHttpWatcher {
}
}
- private void watch(Long id, Application application) {
+ private void watch(Long id, FlinkApplication application) {
watchExecutor.execute(
() -> {
try {
@@ -237,11 +237,11 @@ public class FlinkAppHttpWatcher {
});
}
- private void cleanupLost(Application application) {
+ private void cleanupLost(FlinkApplication application) {
LOST_CACHE.invalidate(application.getId());
}
- private void doStateFailed(Application application) {
+ private void doStateFailed(FlinkApplication application) {
/*
* Query from flink's restAPI and yarn's restAPI both failed. In this case, it is necessary to decide whether to
* return to the final state depending on the state being operated
@@ -294,13 +294,13 @@ public class FlinkAppHttpWatcher {
*
* @param application application
*/
- private void getStateFromFlink(Application application) throws Exception {
+ private void getStateFromFlink(FlinkApplication application) throws Exception {
StopFromEnum stopFrom = getStopFrom(application);
JobsOverview jobsOverview = httpJobsOverview(application);
Optional<JobsOverview.Job> optional;
- FlinkExecutionMode execMode = application.getFlinkExecutionMode();
- if (FlinkExecutionMode.YARN_APPLICATION.equals(execMode)
- || FlinkExecutionMode.YARN_PER_JOB.equals(execMode)) {
+ FlinkDeployMode deployMode = application.getFlinkDeployMode();
+ if (FlinkDeployMode.YARN_APPLICATION.equals(deployMode)
+ || FlinkDeployMode.YARN_PER_JOB.equals(deployMode)) {
if (jobsOverview.getJobs() != null) {
optional =
jobsOverview.getJobs().size() > 1
@@ -346,7 +346,7 @@ public class FlinkAppHttpWatcher {
}
}
- private StopFromEnum getStopFrom(Application application) {
+ private StopFromEnum getStopFrom(FlinkApplication application) {
return STOP_FROM_MAP.getOrDefault(application.getId(), null) == null
? StopFromEnum.NONE
: STOP_FROM_MAP.get(application.getId());
@@ -358,7 +358,7 @@ public class FlinkAppHttpWatcher {
* @param application application
* @param jobOverview jobOverview
*/
- private void handleJobOverview(Application application, JobsOverview.Job jobOverview) throws IOException {
+ private void handleJobOverview(FlinkApplication application, JobsOverview.Job jobOverview) throws IOException {
// compute duration
long startTime = jobOverview.getStartTime();
long endTime = jobOverview.getEndTime();
@@ -389,7 +389,7 @@ public class FlinkAppHttpWatcher {
}
/** get latest checkpoint */
- private void handleCheckPoints(Application application) throws Exception {
+ private void handleCheckPoints(FlinkApplication application) throws Exception {
CheckPoints checkPoints = httpCheckpoints(application);
if (checkPoints != null) {
checkpointProcessor.process(application, checkPoints);
@@ -404,7 +404,7 @@ public class FlinkAppHttpWatcher {
* @param currentState currentState
*/
private void handleRunningState(
- Application application, OptionStateEnum optionState,
+ FlinkApplication application, OptionStateEnum optionState,
FlinkAppStateEnum currentState) {
/*
* if the last recorded state is STARTING and the latest state obtained this time is RUNNING, which means it is
@@ -415,15 +415,15 @@ public class FlinkAppHttpWatcher {
*/
Long appId = application.getId();
if (OptionStateEnum.STARTING.equals(optionState)) {
- Application latestApp = WATCHING_APPS.get(appId);
+ FlinkApplication latestApp = WATCHING_APPS.get(appId);
ReleaseStateEnum releaseState = latestApp.getReleaseState();
switch (releaseState) {
case NEED_RESTART:
case NEED_ROLLBACK:
- LambdaUpdateWrapper<Application> updateWrapper =
- new LambdaUpdateWrapper<Application>()
- .eq(Application::getId, appId)
- .set(Application::getRelease, ReleaseStateEnum.DONE.get());
+ LambdaUpdateWrapper<FlinkApplication> updateWrapper =
+ new LambdaUpdateWrapper<FlinkApplication>()
+ .eq(FlinkApplication::getId, appId)
+ .set(FlinkApplication::getRelease, ReleaseStateEnum.DONE.get());
applicationManageService.update(updateWrapper);
break;
default:
@@ -443,7 +443,7 @@ public class FlinkAppHttpWatcher {
cleanOptioning(optionState, appId);
}
- private void doPersistMetrics(Application application, boolean stopWatch) {
+ private void doPersistMetrics(FlinkApplication application, boolean stopWatch) {
Long appId = application.getId();
if (FlinkAppStateEnum.isEndState(application.getState())) {
application.setOverview(null);
@@ -477,7 +477,7 @@ public class FlinkAppHttpWatcher {
* @param stopFrom stopFrom
*/
private void handleNotRunState(
- Application application,
+ FlinkApplication application,
OptionStateEnum optionState,
FlinkAppStateEnum currentState,
StopFromEnum stopFrom) throws Exception {
@@ -535,7 +535,7 @@ public class FlinkAppHttpWatcher {
*
* @param application application
*/
- private void getStateFromYarn(Application application) throws Exception {
+ private void getStateFromYarn(FlinkApplication application) throws Exception {
log.debug("[StreamPark][FlinkAppHttpWatcher] getFromYarnRestApi starting...");
StopFromEnum stopFrom = getStopFrom(application);
OptionStateEnum optionState = OPTIONING.get(application.getId());
@@ -575,7 +575,7 @@ public class FlinkAppHttpWatcher {
// query the status from the yarn rest Api
YarnAppInfo yarnAppInfo = httpYarnAppInfo(application);
if (yarnAppInfo == null) {
- if (!FlinkExecutionMode.REMOTE.equals(application.getFlinkExecutionMode())) {
+ if (!FlinkDeployMode.REMOTE.equals(application.getFlinkDeployMode())) {
throw new RuntimeException(
"[StreamPark][FlinkAppHttpWatcher] getFromYarnRestApi failed ");
}
@@ -614,7 +614,7 @@ public class FlinkAppHttpWatcher {
}
}
} catch (Exception e) {
- if (!FlinkExecutionMode.REMOTE.equals(application.getFlinkExecutionMode())) {
+ if (!FlinkDeployMode.REMOTE.equals(application.getFlinkDeployMode())) {
throw new RuntimeException(
"[StreamPark][FlinkAppHttpWatcher] getFromYarnRestApi error,", e);
}
@@ -623,7 +623,7 @@ public class FlinkAppHttpWatcher {
}
}
- private void doAlert(Application application, FlinkAppStateEnum flinkAppState) {
+ private void doAlert(FlinkApplication application, FlinkAppStateEnum flinkAppState) {
AlertTemplate alertTemplate =
AlertTemplateUtils.createAlertTemplate(application, flinkAppState);
alertService.alert(application.getAlertId(), alertTemplate);
@@ -636,7 +636,7 @@ public class FlinkAppHttpWatcher {
}
}
- public void cleanSavepoint(Application application) {
+ public void cleanSavepoint(FlinkApplication application) {
application.setOptionState(OptionStateEnum.NONE.getValue());
FlinkStateChangeEvent event = PREVIOUS_STATUS.getIfPresent(application.getId());
if (event != null && event.getOptionState() == OptionStateEnum.SAVEPOINTING) {
@@ -657,7 +657,7 @@ public class FlinkAppHttpWatcher {
}
}
- public static void doWatching(Application application) {
+ public static void doWatching(FlinkApplication application) {
if (application.isKubernetesModeJob()) {
return;
}
@@ -706,28 +706,28 @@ public class FlinkAppHttpWatcher {
return CANCELLED_JOB_MAP.get(appId) == null ? Long.valueOf(-1) : CANCELLED_JOB_MAP.get(appId);
}
- public static Collection<Application> getWatchingApps() {
+ public static Collection<FlinkApplication> getWatchingApps() {
return WATCHING_APPS.values();
}
private static boolean isKubernetesApp(Long appId) {
- Application app = WATCHING_APPS.get(appId);
+ FlinkApplication app = WATCHING_APPS.get(appId);
if (app == null) {
return false;
}
return app.isKubernetesModeJob();
}
- private YarnAppInfo httpYarnAppInfo(Application application) throws Exception {
+ private YarnAppInfo httpYarnAppInfo(FlinkApplication application) throws Exception {
String reqURL = "ws/v1/cluster/apps/".concat(application.getClusterId());
return yarnRestRequest(reqURL, YarnAppInfo.class);
}
- private Overview httpOverview(Application application) throws IOException {
+ private Overview httpOverview(FlinkApplication application) throws IOException {
String appId = application.getClusterId();
if (appId != null) {
- if (application.getFlinkExecutionMode().equals(FlinkExecutionMode.YARN_APPLICATION)
- || application.getFlinkExecutionMode().equals(FlinkExecutionMode.YARN_PER_JOB)) {
+ if (application.getFlinkDeployMode().equals(FlinkDeployMode.YARN_APPLICATION)
+ || application.getFlinkDeployMode().equals(FlinkDeployMode.YARN_PER_JOB)) {
String reqURL;
if (StringUtils.isEmpty(application.getJobManagerUrl())) {
String format = "proxy/%s/overview";
@@ -742,10 +742,10 @@ public class FlinkAppHttpWatcher {
return null;
}
- private JobsOverview httpJobsOverview(Application application) throws Exception {
+ private JobsOverview httpJobsOverview(FlinkApplication application) throws Exception {
final String flinkUrl = "jobs/overview";
- FlinkExecutionMode execMode = application.getFlinkExecutionMode();
- if (FlinkExecutionMode.isYarnMode(execMode)) {
+ FlinkDeployMode deployMode = application.getFlinkDeployMode();
+ if (FlinkDeployMode.isYarnMode(deployMode)) {
String reqURL;
if (StringUtils.isEmpty(application.getJobManagerUrl())) {
String format = "proxy/%s/" + flinkUrl;
@@ -757,7 +757,7 @@ public class FlinkAppHttpWatcher {
return yarnRestRequest(reqURL, JobsOverview.class);
}
- if (application.getJobId() != null && FlinkExecutionMode.isRemoteMode(execMode)) {
+ if (application.getJobId() != null && FlinkDeployMode.isRemoteMode(deployMode)) {
return httpRemoteCluster(
application.getFlinkClusterId(),
cluster -> {
@@ -776,10 +776,10 @@ public class FlinkAppHttpWatcher {
return null;
}
- private CheckPoints httpCheckpoints(Application application) throws Exception {
+ private CheckPoints httpCheckpoints(FlinkApplication application) throws Exception {
final String flinkUrl = "jobs/%s/checkpoints";
- FlinkExecutionMode execMode = application.getFlinkExecutionMode();
- if (FlinkExecutionMode.isYarnMode(execMode)) {
+ FlinkDeployMode deployMode = application.getFlinkDeployMode();
+ if (FlinkDeployMode.isYarnMode(deployMode)) {
String reqURL;
if (StringUtils.isEmpty(application.getJobManagerUrl())) {
String format = "proxy/%s/" + flinkUrl;
@@ -791,7 +791,7 @@ public class FlinkAppHttpWatcher {
return yarnRestRequest(reqURL, CheckPoints.class);
}
- if (application.getJobId() != null && FlinkExecutionMode.isRemoteMode(execMode)) {
+ if (application.getJobId() != null && FlinkDeployMode.isRemoteMode(deployMode)) {
return httpRemoteCluster(
application.getFlinkClusterId(),
cluster -> {
@@ -846,7 +846,7 @@ public class FlinkAppHttpWatcher {
R call(T e) throws Exception;
}
- public static FlinkStateChangeEvent createStateChangeEvent(Application application) {
+ public static FlinkStateChangeEvent createStateChangeEvent(FlinkApplication application) {
FlinkStateChangeEvent event = new FlinkStateChangeEvent();
event.setId(application.getId());
event.setOptionState(OptionStateEnum.getState(application.getOptionState()));
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkClusterWatcher.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkClusterWatcher.java
index e8d2b90f6..ed1142574 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkClusterWatcher.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkClusterWatcher.java
@@ -20,7 +20,7 @@ package org.apache.streampark.console.core.watcher;
import org.apache.streampark.common.conf.CommonConfig;
import org.apache.streampark.common.conf.InternalConfigHolder;
import org.apache.streampark.common.enums.ClusterState;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.common.util.HadoopUtils;
import org.apache.streampark.common.util.HttpClientUtils;
import org.apache.streampark.common.util.YarnUtils;
@@ -30,7 +30,7 @@ import org.apache.streampark.console.core.metrics.flink.Overview;
import org.apache.streampark.console.core.metrics.yarn.YarnAppInfo;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.alert.AlertService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
import org.apache.streampark.console.core.utils.AlertTemplateUtils;
import org.apache.commons.lang3.StringUtils;
@@ -69,7 +69,7 @@ public class FlinkClusterWatcher {
private AlertService alertService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
private static final Timeout HTTP_TIMEOUT = Timeout.ofSeconds(5L);
@@ -99,7 +99,7 @@ public class FlinkClusterWatcher {
new LambdaQueryWrapper<FlinkCluster>()
.eq(FlinkCluster::getClusterState, ClusterState.RUNNING.getState())
// excluding flink clusters on kubernetes
- .notIn(FlinkCluster::getExecutionMode, FlinkExecutionMode.getKubernetesMode()));
+ .notIn(FlinkCluster::getDeployMode, FlinkDeployMode.getKubernetesMode()));
flinkClusters.forEach(cluster -> WATCHER_CLUSTERS.put(cluster.getId(), cluster));
}
@@ -194,7 +194,7 @@ public class FlinkClusterWatcher {
* @return
*/
private ClusterState httpClusterState(FlinkCluster flinkCluster) {
- switch (flinkCluster.getFlinkExecutionModeEnum()) {
+ switch (flinkCluster.getFlinkDeployModeEnum()) {
case REMOTE:
return httpRemoteClusterState(flinkCluster);
case YARN_SESSION:
@@ -263,7 +263,7 @@ public class FlinkClusterWatcher {
* @param flinkCluster
*/
public static void addWatching(FlinkCluster flinkCluster) {
- if (!FlinkExecutionMode.isKubernetesMode(flinkCluster.getFlinkExecutionModeEnum())
+ if (!FlinkDeployMode.isKubernetesMode(flinkCluster.getFlinkDeployModeEnum())
&& !WATCHER_CLUSTERS.containsKey(flinkCluster.getId())) {
log.info("add the cluster with id:{} to watcher cluster cache", flinkCluster.getId());
WATCHER_CLUSTERS.put(flinkCluster.getId(), flinkCluster);
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkK8sChangeEventListener.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkK8sChangeEventListener.java
index e56e282ac..5b3ee5903 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkK8sChangeEventListener.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkK8sChangeEventListener.java
@@ -17,17 +17,17 @@
package org.apache.streampark.console.core.watcher;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.console.core.component.FlinkCheckpointProcessor;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.enums.FlinkAppStateEnum;
import org.apache.streampark.console.core.enums.OptionStateEnum;
import org.apache.streampark.console.core.metrics.flink.CheckPoints;
import org.apache.streampark.console.core.service.alert.AlertService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.utils.AlertTemplateUtils;
import org.apache.streampark.flink.kubernetes.enums.FlinkJobState;
-import org.apache.streampark.flink.kubernetes.enums.FlinkK8sExecuteMode;
+import org.apache.streampark.flink.kubernetes.enums.FlinkK8sDeployMode;
import org.apache.streampark.flink.kubernetes.event.FlinkClusterMetricChangeEvent;
import org.apache.streampark.flink.kubernetes.event.FlinkJobCheckpointChangeEvent;
import org.apache.streampark.flink.kubernetes.event.FlinkJobStatusChangeEvent;
@@ -65,7 +65,7 @@ public class FlinkK8sChangeEventListener {
@Lazy
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Lazy
@Autowired
@@ -90,7 +90,7 @@ public class FlinkK8sChangeEventListener {
JobStatusCV jobStatus = event.jobStatus();
TrackId trackId = event.trackId();
// get pre application record
- Application app = applicationManageService.getById(trackId.appId());
+ FlinkApplication app = applicationManageService.getById(trackId.appId());
if (app == null) {
return;
}
@@ -118,13 +118,13 @@ public class FlinkK8sChangeEventListener {
@Subscribe
public void subscribeMetricsChange(FlinkClusterMetricChangeEvent event) {
TrackId trackId = event.trackId();
- FlinkExecutionMode mode = FlinkK8sExecuteMode.toFlinkExecutionMode(trackId.executeMode());
+ FlinkDeployMode mode = FlinkK8sDeployMode.toFlinkDeployMode(trackId.executeMode());
// discard session mode change
- if (FlinkExecutionMode.KUBERNETES_NATIVE_SESSION == mode) {
+ if (FlinkDeployMode.KUBERNETES_NATIVE_SESSION == mode) {
return;
}
- Application app = applicationManageService.getById(trackId.appId());
+ FlinkApplication app = applicationManageService.getById(trackId.appId());
if (app == null) {
return;
}
@@ -160,7 +160,7 @@ public class FlinkK8sChangeEventListener {
applicationManageService.getById(event.trackId().appId()), checkPoint);
}
- private void setByJobStatusCV(Application app, JobStatusCV jobStatus) {
+ private void setByJobStatusCV(FlinkApplication app, JobStatusCV jobStatus) {
// infer the final flink job state
Enumeration.Value state = FlinkJobStatusWatcher.inferFlinkJobStateFromPersist(
jobStatus.jobState(), toK8sFlinkJobState(app.getStateEnum()));
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkK8sWatcherWrapper.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkK8sWatcherWrapper.java
index c4bb3ad87..5979c489f 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkK8sWatcherWrapper.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkK8sWatcherWrapper.java
@@ -17,14 +17,14 @@
package org.apache.streampark.console.core.watcher;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.common.util.PropertiesUtils;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.FlinkEnv;
import org.apache.streampark.console.core.service.FlinkClusterService;
import org.apache.streampark.console.core.service.FlinkEnvService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.flink.kubernetes.FlinkK8sWatcher;
import org.apache.streampark.flink.kubernetes.FlinkK8sWatcherFactory;
import org.apache.streampark.flink.kubernetes.FlinkTrackConfig;
@@ -69,7 +69,7 @@ public class FlinkK8sWatcherWrapper {
@Lazy
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Lazy
@Autowired
@@ -108,12 +108,12 @@ public class FlinkK8sWatcherWrapper {
/** get flink-k8s job tracking application from db. */
private List<TrackId> getK8sWatchingApps() {
// query k8s execution mode application from db
- final LambdaQueryWrapper<Application> queryWrapper = new LambdaQueryWrapper<>();
+ final LambdaQueryWrapper<FlinkApplication> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
- .eq(Application::getTracking, 1)
- .in(Application::getExecutionMode, FlinkExecutionMode.getKubernetesMode());
+ .eq(FlinkApplication::getTracking, 1)
+ .in(FlinkApplication::getDeployMode, FlinkDeployMode.getKubernetesMode());
- List<Application> k8sApplication = applicationManageService.list(queryWrapper);
+ List<FlinkApplication> k8sApplication = applicationManageService.list(queryWrapper);
if (CollectionUtils.isEmpty(k8sApplication)) {
return Lists.newArrayList();
}
@@ -124,7 +124,7 @@ public class FlinkK8sWatcherWrapper {
.collect(Collectors.toList());
}
- public TrackId toTrackId(Application app) {
+ public TrackId toTrackId(FlinkApplication app) {
FlinkEnv flinkEnv = flinkEnvService.getById(app.getVersionId());
Properties properties = flinkEnv.getFlinkConfig();
@@ -134,7 +134,7 @@ public class FlinkK8sWatcherWrapper {
if (archiveDir != null) {
properties.put(JobManagerOptions.ARCHIVE_DIR.key(), archiveDir);
}
- if (FlinkExecutionMode.isKubernetesApplicationMode(app.getExecutionMode())) {
+ if (FlinkDeployMode.isKubernetesApplicationMode(app.getDeployMode())) {
return TrackId.onApplication(
app.getK8sNamespace(),
app.getJobName(),
@@ -142,7 +142,7 @@ public class FlinkK8sWatcherWrapper {
app.getJobId(),
app.getTeamId().toString(),
properties);
- } else if (FlinkExecutionMode.isKubernetesSessionMode(app.getExecutionMode())) {
+ } else if (FlinkDeployMode.isKubernetesSessionMode(app.getDeployMode())) {
FlinkCluster flinkCluster = flinkClusterService.getById(app.getFlinkClusterId());
String namespace = flinkCluster.getK8sNamespace();
String clusterId = flinkCluster.getClusterId();
@@ -154,7 +154,7 @@ public class FlinkK8sWatcherWrapper {
app.getTeamId().toString(),
properties);
} else {
- throw new IllegalArgumentException("Illegal K8sExecuteMode, mode=" + app.getExecutionMode());
+ throw new IllegalArgumentException("Illegal K8sExecuteMode, mode=" + app.getDeployMode());
}
}
}
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/TeamServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/TeamServiceImpl.java
index 3c698611c..a2b5a07df 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/TeamServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/TeamServiceImpl.java
@@ -24,7 +24,7 @@ import org.apache.streampark.console.base.mybatis.pager.MybatisPager;
import org.apache.streampark.console.core.enums.UserTypeEnum;
import org.apache.streampark.console.core.service.ProjectService;
import org.apache.streampark.console.core.service.VariableService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
import org.apache.streampark.console.core.util.ServiceHelper;
import org.apache.streampark.console.system.entity.Team;
import org.apache.streampark.console.system.entity.User;
@@ -55,7 +55,7 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements Te
private UserService userService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@Autowired
private ProjectService projectService;
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
index 471cbbb1c..cf9de0521 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
@@ -27,8 +27,8 @@ import org.apache.streampark.console.base.util.ShaHashUtils;
import org.apache.streampark.console.core.enums.AuthenticationType;
import org.apache.streampark.console.core.enums.LoginTypeEnum;
import org.apache.streampark.console.core.service.ResourceService;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.system.authentication.JWTToken;
import org.apache.streampark.console.system.authentication.JWTUtil;
import org.apache.streampark.console.system.entity.Member;
@@ -77,10 +77,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
private MenuService menuService;
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@Autowired
private ResourceService resourceService;
diff --git a/streampark-console/streampark-console-service/src/main/resources/db/data-h2.sql b/streampark-console/streampark-console-service/src/main/resources/db/data-h2.sql
index 770f9646c..f8459eee8 100644
--- a/streampark-console/streampark-console-service/src/main/resources/db/data-h2.sql
+++ b/streampark-console/streampark-console-service/src/main/resources/db/data-h2.sql
@@ -25,7 +25,7 @@ insert into `t_team` values (100001, 'test', 'The test team', now(), now());
-- Records of t_flink_app
-- ----------------------------
INSERT INTO `t_flink_app` (
- `id`, `team_id`, `job_type`, `execution_mode`, `job_name`, `user_id`, `app_type`, `state`, `restart_size`,
+ `id`, `team_id`, `job_type`, `deploy_mode`, `job_name`, `user_id`, `app_type`, `state`, `restart_size`,
`description`,`resolve_order`,`option_state`,`tracking`,`create_time`, `modify_time`,`release`, `build`,
`k8s_hadoop_integration`,`tags`
) VALUES (100000, 100000, 2, 4, 'Flink SQL Demo', 100000, 1, '0', 0, 'Flink SQL Demo', 0, 0, 0, now(), now(), 1, 1, 0, 'streampark,test');
@@ -49,7 +49,7 @@ insert into `t_flink_sql` values (100000, 100000, 'eNqlUUtPhDAQvu+vmFs1AYIHT5s94
-- Records of t_spark_app
-- ----------------------------
insert into `t_spark_app` (
- `id`, `team_id`, `job_type`, `app_type`, `app_name`, `execution_mode`, `resource_from`, `main_class`,
+ `id`, `team_id`, `job_type`, `app_type`, `app_name`, `deploy_mode`, `resource_from`, `main_class`,
`yarn_queue`, `k8s_image_pull_policy`, `k8s_namespace`, `state`, `option_state`, `user_id`,
`description`, `tracking`, `release`, `build`, `create_time`, `modify_time`, `tags`)
values (100000, 100000, 2, 4, 'Spark SQL Demo', 2, 2, 'org.apache.streampark.spark.cli.SqlClient', 'default', 0, 'default', 0, 0, 100000, 'Spark SQL Demo', 0, 1, 1, now(), now(), 'streampark,test');
diff --git a/streampark-console/streampark-console-service/src/main/resources/db/schema-h2.sql b/streampark-console/streampark-console-service/src/main/resources/db/schema-h2.sql
index 12844e01e..b427e28d1 100644
--- a/streampark-console/streampark-console-service/src/main/resources/db/schema-h2.sql
+++ b/streampark-console/streampark-console-service/src/main/resources/db/schema-h2.sql
@@ -16,9 +16,9 @@
*/
-- ----------------------------
--- Table structure for t_app_backup
+-- Table structure for t_flink_app_backup
-- ----------------------------
-create table if not exists `t_app_backup` (
+create table if not exists `t_flink_app_backup` (
`id` bigint generated by default as identity not null,
`app_id` bigint default null,
`sql_id` bigint default null,
@@ -38,7 +38,7 @@ create table if not exists `t_flink_app` (
`id` bigint generated by default as identity not null,
`team_id` bigint not null,
`job_type` tinyint default null,
- `execution_mode` tinyint default null,
+ `deploy_mode` tinyint default null,
`resource_from` tinyint default null,
`project_id` bigint default null,
`job_name` varchar(255) default null,
@@ -416,7 +416,7 @@ create table if not exists `t_flink_cluster` (
`cluster_name` varchar(128) not null comment 'cluster name',
`options` text comment 'json form of parameter collection ',
`yarn_queue` varchar(128) default null comment 'the yarn queue where the task is located',
- `execution_mode` tinyint not null default 1 comment 'k8s execution session mode(1:remote,3:yarn-session,5:kubernetes-session)',
+ `deploy_mode` tinyint not null default 1 comment 'k8s execution session mode(1:remote,3:yarn-session,5:kubernetes-session)',
`version_id` bigint not null comment 'flink version id',
`k8s_namespace` varchar(63) default 'default' comment 'k8s namespace',
`service_account` varchar(64) default null comment 'k8s service account',
@@ -435,7 +435,7 @@ create table if not exists `t_flink_cluster` (
`end_time` datetime default null comment 'end time',
`alert_id` bigint default null comment 'alert id',
primary key(`id`,`cluster_name`),
- unique (`cluster_id`,`address`,`execution_mode`)
+ unique (`cluster_id`,`address`,`deploy_mode`)
);
-- ----------------------------
@@ -547,7 +547,7 @@ create table if not exists `t_spark_app` (
`app_type` tinyint default null comment '(1)Apache Spark(2)StreamPark Spark',
`version_id` bigint default null comment 'spark version',
`app_name` varchar(255) default null comment 'spark.app.name',
- `execution_mode` tinyint default null comment 'spark.submit.deployMode(1)cluster(2)client',
+ `deploy_mode` tinyint default null comment 'spark.submit.deployMode(1)cluster(2)client',
`resource_from` tinyint default null,
`project_id` bigint default null,
`module` varchar(255) default null,
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/AlertConfigMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/AlertConfigMapper.xml
index 8bf9d0dcd..19561276d 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/AlertConfigMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/AlertConfigMapper.xml
@@ -18,19 +18,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.AlertConfigMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.AlertConfig">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="alert_name" jdbcType="VARCHAR" property="alertName"/>
- <result column="alert_type" jdbcType="INTEGER" property="alertType"/>
- <result column="email_params" jdbcType="VARCHAR" property="emailParams"/>
- <result column="ding_talk_params" jdbcType="VARCHAR" property="dingTalkParams"/>
- <result column="we_com_params" jdbcType="VARCHAR" property="weComParams"/>
- <result column="http_callback_params" jdbcType="VARCHAR" property="httpCallbackParams"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
- </resultMap>
-
<select id="selectAlertConfByName" resultType="org.apache.streampark.console.core.entity.AlertConfig" parameterType="org.apache.streampark.console.core.entity.AlertConfig">
select id
from t_alert_config t
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationBackUpMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationBackUpMapper.xml
deleted file mode 100644
index 273b2f62e..000000000
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationBackUpMapper.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="org.apache.streampark.console.core.mapper.ApplicationBackUpMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.ApplicationBackUp">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="app_id" jdbcType="BIGINT" property="appId"/>
- <result column="sql_id" jdbcType="BIGINT" property="sqlId"/>
- <result column="config_id" jdbcType="BIGINT" property="configId"/>
- <result column="path" jdbcType="VARCHAR" property="path"/>
- <result column="version" jdbcType="INTEGER" property="version"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
-</mapper>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationLogMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationLogMapper.xml
index fb0eb52da..8de207b84 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationLogMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationLogMapper.xml
@@ -18,15 +18,5 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.ApplicationLogMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.ApplicationLog">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="job_id" jdbcType="BIGINT" property="jobId"/>
- <result column="yarn_app_id" jdbcType="VARCHAR" property="yarnAppId"/>
- <result column="job_manager_url" jdbcType="VARCHAR" property="jobManagerUrl"/>
- <result column="success" jdbcType="INTEGER" property="success"/>
- <result column="exception" jdbcType="LONGVARCHAR" property="exception"/>
- <result column="option_time" jdbcType="DATE" property="optionTime"/>
- <result column="option_name" jdbcType="INTEGER" property="optionName"/>
- </resultMap>
</mapper>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/EffectiveMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/EffectiveMapper.xml
index 0aa9b3f4c..59a6ac14a 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/EffectiveMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/EffectiveMapper.xml
@@ -17,11 +17,5 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.EffectiveMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.Effective">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="app_id" jdbcType="BIGINT" property="appId"/>
- <result column="target_type" jdbcType="BIGINT" property="targetType"/>
- <result column="target_id" jdbcType="BIGINT" property="targetId"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
+
</mapper>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ExternalLinkMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ExternalLinkMapper.xml
index d77e08a13..80f5ed4ef 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ExternalLinkMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ExternalLinkMapper.xml
@@ -18,13 +18,5 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.ExternalLinkMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.ExternalLink">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="badge_label" jdbcType="VARCHAR" property="badgeLabel"/>
- <result column="badge_name" jdbcType="VARCHAR" property="badgeName"/>
- <result column="badge_color" jdbcType="VARCHAR" property="badgeColor"/>
- <result column="link_url" jdbcType="VARCHAR" property="linkUrl"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- <result column="modify_time" jdbcType="DATE" property="modifyTime"/>
- </resultMap>
+
</mapper>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationConfigMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkApplicationConfigMapper.xml
similarity index 66%
rename from streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationConfigMapper.xml
rename to streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkApplicationConfigMapper.xml
index 6738e6a49..fb1829b1e 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationConfigMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkApplicationConfigMapper.xml
@@ -17,18 +17,9 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.streampark.console.core.mapper.ApplicationConfigMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.ApplicationConfig">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="app_id" jdbcType="BIGINT" property="appId"/>
- <result column="format" jdbcType="INTEGER" property="format"/>
- <result column="version" jdbcType="INTEGER" property="version"/>
- <result column="latest" jdbcType="BOOLEAN" property="latest"/>
- <result column="content" jdbcType="LONGVARCHAR" property="content"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
+<mapper namespace="org.apache.streampark.console.core.mapper.FlinkApplicationConfigMapper">
- <select id="selectLatest" resultType="org.apache.streampark.console.core.entity.ApplicationConfig" parameterType="java.lang.Long">
+ <select id="selectLatest" resultType="org.apache.streampark.console.core.entity.FlinkApplicationConfig" parameterType="java.lang.Long">
select *
from t_flink_config
where app_id=#{appId}
@@ -41,7 +32,7 @@
where app_id = #{appId}
</select>
- <select id="selectEffective" resultType="org.apache.streampark.console.core.entity.ApplicationConfig" parameterType="java.lang.Long">
+ <select id="selectEffective" resultType="org.apache.streampark.console.core.entity.FlinkApplicationConfig" parameterType="java.lang.Long">
select s.*
from t_flink_config s
inner join t_flink_effective e
@@ -50,7 +41,7 @@
and e.target_type = 1
</select>
- <select id="selectPageByAppId" resultType="org.apache.streampark.console.core.entity.ApplicationConfig" parameterType="java.lang.Long">
+ <select id="selectPageByAppId" resultType="org.apache.streampark.console.core.entity.FlinkApplicationConfig" parameterType="java.lang.Long">
select * from t_flink_config
where app_id=#{appId}
</select>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkApplicationMapper.xml
similarity index 66%
rename from streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationMapper.xml
rename to streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkApplicationMapper.xml
index 154518f29..045d6b112 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkApplicationMapper.xml
@@ -16,66 +16,7 @@
~ limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.streampark.console.core.mapper.ApplicationMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.Application">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="team_id" jdbcType="BIGINT" property="teamId"/>
- <result column="project_id" jdbcType="BIGINT" property="projectId"/>
- <result column="module" jdbcType="VARCHAR" property="module"/>
- <result column="args" jdbcType="LONGVARCHAR" property="args"/>
- <result column="options" jdbcType="LONGVARCHAR" property="options"/>
- <result column="dynamic_properties" jdbcType="LONGVARCHAR" property="dynamicProperties"/>
- <result column="hot_params" jdbcType="VARCHAR" property="hotParams"/>
- <result column="job_name" jdbcType="VARCHAR" property="jobName"/>
- <result column="version_id" jdbcType="BIGINT" property="versionId"/>
- <result column="cluster_id" jdbcType="VARCHAR" property="clusterId"/>
- <result column="flink_cluster_id" jdbcType="BIGINT" property="flinkClusterId"/>
- <result column="flink_image" jdbcType="VARCHAR" property="flinkImage"/>
- <result column="k8s_name" jdbcType="VARCHAR" property="k8sName"/>
- <result column="k8s_namespace" jdbcType="VARCHAR" property="k8sNamespace"/>
- <result column="app_type" jdbcType="INTEGER" property="appType"/>
- <result column="job_type" jdbcType="INTEGER" property="jobType"/>
- <result column="resource_from" jdbcType="INTEGER" property="resourceFrom"/>
- <result column="execution_mode" jdbcType="INTEGER" property="executionMode"/>
- <result column="tracking" jdbcType="INTEGER" property="tracking"/>
- <result column="jar" jdbcType="VARCHAR" property="jar"/>
- <result column="jar_check_sum" jdbcType="VARCHAR" property="jarCheckSum"/>
- <result column="main_class" jdbcType="VARCHAR" property="mainClass"/>
- <result column="job_id" jdbcType="VARCHAR" property="jobId"/>
- <result column="job_manager_url" jdbcType="VARCHAR" property="jobManagerUrl"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="start_time" jdbcType="DATE" property="startTime"/>
- <result column="end_time" jdbcType="DATE" property="endTime"/>
- <result column="duration" jdbcType="BIGINT" property="duration"/>
- <result column="state" jdbcType="INTEGER" property="state"/>
- <result column="cp_max_failure_interval" jdbcType="INTEGER" property="cpMaxFailureInterval"/>
- <result column="cp_failure_rate_interval" jdbcType="INTEGER" property="cpFailureRateInterval"/>
- <result column="cp_failure_action" jdbcType="INTEGER" property="cpFailureAction"/>
- <result column="restart_size" jdbcType="INTEGER" property="restartSize"/>
- <result column="restart_count" jdbcType="INTEGER" property="restartCount"/>
- <result column="release" jdbcType="INTEGER" property="release"/>
- <result column="build" jdbcType="BOOLEAN" property="build"/>
- <result column="resolve_order" jdbcType="INTEGER" property="resolveOrder"/>
- <result column="total_tm" jdbcType="INTEGER" property="totalTM"/>
- <result column="total_slot" jdbcType="INTEGER" property="totalSlot"/>
- <result column="available_slot" jdbcType="INTEGER" property="availableSlot"/>
- <result column="total_task" jdbcType="INTEGER" property="totalTask"/>
- <result column="jm_memory" jdbcType="INTEGER" property="jmMemory"/>
- <result column="tm_memory" jdbcType="INTEGER" property="tmMemory"/>
- <result column="option_state" jdbcType="INTEGER" property="optionState"/>
- <result column="alert_id" jdbcType="BIGINT" property="alertId"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- <result column="option_time" jdbcType="DATE" property="optionTime"/>
- <result column="k8s_rest_exposed_type" jdbcType="INTEGER" property="k8sRestExposedType"/>
- <result column="k8s_pod_template" jdbcType="LONGVARCHAR" property="k8sPodTemplate"/>
- <result column="k8s_jm_pod_template" jdbcType="LONGVARCHAR" property="k8sJmPodTemplate"/>
- <result column="k8s_tm_pod_template" jdbcType="LONGVARCHAR" property="k8sTmPodTemplate"/>
- <result column="k8s_hadoop_integration" jdbcType="TINYINT" property="k8sHadoopIntegration"/>
- <result column="rest_url" jdbcType="VARCHAR" property="restUrl"/>
- <result column="rest_port" jdbcType="INTEGER" property="restPort"/>
- <result column="tags" jdbcType="VARCHAR" property="tags"/>
- </resultMap>
+<mapper namespace="org.apache.streampark.console.core.mapper.FlinkApplicationMapper">
<update id="resetOptionState">
update t_flink_app
@@ -111,11 +52,11 @@
limit 1
</select>
- <select id="selectAppsByProjectId" resultType="org.apache.streampark.console.core.entity.Application" parameterType="java.lang.Long">
+ <select id="selectAppsByProjectId" resultType="org.apache.streampark.console.core.entity.FlinkApplication" parameterType="java.lang.Long">
select * from t_flink_app where project_id=#{projectId}
</select>
- <select id="selectPage" resultType="org.apache.streampark.console.core.entity.Application" parameterType="org.apache.streampark.console.core.entity.Application">
+ <select id="selectPage" resultType="org.apache.streampark.console.core.entity.FlinkApplication" parameterType="org.apache.streampark.console.core.entity.FlinkApplication">
select
t.*,
p.name as projectName,
@@ -144,8 +85,8 @@
#{item}
</foreach>
</if>
- <if test="app.executionMode != null and app.executionMode != ''">
- and t.execution_mode = #{app.executionMode}
+ <if test="app.deployMode != null and app.deployMode != ''">
+ and t.deploy_mode = #{app.deployMode}
</if>
<if test="app.jobName != null and app.jobName != ''">
<if test="_databaseId == 'mysql'">
@@ -186,14 +127,14 @@
</where>
</select>
- <select id="selectApp" resultType="org.apache.streampark.console.core.entity.Application" parameterType="long">
+ <select id="selectApp" resultType="org.apache.streampark.console.core.entity.FlinkApplication" parameterType="long">
select t.*, p.name as projectName
from t_flink_app t left join t_flink_project p
on t.project_id = p.id
where t.id = #{id}
</select>
- <update id="persistMetrics" parameterType="org.apache.streampark.console.core.entity.Application">
+ <update id="persistMetrics" parameterType="org.apache.streampark.console.core.entity.FlinkApplication">
update t_flink_app
<set>
<if test="app.jobId != null and app.jobId != ''">
@@ -249,7 +190,7 @@
where id=#{app.id}
</update>
- <select id="selectAppsByTeamId" resultType="org.apache.streampark.console.core.entity.Application" parameterType="java.lang.Long">
+ <select id="selectAppsByTeamId" resultType="org.apache.streampark.console.core.entity.FlinkApplication" parameterType="java.lang.Long">
select
t.*,
u.username,
@@ -264,7 +205,7 @@
where t.team_id=#{teamId}
</select>
- <update id="mapping" parameterType="org.apache.streampark.console.core.entity.Application">
+ <update id="mapping" parameterType="org.apache.streampark.console.core.entity.FlinkApplication">
update t_flink_app
<set>
<if test="app.clusterId != null">
@@ -298,7 +239,7 @@
select cluster_id, max(create_time) as ct
from t_flink_app
where cluster_id is not null
- and execution_mode = #{executionMode}
+ and deploy_mode = #{deployMode}
group by cluster_id
order by ct desc
) as ci
@@ -311,7 +252,7 @@
select flink_image, max(create_time) as ct
from t_flink_app
where flink_image is not null
- and execution_mode = 6
+ and deploy_mode = 6
group by flink_image
order by ct desc
) as fi
@@ -325,7 +266,7 @@
from t_flink_app
where k8s_pod_template is not null
and k8s_pod_template !=''
- and execution_mode = 6
+ and deploy_mode = 6
group by k8s_pod_template
order by ct desc
) as pt
@@ -339,7 +280,7 @@
from t_flink_app
where k8s_jm_pod_template is not null
and k8s_jm_pod_template != ''
- and execution_mode = 6
+ and deploy_mode = 6
group by k8s_jm_pod_template
order by ct desc
) as pt
@@ -353,7 +294,7 @@
from t_flink_app
where k8s_tm_pod_template is not null
and k8s_tm_pod_template != ''
- and execution_mode = 6
+ and deploy_mode = 6
group by k8s_tm_pod_template
order by ct desc
) as pt
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/CatalogMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkCatalogMapper.xml
similarity index 69%
rename from streampark-console/streampark-console-service/src/main/resources/mapper/core/CatalogMapper.xml
rename to streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkCatalogMapper.xml
index 9d1ffde45..e0d291ce3 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/CatalogMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkCatalogMapper.xml
@@ -16,18 +16,7 @@
~ limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.streampark.console.core.mapper.CatalogMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.FlinkCatalog">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="team_id" jdbcType="BIGINT" property="teamId"/>
- <result column="catalog_type" jdbcType="VARCHAR" property="catalogType"/>
- <result column="catalog_name" jdbcType="VARCHAR" property="catalogName"/>
- <result column="configuration" jdbcType="LONGVARCHAR" property="configuration"/>
- <result column="createTime" jdbcType="DATE" property="createTime"/>
- <result column="updateTime" jdbcType="DATE" property="updateTime"/>
- <result column="user_Id" jdbcType="LONGVARCHAR" property="userId"/>
- </resultMap>
-
+<mapper namespace="org.apache.streampark.console.core.mapper.FlinkCatalogMapper">
<select id="existsByCatalogName" resultType="java.lang.Boolean" parameterType="java.lang.String">
select
CASE
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkClusterMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkClusterMapper.xml
index 6a9ae790d..ade85d8cf 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkClusterMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkClusterMapper.xml
@@ -17,34 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.FlinkClusterMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.FlinkCluster">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="address" jdbcType="VARCHAR" property="address"/>
- <result column="job_manager_url" jdbcType="VARCHAR" property="jobManagerUrl"/>
- <result column="cluster_id" jdbcType="VARCHAR" property="clusterId"/>
- <result column="cluster_name" jdbcType="VARCHAR" property="clusterName"/>
- <result column="options" jdbcType="LONGVARCHAR" property="options"/>
- <result column="yarn_queue" jdbcType="VARCHAR" property="yarnQueue"/>
- <result column="execution_mode" jdbcType="TINYINT" property="executionMode"/>
- <result column="version_id" jdbcType="BIGINT" property="versionId"/>
- <result column="k8s_namespace" jdbcType="VARCHAR" property="k8sNamespace"/>
- <result column="service_account" jdbcType="VARCHAR" property="serviceAccount"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="flink_image" jdbcType="VARCHAR" property="flinkImage"/>
- <result column="dynamic_properties" jdbcType="LONGVARCHAR" property="dynamicProperties"/>
- <result column="k8s_rest_exposed_type" jdbcType="TINYINT" property="k8sRestExposedType"/>
- <result column="k8s_hadoop_integration" jdbcType="BOOLEAN" property="k8sHadoopIntegration"/>
- <result column="k8s_conf" jdbcType="VARCHAR" property="k8sConf"/>
- <result column="resolve_order" jdbcType="INTEGER" property="resolveOrder"/>
- <result column="exception" jdbcType="LONGVARCHAR" property="exception"/>
- <result column="cluster_state" jdbcType="TINYINT" property="clusterState"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- <result column="start_time" jdbcType="DATE" property="startTime"/>
- <result column="end_time" jdbcType="DATE" property="endTime"/>
- <result column="alert_id" jdbcType="BIGINT" property="alertId"/>
- </resultMap>
-
<select id="findPage" resultType="org.apache.streampark.console.core.entity.FlinkCluster">
select * from t_flink_cluster
<where>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkEnvMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkEnvMapper.xml
index ee0b18fdb..7757311b8 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkEnvMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkEnvMapper.xml
@@ -17,18 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.FlinkEnvMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.FlinkEnv">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="flink_name" jdbcType="VARCHAR" property="flinkName"/>
- <result column="flink_home" jdbcType="VARCHAR" property="flinkHome"/>
- <result column="flink_conf" jdbcType="VARCHAR" property="flinkConf"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="version" jdbcType="VARCHAR" property="version"/>
- <result column="scala_version" jdbcType="VARCHAR" property="scalaVersion"/>
- <result column="is_default" jdbcType="BOOLEAN" property="isDefault"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
-
<select id="findPage" resultType="org.apache.streampark.console.core.entity.FlinkEnv">
select * from t_flink_env
<where>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkGateWayMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkSavepointMapper.xml
similarity index 61%
rename from streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkGateWayMapper.xml
rename to streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkSavepointMapper.xml
index 78a238092..c65de1763 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkGateWayMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkSavepointMapper.xml
@@ -16,16 +16,6 @@
~ limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.streampark.console.core.mapper.FlinkGateWayMapper">
-
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.FlinkGateWay">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="name" jdbcType="VARCHAR" property="name"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="gateway_type" jdbcType="BIGINT" property="gatewayType"/>
- <result column="address" jdbcType="VARCHAR" property="address"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
- </resultMap>
+<mapper namespace="org.apache.streampark.console.core.mapper.FlinkSavepointMapper">
</mapper>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkSqlMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkSqlMapper.xml
index 41d3b37bb..20af98ce5 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkSqlMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/FlinkSqlMapper.xml
@@ -17,16 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.FlinkSqlMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.FlinkSql">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="app_id" jdbcType="BIGINT" property="appId"/>
- <result column="sql" jdbcType="LONGVARCHAR" property="sql"/>
- <result column="candidate" jdbcType="INTEGER" property="candidate"/>
- <result column="team_resource" jdbcType="VARCHAR" property="teamResource"/>
- <result column="dependency" jdbcType="VARCHAR" property="dependency"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
-
<select id="getEffective" resultType="org.apache.streampark.console.core.entity.FlinkSql" parameterType="java.lang.Long">
select s.*
from t_flink_sql s
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/MessageMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/MessageMapper.xml
index 61799125c..d5cf7dba7 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/MessageMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/MessageMapper.xml
@@ -18,16 +18,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.MessageMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.Message">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="app_id" jdbcType="BIGINT" property="appId"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="title" jdbcType="VARCHAR" property="title"/>
- <result column="type" jdbcType="INTEGER" property="type"/>
- <result column="context" jdbcType="VARCHAR" property="context"/>
- <result column="is_read" jdbcType="BOOLEAN" property="isRead"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
+
</mapper>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ResourceMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ResourceMapper.xml
index 5322bb5e2..ba95f5e07 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ResourceMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ResourceMapper.xml
@@ -17,22 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.ResourceMapper">
- <resultMap id="ResourceMap" type="org.apache.streampark.console.core.entity.Resource">
- <result column="id" jdbcType="BIGINT" property="id"/>
- <result column="resource_name" jdbcType="VARCHAR" property="resourceName"/>
- <result column="connector_path" jdbcType="VARCHAR" property="connectorPath"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="resource_type" jdbcType="BIGINT" property="resourceType"/>
- <result column="resource" jdbcType="VARCHAR" property="resource"/>
- <result column="engine_type" jdbcType="BIGINT" property="engineType"/>
- <result column="creator_id" jdbcType="BIGINT" property="creatorId"/>
- <result column="connector_required_options" jdbcType="LONGVARCHAR" property="connectorRequiredOptions"/>
- <result column="connector_optional_options" jdbcType="LONGVARCHAR" property="connectorOptionalOptions"/>
- <result column="team_id" jdbcType="BIGINT" property="teamId"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
- </resultMap>
-
<select id="selectPage" resultType="org.apache.streampark.console.core.entity.Resource" parameterType="org.apache.streampark.console.core.entity.Resource">
select
v.*,
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SavepointMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SavepointMapper.xml
deleted file mode 100644
index 99ff6b427..000000000
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SavepointMapper.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.streampark.console.core.mapper.SavepointMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.Savepoint">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="app_id" jdbcType="VARCHAR" property="appId"/>
- <result column="latest" jdbcType="BOOLEAN" property="latest"/>
- <result column="type" jdbcType="INTEGER" property="type"/>
- <result column="path" jdbcType="VARCHAR" property="path"/>
- <result column="trigger_time" jdbcType="DATE" property="triggerTime"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
-</mapper>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SettingMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SettingMapper.xml
index f1269580e..4f3e3bda7 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SettingMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SettingMapper.xml
@@ -17,15 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.SettingMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.Setting">
- <result column="order_num" jdbcType="INTEGER" property="orderNum"/>
- <result column="setting_name" jdbcType="VARCHAR" property="settingName"/>
- <result column="setting_key" jdbcType="VARCHAR" property="settingKey"/>
- <result column="setting_value" jdbcType="VARCHAR" property="settingValue"/>
- <result column="type" jdbcType="INTEGER" property="type"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- </resultMap>
-
<sql id="baseSql">
order_num, setting_name, setting_key, setting_value, type
</sql>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationConfigMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationConfigMapper.xml
index 3cd6cb74e..f1a5edf6d 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationConfigMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationConfigMapper.xml
@@ -18,16 +18,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.SparkApplicationConfigMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.SparkApplicationConfig">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="app_id" jdbcType="BIGINT" property="appId"/>
- <result column="format" jdbcType="INTEGER" property="format"/>
- <result column="version" jdbcType="INTEGER" property="version"/>
- <result column="latest" jdbcType="BOOLEAN" property="latest"/>
- <result column="content" jdbcType="LONGVARCHAR" property="content"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
-
<select id="selectLatest" resultType="org.apache.streampark.console.core.entity.SparkApplicationConfig" parameterType="java.lang.Long">
select *
from t_spark_config
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationMapper.xml
index bceb50b40..037a2c186 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationMapper.xml
@@ -17,62 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.SparkApplicationMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.SparkApplication">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="team_id" jdbcType="BIGINT" property="teamId"/>
- <result column="job_type" jdbcType="INTEGER" property="jobType"/>
- <result column="app_type" jdbcType="INTEGER" property="appType"/>
- <result column="version_id" jdbcType="BIGINT" property="versionId"/>
- <result column="app_name" jdbcType="VARCHAR" property="appName"/>
- <result column="execution_mode" jdbcType="INTEGER" property="executionMode"/>
- <result column="resource_from" jdbcType="INTEGER" property="resourceFrom"/>
- <result column="project_id" jdbcType="BIGINT" property="projectId"/>
- <result column="module" jdbcType="VARCHAR" property="module"/>
- <result column="main_class" jdbcType="VARCHAR" property="mainClass"/>
- <result column="jar" jdbcType="VARCHAR" property="jar"/>
- <result column="jar_check_sum" jdbcType="VARCHAR" property="jarCheckSum"/>
- <result column="app_properties" jdbcType="LONGVARCHAR" property="appProperties"/>
- <result column="app_args" jdbcType="LONGVARCHAR" property="appArgs"/>
- <result column="app_id" jdbcType="VARCHAR" property="appId"/>
- <result column="yarn_queue" jdbcType="VARCHAR" property="yarnQueue"/>
- <result column="k8s_master_url" jdbcType="VARCHAR" property="k8sMasterUrl"/>
- <result column="k8s_container_image" jdbcType="VARCHAR" property="k8sContainerImage"/>
- <result column="k8s_image_pull_policy" jdbcType="TINYINT" property="k8sImagePullPolicy"/>
- <result column="k8s_service_account" jdbcType="VARCHAR" property="k8sServiceAccount"/>
- <result column="k8s_namespace" jdbcType="VARCHAR" property="k8sNamespace"/>
- <result column="hadoop_user" jdbcType="VARCHAR" property="hadoopUser"/>
- <result column="restart_size" jdbcType="INTEGER" property="restartSize"/>
- <result column="restart_count" jdbcType="INTEGER" property="restartCount"/>
- <result column="state" jdbcType="INTEGER" property="state"/>
- <result column="options" jdbcType="LONGVARCHAR" property="options"/>
- <result column="option_state" jdbcType="INTEGER" property="optionState"/>
- <result column="option_time" jdbcType="DATE" property="optionTime"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="tracking" jdbcType="INTEGER" property="tracking"/>
- <result column="release" jdbcType="INTEGER" property="release"/>
- <result column="build" jdbcType="BOOLEAN" property="build"/>
- <result column="alert_id" jdbcType="BIGINT" property="alertId"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- <result column="modify_time" jdbcType="DATE" property="modifyTime"/>
- <result column="start_time" jdbcType="DATE" property="startTime"/>
- <result column="end_time" jdbcType="DATE" property="endTime"/>
- <result column="duration" jdbcType="BIGINT" property="duration"/>
- <result column="tags" jdbcType="VARCHAR" property="tags"/>
- <result column="driver_cores" jdbcType="VARCHAR" property="driverCores"/>
- <result column="driver_memory" jdbcType="VARCHAR" property="driverMemory"/>
- <result column="executor_cores" jdbcType="VARCHAR" property="executorCores"/>
- <result column="executor_memory" jdbcType="VARCHAR" property="executorMemory"/>
- <result column="executor_max_nums" jdbcType="VARCHAR" property="executorMaxNums"/>
- <result column="num_tasks" jdbcType="BIGINT" property="numTasks"/>
- <result column="num_completed_tasks" jdbcType="BIGINT" property="numCompletedTasks"/>
- <result column="num_stages" jdbcType="BIGINT" property="numStages"/>
- <result column="num_completed_stages" jdbcType="BIGINT" property="numCompletedStages"/>
- <result column="used_memory" jdbcType="BIGINT" property="usedMemory"/>
- <result column="used_v_cores" jdbcType="BIGINT" property="usedVCores"/>
-
- </resultMap>
-
<update id="resetOptionState">
update t_spark_app
set option_state = 0
@@ -103,8 +47,8 @@
<if test="app.jobType != null and app.jobType != ''">
and t.job_type = #{app.jobType}
</if>
- <if test="app.executionMode != null and app.executionMode != ''">
- and t.execution_mode = #{app.executionMode}
+ <if test="app.deployMode != null and app.deployMode != ''">
+ and t.deploy_mode = #{app.deployMode}
</if>
<if test="app.appName != null and app.appName != ''">
and t.app_name like concat('%', '${app.appName}', '%')
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkEffectiveMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkEffectiveMapper.xml
index 88f4f1d5b..a351664e2 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkEffectiveMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkEffectiveMapper.xml
@@ -17,11 +17,4 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.SparkEffectiveMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.SparkEffective">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="app_id" jdbcType="BIGINT" property="appId"/>
- <result column="target_type" jdbcType="BIGINT" property="targetType"/>
- <result column="target_id" jdbcType="BIGINT" property="targetId"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
</mapper>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkEnvMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkEnvMapper.xml
index 6fce103e2..31c8463a6 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkEnvMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkEnvMapper.xml
@@ -17,18 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.SparkEnvMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.SparkEnv">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="spark_name" jdbcType="VARCHAR" property="sparkName"/>
- <result column="spark_home" jdbcType="VARCHAR" property="sparkHome"/>
- <result column="spark_conf" jdbcType="VARCHAR" property="sparkConf"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="version" jdbcType="VARCHAR" property="version"/>
- <result column="scala_version" jdbcType="VARCHAR" property="scalaVersion"/>
- <result column="is_default" jdbcType="BOOLEAN" property="isDefault"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
-
<select id="selectByAppId" resultType="org.apache.streampark.console.core.entity.SparkEnv" parameterType="java.lang.Long">
select v.*
from t_spark_env v
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkSqlMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkSqlMapper.xml
index 87f7a9010..ff4cd38bb 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkSqlMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkSqlMapper.xml
@@ -17,16 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.SparkSqlMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.SparkSql">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="app_id" jdbcType="BIGINT" property="appId"/>
- <result column="sql" jdbcType="LONGVARCHAR" property="sql"/>
- <result column="candidate" jdbcType="INTEGER" property="candidate"/>
- <result column="team_resource" jdbcType="VARCHAR" property="teamResource"/>
- <result column="dependency" jdbcType="VARCHAR" property="dependency"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- </resultMap>
-
<select id="getEffective" resultType="org.apache.streampark.console.core.entity.SparkSql" parameterType="java.lang.Long">
select s.*
from t_spark_sql s
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/VariableMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/VariableMapper.xml
index 3b3c1e15a..07cd64d90 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/VariableMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/VariableMapper.xml
@@ -17,18 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.VariableMapper">
- <resultMap id="VariableMap" type="org.apache.streampark.console.core.entity.Variable">
- <result column="id" jdbcType="BIGINT" property="id"/>
- <result column="variable_code" jdbcType="VARCHAR" property="variableCode"/>
- <result column="variable_value" jdbcType="VARCHAR" property="variableValue"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="creator_id" jdbcType="BIGINT" property="creatorId"/>
- <result column="desensitization" jdbcType="BOOLEAN" property="desensitization"/>
- <result column="team_id" jdbcType="BIGINT" property="teamId"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
- </resultMap>
-
<select id="selectPage" resultType="org.apache.streampark.console.core.entity.Variable" parameterType="org.apache.streampark.console.core.entity.Variable">
select
v.*,
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/YarnQueueMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/YarnQueueMapper.xml
index 93e2dff1a..1c9754144 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/YarnQueueMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/YarnQueueMapper.xml
@@ -17,15 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.core.mapper.YarnQueueMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.core.entity.YarnQueue">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="team_id" jdbcType="BIGINT" property="teamId"/>
- <result column="queue_label" jdbcType="VARCHAR" property="queueLabel"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="create_time" jdbcType="DATE" property="createTime"/>
- <result column="modify_time" jdbcType="DATE" property="modifyTime"/>
- </resultMap>
-
<select id="selectPage" resultType="org.apache.streampark.console.core.entity.YarnQueue">
select * from t_yarn_queue
<where>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/system/MemberMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/system/MemberMapper.xml
index df0f63f52..dc2c633bc 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/system/MemberMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/system/MemberMapper.xml
@@ -18,15 +18,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.system.mapper.MemberMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.system.entity.Member">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="team_id" jdbcType="BIGINT" property="teamId"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="role_id" jdbcType="BIGINT" property="roleId"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
- </resultMap>
-
<delete id="deleteByUserId">
delete
from t_member
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml
index f38c1ead9..6868610a0 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml
@@ -17,14 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.system.mapper.RoleMapper">
- <resultMap id="roleMap" type="org.apache.streampark.console.system.entity.Role">
- <result column="role_id" jdbcType="BIGINT" property="roleId"/>
- <result column="role_name" jdbcType="VARCHAR" property="roleName"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- </resultMap>
-
<select id="selectPage" resultType="org.apache.streampark.console.system.entity.Role" parameterType="org.apache.streampark.console.system.entity.Role">
select * from t_role
<where>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/system/TeamMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/system/TeamMapper.xml
index f06e222f4..0188161ea 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/system/TeamMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/system/TeamMapper.xml
@@ -17,14 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.system.mapper.TeamMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.system.entity.Team">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="team_name" jdbcType="VARCHAR" property="teamName"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
- </resultMap>
-
<select id="selectPage" resultType="org.apache.streampark.console.system.entity.Team" parameterType="org.apache.streampark.console.system.entity.Team">
select * from t_team
<where>
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
index 317237d31..6f311094f 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
@@ -17,22 +17,6 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.streampark.console.system.mapper.UserMapper">
- <resultMap id="BaseResultMap" type="org.apache.streampark.console.system.entity.User">
- <id column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="username" jdbcType="VARCHAR" property="username"/>
- <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
- <result column="password" jdbcType="VARCHAR" property="password"/>
- <result column="email" jdbcType="VARCHAR" property="email"/>
- <result column="status" jdbcType="CHAR" property="status"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
- <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime"/>
- <result column="sex" jdbcType="CHAR" property="sex"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="last_team_id" jdbcType="BIGINT" property="lastTeamId"/>
- <result column="login_type" jdbcType="INTEGER" property="loginType"/>
- </resultMap>
-
<sql id="userColumn">
u.user_id,
u.username,
diff --git a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/SpringUnitTestBase.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/SpringUnitTestBase.java
index 326d74213..625afd6b6 100644
--- a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/SpringUnitTestBase.java
+++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/SpringUnitTestBase.java
@@ -19,8 +19,8 @@ package org.apache.streampark.console;
import org.apache.streampark.common.conf.CommonConfig;
import org.apache.streampark.common.conf.ConfigKeys;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.common.enums.FlinkDeployMode;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.YarnQueue;
@@ -106,18 +106,18 @@ public abstract class SpringUnitTestBase {
cluster.setClusterName(name);
cluster.setYarnQueue(yarnQueue);
cluster.setVersionId(versionId);
- cluster.setExecutionMode(FlinkExecutionMode.YARN_SESSION.getMode());
+ cluster.setDeployMode(FlinkDeployMode.YARN_SESSION.getMode());
return cluster;
}
- protected Application mockYarnModeJobApp(
- Long teamId, String name, String yarnQueue,
- FlinkExecutionMode executionModeEnum) {
- Application application = new Application();
+ protected FlinkApplication mockYarnModeJobApp(
+ Long teamId, String name, String yarnQueue,
+ FlinkDeployMode deployModeEnum) {
+ FlinkApplication application = new FlinkApplication();
application.setYarnQueue(yarnQueue);
application.setTeamId(teamId);
application.setJobName(name);
- application.setExecutionMode(executionModeEnum.getMode());
+ application.setDeployMode(deployModeEnum.getMode());
application.doSetHotParams();
return application;
}
diff --git a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationManageServiceTest.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationManageServiceTest.java
index f089d81b1..d199f4de9 100644
--- a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationManageServiceTest.java
+++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationManageServiceTest.java
@@ -17,13 +17,13 @@
package org.apache.streampark.console.core.service;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.console.SpringUnitTestBase;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.YarnQueue;
-import org.apache.streampark.console.core.service.application.ApplicationActionService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
-import org.apache.streampark.console.core.service.application.impl.ApplicationManageServiceImpl;
+import org.apache.streampark.console.core.service.application.FlinkApplicationActionService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
+import org.apache.streampark.console.core.service.application.impl.FlinkApplicationManageServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.junit.jupiter.api.AfterEach;
@@ -40,9 +40,9 @@ import static org.assertj.core.api.Assertions.assertThat;
class ApplicationManageServiceTest extends SpringUnitTestBase {
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
- private ApplicationActionService applicationActionService;
+ private FlinkApplicationActionService applicationActionService;
@Autowired
private YarnQueueService yarnQueueService;
@@ -55,7 +55,7 @@ class ApplicationManageServiceTest extends SpringUnitTestBase {
@Test
void testRevoke() {
Date now = new Date();
- Application app = new Application();
+ FlinkApplication app = new FlinkApplication();
app.setId(100001L);
app.setJobType(1);
app.setUserId(100000L);
@@ -70,7 +70,7 @@ class ApplicationManageServiceTest extends SpringUnitTestBase {
app.setArgs("--hostname hadoop001 --port 8111");
app.setOptions("{\"taskmanager.numberOfTaskSlots\":1,\"parallelism.default\":1}");
app.setResolveOrder(0);
- app.setExecutionMode(4);
+ app.setDeployMode(4);
app.setAppType(2);
app.setTracking(0);
app.setJar("SocketWindowWordCount.jar");
@@ -92,7 +92,7 @@ class ApplicationManageServiceTest extends SpringUnitTestBase {
@Test
@Disabled("We couldn't do integration test with external services or components.")
void testStart() throws Exception {
- Application application = new Application();
+ FlinkApplication application = new FlinkApplication();
application.setId(1304056220683497473L);
application.setRestart(false);
application.setRestoreOrTriggerSavepoint(false);
@@ -103,7 +103,8 @@ class ApplicationManageServiceTest extends SpringUnitTestBase {
@Test
void testCheckQueueValidationIfNeeded() {
- ApplicationManageServiceImpl applicationServiceImpl = (ApplicationManageServiceImpl) applicationManageService;
+ FlinkApplicationManageServiceImpl applicationServiceImpl =
+ (FlinkApplicationManageServiceImpl) applicationManageService;
// ------- Test it for the create operation. -------
final String queueLabel = "queue1@label1";
@@ -112,8 +113,8 @@ class ApplicationManageServiceTest extends SpringUnitTestBase {
// Test application with available queue
YarnQueue yarnQueue = mockYarnQueue(targetTeamId, queueLabel);
yarnQueueService.save(yarnQueue);
- Application application = mockYarnModeJobApp(targetTeamId, "app1", queueLabel,
- FlinkExecutionMode.YARN_APPLICATION);
+ FlinkApplication application = mockYarnModeJobApp(targetTeamId, "app1", queueLabel,
+ FlinkDeployMode.YARN_APPLICATION);
assertThat(applicationServiceImpl.validateQueueIfNeeded(application)).isTrue();
// Test application without available queue
@@ -128,8 +129,8 @@ class ApplicationManageServiceTest extends SpringUnitTestBase {
final Long teamId2 = 2L;
// Test update for both versions in yarn-app or per-job with same yarn queue
- Application app1 = mockYarnModeJobApp(teamId2, appName, queueLabel1, FlinkExecutionMode.YARN_APPLICATION);
- Application app2 = mockYarnModeJobApp(teamId2, appName, queueLabel1, FlinkExecutionMode.YARN_PER_JOB);
+ FlinkApplication app1 = mockYarnModeJobApp(teamId2, appName, queueLabel1, FlinkDeployMode.YARN_APPLICATION);
+ FlinkApplication app2 = mockYarnModeJobApp(teamId2, appName, queueLabel1, FlinkDeployMode.YARN_PER_JOB);
assertThat(applicationServiceImpl.validateQueueIfNeeded(app1, app2)).isTrue();
// Test available queue
@@ -141,7 +142,7 @@ class ApplicationManageServiceTest extends SpringUnitTestBase {
assertThat(applicationServiceImpl.validateQueueIfNeeded(app1, app2)).isTrue();
// Test non-existed queue
- app1.setExecutionMode(FlinkExecutionMode.KUBERNETES_NATIVE_APPLICATION.getMode());
+ app1.setDeployMode(FlinkDeployMode.KUBERNETES_NATIVE_APPLICATION.getMode());
app2.setYarnQueue(nonExistedQueue);
assertThat(applicationServiceImpl.validateQueueIfNeeded(app1, app2)).isFalse();
}
diff --git a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/DistributedTaskServiceTest.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/DistributedTaskServiceTest.java
index 27c00472f..58a5a15f9 100644
--- a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/DistributedTaskServiceTest.java
+++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/DistributedTaskServiceTest.java
@@ -18,8 +18,8 @@
package org.apache.streampark.console.core.service;
import org.apache.streampark.console.core.bean.FlinkTaskItem;
-import org.apache.streampark.console.core.entity.Application;
import org.apache.streampark.console.core.entity.DistributedTask;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.enums.DistributedTaskEnum;
import org.apache.streampark.console.core.service.impl.DistributedTaskServiceImpl;
@@ -58,13 +58,13 @@ class DistributedTaskServiceTest {
@Test
void testGetTaskAndApp() {
- Application application = new Application();
+ FlinkApplication application = new FlinkApplication();
application.setId(0L);
try {
DistributedTask DistributedTask =
distributionTaskService.getDistributedTaskByApp(application, false, DistributedTaskEnum.START);
FlinkTaskItem flinkTaskItem = distributionTaskService.getFlinkTaskItem(DistributedTask);
- Application newApplication = distributionTaskService.getAppByFlinkTaskItem(flinkTaskItem);
+ FlinkApplication newApplication = distributionTaskService.getAppByFlinkTaskItem(flinkTaskItem);
assert (application.equals(newApplication));
} catch (JacksonException e) {
log.error("testGetTaskAndApp failed:", e);
diff --git a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/FlinkClusterServiceTest.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/FlinkClusterServiceTest.java
index 6a86e9e6c..777bd9b80 100644
--- a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/FlinkClusterServiceTest.java
+++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/FlinkClusterServiceTest.java
@@ -17,7 +17,7 @@
package org.apache.streampark.console.core.service;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.console.SpringUnitTestBase;
import org.apache.streampark.console.core.entity.FlinkCluster;
import org.apache.streampark.console.core.entity.YarnQueue;
@@ -97,7 +97,7 @@ class FlinkClusterServiceTest extends SpringUnitTestBase {
assertThat(clusterServiceImpl.validateQueueIfNeeded(cluster1, cluster2)).isTrue();
// Test non-existed queue
- cluster1.setExecutionMode(FlinkExecutionMode.KUBERNETES_NATIVE_APPLICATION.getMode());
+ cluster1.setDeployMode(FlinkDeployMode.KUBERNETES_NATIVE_APPLICATION.getMode());
cluster2.setYarnQueue(nonExistedQueue);
assertThat(clusterServiceImpl.validateQueueIfNeeded(cluster1, cluster2)).isFalse();
}
diff --git a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/SavepointServiceTest.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/SavepointServiceTest.java
index 2a3bc205f..833faa4ab 100644
--- a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/SavepointServiceTest.java
+++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/SavepointServiceTest.java
@@ -18,18 +18,18 @@
package org.apache.streampark.console.core.service;
import org.apache.streampark.common.enums.ApplicationType;
-import org.apache.streampark.common.enums.FlinkDevelopmentMode;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
+import org.apache.streampark.common.enums.FlinkJobType;
import org.apache.streampark.common.util.DeflaterUtils;
import org.apache.streampark.console.SpringUnitTestBase;
-import org.apache.streampark.console.core.entity.Application;
-import org.apache.streampark.console.core.entity.ApplicationConfig;
import org.apache.streampark.console.core.entity.Effective;
+import org.apache.streampark.console.core.entity.FlinkApplication;
+import org.apache.streampark.console.core.entity.FlinkApplicationConfig;
import org.apache.streampark.console.core.entity.FlinkEnv;
import org.apache.streampark.console.core.enums.ConfigFileTypeEnum;
import org.apache.streampark.console.core.enums.EffectiveTypeEnum;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
-import org.apache.streampark.console.core.service.impl.SavepointServiceImpl;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
+import org.apache.streampark.console.core.service.impl.FlinkSavepointServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* Test class for the implementation {@link
- * SavepointServiceImpl} of {@link
+ * FlinkSavepointServiceImpl} of {@link
* SavepointService}.
*/
class SavepointServiceTest extends SpringUnitTestBase {
@@ -53,7 +53,7 @@ class SavepointServiceTest extends SpringUnitTestBase {
private SavepointService savepointService;
@Autowired
- private ApplicationConfigService configService;
+ private FlinkApplicationConfigService configService;
@Autowired
private EffectiveService effectiveService;
@@ -63,7 +63,7 @@ class SavepointServiceTest extends SpringUnitTestBase {
@Autowired
private FlinkClusterService flinkClusterService;
@Autowired
- ApplicationManageService applicationManageService;
+ FlinkApplicationManageService applicationManageService;
@AfterEach
void cleanTestRecordsInDatabase() {
@@ -83,7 +83,7 @@ class SavepointServiceTest extends SpringUnitTestBase {
void testGetSavepointFromDynamicProps() {
String propsWithEmptyTargetValue = "-Dstate.savepoints.dir=";
String props = "-Dstate.savepoints.dir=hdfs:///test";
- SavepointServiceImpl savepointServiceImpl = (SavepointServiceImpl) savepointService;
+ FlinkSavepointServiceImpl savepointServiceImpl = (FlinkSavepointServiceImpl) savepointService;
assertThat(savepointServiceImpl.getSavepointFromDynamicProps(null)).isNull();
assertThat(savepointServiceImpl.getSavepointFromDynamicProps(props)).isEqualTo("hdfs:///test");
@@ -93,8 +93,8 @@ class SavepointServiceTest extends SpringUnitTestBase {
@Test
void testGetSavepointFromAppCfgIfStreamParkOrSQLJob() {
- SavepointServiceImpl savepointServiceImpl = (SavepointServiceImpl) savepointService;
- Application app = new Application();
+ FlinkSavepointServiceImpl savepointServiceImpl = (FlinkSavepointServiceImpl) savepointService;
+ FlinkApplication app = new FlinkApplication();
Long appId = 1L;
Long appCfgId = 1L;
app.setId(appId);
@@ -103,18 +103,18 @@ class SavepointServiceTest extends SpringUnitTestBase {
app.setAppType(ApplicationType.APACHE_FLINK.getType());
assertThat(savepointServiceImpl.getSavepointFromConfig(app)).isNull();
app.setAppType(ApplicationType.STREAMPARK_FLINK.getType());
- app.setJobType(FlinkDevelopmentMode.CUSTOM_CODE.getMode());
+ app.setJobType(FlinkJobType.CUSTOM_CODE.getMode());
assertThat(savepointServiceImpl.getSavepointFromConfig(app)).isNull();
// Test for (StreamPark job Or FlinkSQL job) without application config.
app.setAppType(ApplicationType.STREAMPARK_FLINK.getType());
assertThat(savepointServiceImpl.getSavepointFromConfig(app)).isNull();
app.setAppType(ApplicationType.STREAMPARK_FLINK.getType());
- app.setJobType(FlinkDevelopmentMode.CUSTOM_CODE.getMode());
+ app.setJobType(FlinkJobType.CUSTOM_CODE.getMode());
assertThat(savepointServiceImpl.getSavepointFromConfig(app)).isNull();
// Test for (StreamPark job Or FlinkSQL job) with application config just disabled checkpoint.
- ApplicationConfig appCfg = new ApplicationConfig();
+ FlinkApplicationConfig appCfg = new FlinkApplicationConfig();
appCfg.setId(appCfgId);
appCfg.setAppId(appId);
appCfg.setContent("state.savepoints.dir=hdfs:///test");
@@ -147,15 +147,15 @@ class SavepointServiceTest extends SpringUnitTestBase {
@Test
void testGetSavepointFromDeployLayer() throws JsonProcessingException {
- SavepointServiceImpl savepointServiceImpl = (SavepointServiceImpl) savepointService;
+ FlinkSavepointServiceImpl savepointServiceImpl = (FlinkSavepointServiceImpl) savepointService;
Long appId = 1L;
Long idOfFlinkEnv = 1L;
Long teamId = 1L;
- Application application = new Application();
+ FlinkApplication application = new FlinkApplication();
application.setId(appId);
application.setTeamId(teamId);
application.setVersionId(idOfFlinkEnv);
- application.setExecutionMode(FlinkExecutionMode.YARN_APPLICATION.getMode());
+ application.setDeployMode(FlinkDeployMode.YARN_APPLICATION.getMode());
applicationManageService.save(application);
FlinkEnv flinkEnv = new FlinkEnv();
@@ -175,7 +175,7 @@ class SavepointServiceTest extends SpringUnitTestBase {
Long clusterId = 1L;
// Test for it without cluster.
- application.setExecutionMode(FlinkExecutionMode.REMOTE.getMode());
+ application.setDeployMode(FlinkDeployMode.REMOTE.getMode());
application.setFlinkClusterId(clusterId);
assertThatThrownBy(() -> savepointServiceImpl.getSavepointFromDeployLayer(application))
.isInstanceOf(NullPointerException.class);
diff --git a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/UserServiceTest.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/UserServiceTest.java
index 6e37c50bd..46cfac02e 100644
--- a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/UserServiceTest.java
+++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/UserServiceTest.java
@@ -19,13 +19,13 @@ package org.apache.streampark.console.core.service;
import org.apache.streampark.console.SpringUnitTestBase;
import org.apache.streampark.console.base.domain.RestResponse;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.entity.Resource;
import org.apache.streampark.console.core.enums.EngineTypeEnum;
import org.apache.streampark.console.core.enums.ResourceTypeEnum;
import org.apache.streampark.console.core.enums.UserTypeEnum;
-import org.apache.streampark.console.core.service.application.ApplicationInfoService;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationInfoService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.system.entity.User;
import org.apache.streampark.console.system.service.UserService;
@@ -44,9 +44,9 @@ class UserServiceTest extends SpringUnitTestBase {
@Autowired
private UserService userService;
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
- private ApplicationInfoService applicationInfoService;
+ private FlinkApplicationInfoService applicationInfoService;
@Autowired
private ResourceService resourceService;
@@ -106,7 +106,7 @@ class UserServiceTest extends SpringUnitTestBase {
resource.setCreatorId(user.getUserId());
resourceService.save(resource);
- Application app = new Application();
+ FlinkApplication app = new FlinkApplication();
app.setUserId(user.getUserId());
app.setTeamId(1L);
applicationManageService.save(app);
diff --git a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/YarnQueueServiceTest.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/YarnQueueServiceTest.java
index fb5655203..dbc5844b9 100644
--- a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/YarnQueueServiceTest.java
+++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/YarnQueueServiceTest.java
@@ -17,13 +17,13 @@
package org.apache.streampark.console.core.service;
-import org.apache.streampark.common.enums.FlinkExecutionMode;
+import org.apache.streampark.common.enums.FlinkDeployMode;
import org.apache.streampark.console.SpringUnitTestBase;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.core.bean.ResponseResult;
import org.apache.streampark.console.core.entity.YarnQueue;
-import org.apache.streampark.console.core.service.application.ApplicationManageService;
+import org.apache.streampark.console.core.service.application.FlinkApplicationManageService;
import org.apache.streampark.console.core.service.impl.YarnQueueServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -54,7 +54,7 @@ class YarnQueueServiceTest extends SpringUnitTestBase {
private FlinkClusterService flinkClusterService;
@Autowired
- private ApplicationManageService applicationManageService;
+ private FlinkApplicationManageService applicationManageService;
@Autowired
private YarnQueueService yarnQueueService;
@@ -264,27 +264,27 @@ class YarnQueueServiceTest extends SpringUnitTestBase {
yarnQueueServiceImpl.checkNotReferencedByApplications(targetTeamId, queueLabel, operation);
// Test for existed applications that don't belong to the same team, not in yarn mode.
- applicationManageService.save(mockYarnModeJobApp(2L, "app1", null, FlinkExecutionMode.REMOTE));
+ applicationManageService.save(mockYarnModeJobApp(2L, "app1", null, FlinkDeployMode.REMOTE));
yarnQueueServiceImpl.checkNotReferencedByApplications(targetTeamId, queueLabel, operation);
// Test for existed applications that don't belong to the same team, in yarn mode
applicationManageService.save(
- mockYarnModeJobApp(2L, "app2", null, FlinkExecutionMode.YARN_APPLICATION));
+ mockYarnModeJobApp(2L, "app2", null, FlinkDeployMode.YARN_APPLICATION));
yarnQueueServiceImpl.checkNotReferencedByApplications(targetTeamId, queueLabel, operation);
// Test for existed applications that belong to the same team, but not in yarn mode.
applicationManageService.save(
- mockYarnModeJobApp(targetTeamId, "app3", null, FlinkExecutionMode.REMOTE));
+ mockYarnModeJobApp(targetTeamId, "app3", null, FlinkDeployMode.REMOTE));
yarnQueueServiceImpl.checkNotReferencedByApplications(targetTeamId, queueLabel, operation);
// Test for existed applications that belong to the same team, but without yarn queue value.
applicationManageService.save(
- mockYarnModeJobApp(targetTeamId, "app4", null, FlinkExecutionMode.YARN_PER_JOB));
+ mockYarnModeJobApp(targetTeamId, "app4", null, FlinkDeployMode.YARN_PER_JOB));
yarnQueueServiceImpl.checkNotReferencedByApplications(targetTeamId, queueLabel, operation);
// Test for existed applications, some apps belong to the same team, but others don't belong to.
applicationManageService.save(
- mockYarnModeJobApp(targetTeamId, "app5", queueLabel, FlinkExecutionMode.YARN_PER_JOB));
+ mockYarnModeJobApp(targetTeamId, "app5", queueLabel, FlinkDeployMode.YARN_PER_JOB));
assertThatThrownBy(
() -> yarnQueueServiceImpl.checkNotReferencedByApplications(
targetTeamId, queueLabel, operation))
diff --git a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/alert/AlertServiceTest.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/alert/AlertServiceTest.java
index 220797845..7099b3bf4 100644
--- a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/alert/AlertServiceTest.java
+++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/alert/AlertServiceTest.java
@@ -26,7 +26,7 @@ import org.apache.streampark.console.core.bean.AlertLarkParams;
import org.apache.streampark.console.core.bean.AlertTemplate;
import org.apache.streampark.console.core.bean.AlertWeComParams;
import org.apache.streampark.console.core.bean.EmailConfig;
-import org.apache.streampark.console.core.entity.Application;
+import org.apache.streampark.console.core.entity.FlinkApplication;
import org.apache.streampark.console.core.enums.FlinkAppStateEnum;
import org.apache.streampark.console.core.service.alert.impl.DingTalkAlertNotifyServiceImpl;
import org.apache.streampark.console.core.service.alert.impl.LarkAlertNotifyServiceImpl;
@@ -157,7 +157,7 @@ class AlertServiceTest {
@Test
void testAlert() {
- Application application = new Application();
+ FlinkApplication application = new FlinkApplication();
application.setStartTime(new Date());
application.setJobName("Test My Job");
application.setClusterId("1234567890");
@@ -194,7 +194,7 @@ class AlertServiceTest {
}
}
- private AlertTemplate getAlertBaseInfo(Application application) {
+ private AlertTemplate getAlertBaseInfo(FlinkApplication application) {
long duration;
if (application.getEndTime() == null) {
duration = System.currentTimeMillis() - application.getStartTime().getTime();
diff --git a/streampark-console/streampark-console-webapp/src/api/flink/app.type.ts b/streampark-console/streampark-console-webapp/src/api/flink/app.type.ts
index b1c604990..df6d96132 100644
--- a/streampark-console/streampark-console-webapp/src/api/flink/app.type.ts
+++ b/streampark-console/streampark-console-webapp/src/api/flink/app.type.ts
@@ -68,7 +68,7 @@ export interface AppListRecord {
options: string;
hotParams?: string;
resolveOrder: number;
- executionMode: number;
+ deployMode: number;
dynamicProperties?: string;
appType: number;
tracking: number;
@@ -157,7 +157,7 @@ export interface CancelParam {
// create Params
export interface CreateParams {
jobType: number;
- executionMode: number;
+ deployMode: number;
versionId: string;
flinkSql: string;
appType: number;
diff --git a/streampark-console/streampark-console-webapp/src/api/flink/flinkCluster.type.ts b/streampark-console/streampark-console-webapp/src/api/flink/flinkCluster.type.ts
index 43876f0be..f4a04c2cc 100644
--- a/streampark-console/streampark-console-webapp/src/api/flink/flinkCluster.type.ts
+++ b/streampark-console/streampark-console-webapp/src/api/flink/flinkCluster.type.ts
@@ -19,7 +19,7 @@ export interface FlinkCluster {
address: string;
clusterId: string;
clusterName: string;
- executionMode: number;
+ deployMode: number;
versionId: string;
k8sNamespace: string;
serviceAccount?: any;
diff --git a/streampark-console/streampark-console-webapp/src/api/spark/app.type.ts b/streampark-console/streampark-console-webapp/src/api/spark/app.type.ts
index 71ca0ac47..574d0036a 100644
--- a/streampark-console/streampark-console-webapp/src/api/spark/app.type.ts
+++ b/streampark-console/streampark-console-webapp/src/api/spark/app.type.ts
@@ -43,7 +43,7 @@ export interface SparkApplication {
appType?: number;
versionId?: string;
appName?: string;
- executionMode?: number;
+ deployMode?: number;
resourceFrom?: number;
projectId?: number;
module?: string;
@@ -116,7 +116,7 @@ interface AppControl {
// create Params
export interface CreateParams {
jobType: number;
- executionMode: number;
+ deployMode: number;
versionId: string;
flinkSql: string;
appType: number;
diff --git a/streampark-console/streampark-console-webapp/src/design/swal2.less b/streampark-console/streampark-console-webapp/src/design/swal2.less
index fdc00ec4b..9129e8ca9 100644
--- a/streampark-console/streampark-console-webapp/src/design/swal2.less
+++ b/streampark-console/streampark-console-webapp/src/design/swal2.less
@@ -8,10 +8,17 @@
padding: 16px;
overflow: auto;
line-height: 1.45;
- border-radius: 6px;
+ border-radius: 2px;
}
}
+.swal2-container,
+.swal2-popup,
+.swal2-confirm,
+.swal2-styled {
+ border-radius: 1px !important;
+}
+
[data-theme="dark"] {
.swal2-popup.swal2-toast {
diff --git a/streampark-console/streampark-console-webapp/src/enums/flinkEnum.ts b/streampark-console/streampark-console-webapp/src/enums/flinkEnum.ts
index a25a89b30..7c078d5e5 100644
--- a/streampark-console/streampark-console-webapp/src/enums/flinkEnum.ts
+++ b/streampark-console/streampark-console-webapp/src/enums/flinkEnum.ts
@@ -10,8 +10,8 @@ export enum BuildStateEnum {
/** build failed */
FAILED = 2,
}
-/* ExecutionMode */
-export enum ExecModeEnum {
+/* deployMode */
+export enum DeployMode {
/** standalone */
STANDALONE = 1,
/** yarn per-job (deprecated, please use yarn-application mode) */
diff --git a/streampark-console/streampark-console-webapp/src/enums/sparkEnum.ts b/streampark-console/streampark-console-webapp/src/enums/sparkEnum.ts
index dda741ad7..0f90b14c7 100644
--- a/streampark-console/streampark-console-webapp/src/enums/sparkEnum.ts
+++ b/streampark-console/streampark-console-webapp/src/enums/sparkEnum.ts
@@ -28,8 +28,8 @@ export enum OptionStateEnum {
STOPPING = 3,
}
-/* ExecutionMode */
-export enum ExecModeEnum {
+/* DeployMode */
+export enum DeployMode {
/** remote (standalone) */
REMOTE = 1,
/** yarn per-job (deprecated, please use yarn-application mode) */
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/app.ts b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/app.ts
index 8b657e1fc..6d8929c17 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/app.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/app.ts
@@ -27,7 +27,7 @@ export default {
releaseBuild: 'Release Status',
jobType: 'Job Type',
appType: 'Application Type',
- executionMode: 'Deploy Mode',
+ deployMode: 'Deploy Mode',
historyVersion: 'History Version',
resource: 'Resource',
resourcePlaceHolder: 'Please choose resource',
@@ -256,8 +256,8 @@ export default {
addAppTips: {
jobTypePlaceholder: 'Please select job type',
jobTypeIsRequiredMessage: 'Job Type is required',
- executionModePlaceholder: 'Please select deploy mode',
- executionModeIsRequiredMessage: 'Deploy Mode is required',
+ deployModePlaceholder: 'Please select deploy mode',
+ deployModeIsRequiredMessage: 'Deploy Mode is required',
hadoopEnvInitMessage:
'Hadoop environment initialization failed, please check the environment settings',
resourceFromMessage: 'resource from is required',
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/en/setting/flinkCluster.ts b/streampark-console/streampark-console-webapp/src/locales/lang/en/setting/flinkCluster.ts
index c28bf96a2..ea1cc34e0 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/en/setting/flinkCluster.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/en/setting/flinkCluster.ts
@@ -27,7 +27,7 @@ export default {
address: 'Cluster URL',
runState: 'Run State',
internal: 'internal cluster',
- executionMode: 'Deploy Mode',
+ deployMode: 'Deploy Mode',
versionId: 'Flink Version',
addExisting: 'existing cluster',
addNew: 'new cluster',
@@ -50,7 +50,7 @@ export default {
placeholder: {
addType: 'Please select cluster Add Type',
clusterName: 'Please enter cluster name',
- executionMode: 'Please enter deploy mode',
+ deployMode: 'Please enter deploy mode',
versionId: 'Please select flink version',
addressRemoteMode: 'Please enter jobManager URL',
addressNoRemoteMode: 'Please enter cluster address, e.g: http://host:port',
@@ -67,7 +67,7 @@ export default {
},
required: {
address: 'Cluster address is required',
- executionMode: 'Deploy Mode is required',
+ deployMode: 'Deploy Mode is required',
clusterId: 'Yarn Session Cluster is required',
versionId: 'Flink Version is required',
flinkImage: 'Flink Base Docker Image is required',
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/en/spark/app.ts b/streampark-console/streampark-console-webapp/src/locales/lang/en/spark/app.ts
index 50046c029..9d614c399 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/en/spark/app.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/en/spark/app.ts
@@ -60,7 +60,7 @@ export default {
runStatus: 'Run Status',
releaseBuild: 'Release Status',
jobType: 'Job Type',
- executionMode: 'Deploy Mode',
+ deployMode: 'Deploy Mode',
historyVersion: 'History Version',
resource: 'Spark App',
resourcePlaceHolder: 'Select Resource',
@@ -233,8 +233,8 @@ export default {
addAppTips: {
jobTypePlaceholder: 'Please select job type',
jobTypeIsRequiredMessage: 'Job type is required',
- executionModePlaceholder: 'Please select deploy mode',
- executionModeIsRequiredMessage: 'Deploy mode is required',
+ deployModePlaceholder: 'Please select deploy mode',
+ deployModeIsRequiredMessage: 'Deploy mode is required',
hadoopEnvInitMessage: 'Hadoop environment check failed, please check configuration',
resourceFromMessage: 'Resource source is required',
mainClassPlaceholder: 'Please enter the main entry class',
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/app.ts b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/app.ts
index f8bd4d15b..11a8b417a 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/app.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/app.ts
@@ -26,7 +26,7 @@ export default {
runStatus: '运行状态',
releaseBuild: '发布状态',
jobType: '作业类型',
- executionMode: '部署模式',
+ deployMode: '部署模式',
historyVersion: '历史版本',
resource: '资源',
resourcePlaceHolder: '从选择资源',
@@ -251,8 +251,8 @@ export default {
addAppTips: {
jobTypePlaceholder: '请选择作业类型',
jobTypeIsRequiredMessage: '作业类型必填',
- executionModePlaceholder: '请选择部署模式',
- executionModeIsRequiredMessage: '部署模式必填',
+ deployModePlaceholder: '请选择部署模式',
+ deployModeIsRequiredMessage: '部署模式必填',
hadoopEnvInitMessage: 'hadoop环境检查失败, 请检查配置',
resourceFromMessage: '资源来源必填',
mainClassPlaceholder: '请输入程序入口类',
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/setting/flinkCluster.ts b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/setting/flinkCluster.ts
index 77bec2d26..74a8f5a5d 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/setting/flinkCluster.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/setting/flinkCluster.ts
@@ -26,7 +26,7 @@ export default {
clusterName: '集群名称',
address: '集群URL',
runState: '运行状态',
- executionMode: '部署模式',
+ deployMode: '部署模式',
versionId: 'Flink版本',
addType: '添加类型',
addExisting: '已有集群',
@@ -49,7 +49,7 @@ export default {
placeholder: {
addType: '请选择集群添加类型',
clusterName: '请输入集群名称',
- executionMode: '请选择部署模式',
+ deployMode: '请选择部署模式',
versionId: '请选择Flink版本',
addressRemoteMode: '请输入Flink 集群JobManager URL访问地址',
addressNoRemoteMode: '请输入集群地址,例如:http://host:port',
@@ -66,7 +66,7 @@ export default {
},
required: {
address: '必须填写集群地址',
- executionMode: '部署模式必填',
+ deployMode: '部署模式必填',
clusterId: 'Yarn Session Cluster 为必填项',
versionId: 'Flink 版本必选',
flinkImage: 'link基础docker镜像是必填的',
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/spark/app.ts b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/spark/app.ts
index ab1b1d554..7a7e406c4 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/spark/app.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/spark/app.ts
@@ -60,7 +60,7 @@ export default {
runStatus: '运行状态',
releaseBuild: '发布状态',
jobType: '作业类型',
- executionMode: '部署模式',
+ deployMode: '部署模式',
historyVersion: '历史版本',
resource: '资源',
resourcePlaceHolder: '从选择资源',
@@ -232,8 +232,8 @@ export default {
addAppTips: {
jobTypePlaceholder: '请选择作业类型',
jobTypeIsRequiredMessage: '作业类型必填',
- executionModePlaceholder: '请选择部署模式',
- executionModeIsRequiredMessage: '执行部署模式',
+ deployModePlaceholder: '请选择部署模式',
+ deployModeIsRequiredMessage: '执行部署模式',
hadoopEnvInitMessage: 'hadoop环境检查失败, 请检查配置',
resourceFromMessage: '资源来源必填',
mainClassPlaceholder: '请输入程序入口类',
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue b/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
index 016b60eb7..4684f7ca0 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
@@ -48,7 +48,7 @@
import {
AppTypeEnum,
ClusterStateEnum,
- ExecModeEnum,
+ DeployMode,
JobTypeEnum,
ResourceFromEnum,
} from '/@/enums/flinkEnum';
@@ -137,7 +137,7 @@
function handleCluster(values: Recordable) {
let flinkClusterId =
- values.executionMode == ExecModeEnum.YARN_SESSION
+ values.deployMode == DeployMode.YARN_SESSION
? values.yarnSessionClusterId
: values.flinkClusterId;
const cluster =
@@ -148,7 +148,7 @@
})[0] || null;
if (cluster) {
Object.assign(values, { flinkClusterId: cluster.id });
- if (values.executionMode == ExecModeEnum.KUBERNETES_SESSION) {
+ if (values.deployMode == DeployMode.KUBERNETES_SESSION) {
Object.assign(values, { clusterId: cluster.clusterId });
}
}
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/Detail.vue b/streampark-console/streampark-console-webapp/src/views/flink/app/Detail.vue
index 3e3ee51de..35dead5ab 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/Detail.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/Detail.vue
@@ -15,7 +15,7 @@
limitations under the License.
-->
<script setup lang="ts" name="ApplicationDetail">
- import { ExecModeEnum } from '/@/enums/flinkEnum';
+ import { DeployMode } from '/@/enums/flinkEnum';
import { useI18n } from '/@/hooks/web/useI18n';
import { fetchAppExternalLink } from '/@/api/setting/externalLink';
import { ExternalLink } from '/@/api/setting/types/externalLink.type';
@@ -137,11 +137,9 @@
// Get data for the first time
if (Object.keys(app).length == 0) {
if (
- [
- ExecModeEnum.YARN_PER_JOB,
- ExecModeEnum.YARN_SESSION,
- ExecModeEnum.YARN_APPLICATION,
- ].includes(res.executionMode)
+ [DeployMode.YARN_PER_JOB, DeployMode.YARN_SESSION, DeployMode.YARN_APPLICATION].includes(
+ res.deployMode,
+ )
) {
await handleYarn();
}
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/EditFlink.vue b/streampark-console/streampark-console-webapp/src/views/flink/app/EditFlink.vue
index 8bbf90134..24aaf5c38 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/EditFlink.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/EditFlink.vue
@@ -39,7 +39,7 @@
import ProgramArgs from './components/ProgramArgs.vue';
import VariableReview from './components/VariableReview.vue';
import { useDrawer } from '/@/components/Drawer';
- import { ExecModeEnum, ResourceFromEnum } from '/@/enums/flinkEnum';
+ import { DeployMode, ResourceFromEnum } from '/@/enums/flinkEnum';
const route = useRoute();
const { t } = useI18n();
@@ -74,7 +74,7 @@
});
... 7364 lines suppressed ...