From 5cfe7423761eb635d46546ae4638b784b43425f3 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Sun, 18 Feb 2024 19:34:51 +0800 Subject: [PATCH] [Feature-3160] Delete separator configuration item (#3161) Co-authored-by: Zzm0809 --- .../src/test/java/org/dinky/utils/SqlUtilTest.java | 8 +------- .../src/main/java/org/dinky/data/enums/Status.java | 2 -- .../java/org/dinky/data/model/SystemConfiguration.java | 5 +---- .../src/main/resources/i18n/messages_en_US.properties | 2 -- .../src/main/resources/i18n/messages_zh_CN.properties | 2 -- 5 files changed, 2 insertions(+), 17 deletions(-) diff --git a/dinky-admin/src/test/java/org/dinky/utils/SqlUtilTest.java b/dinky-admin/src/test/java/org/dinky/utils/SqlUtilTest.java index f99f80c374..9fef46427f 100644 --- a/dinky-admin/src/test/java/org/dinky/utils/SqlUtilTest.java +++ b/dinky-admin/src/test/java/org/dinky/utils/SqlUtilTest.java @@ -19,10 +19,6 @@ package org.dinky.utils; -import static org.dinky.data.enums.Status.SYS_FLINK_SETTINGS_SQLSEPARATOR; - -import org.dinky.data.model.SystemConfiguration; - import org.assertj.core.api.Assertions; import org.junit.Ignore; import org.junit.Test; @@ -62,9 +58,7 @@ public void getStatements() { String sql = "set 'state.savepoints.dir' = 'hdfs://namenode:9000/tmp/checkpoint'; --ddd\n" + "set 'state.checkpoints.dir' = 'hdfs://namenode:9000/tmp/checkpoint'; --dd \n" + "create table abc ;\n"; - SystemConfiguration.getInstances() - .setConfiguration(SYS_FLINK_SETTINGS_SQLSEPARATOR.getKey(), ";\\s*(?:\\n|--.*)"); - String[] statements = SqlUtil.getStatements(sql); + String[] statements = SqlUtil.getStatements(sql, ";\\s*(?:\\n|--.*)"); Assertions.assertThat(statements.length).isEqualTo(3); } } diff --git a/dinky-common/src/main/java/org/dinky/data/enums/Status.java b/dinky-common/src/main/java/org/dinky/data/enums/Status.java index 675eb32f8a..a7bb4e0940 100644 --- a/dinky-common/src/main/java/org/dinky/data/enums/Status.java +++ b/dinky-common/src/main/java/org/dinky/data/enums/Status.java @@ -324,8 +324,6 @@ public enum Status { */ SYS_FLINK_SETTINGS_USERESTAPI(100, "sys.flink.settings.useRestAPI"), SYS_FLINK_SETTINGS_USERESTAPI_NOTE(101, "sys.flink.settings.useRestAPI.note"), - SYS_FLINK_SETTINGS_SQLSEPARATOR(102, "sys.flink.settings.sqlSeparator"), - SYS_FLINK_SETTINGS_SQLSEPARATOR_NOTE(103, "sys.flink.settings.sqlSeparator.note"), SYS_FLINK_SETTINGS_JOBIDWAIT(104, "sys.flink.settings.jobIdWait"), SYS_FLINK_SETTINGS_JOBIDWAIT_NOTE(105, "sys.flink.settings.jobIdWait.note"), SYS_MAVEN_SETTINGS_SETTINGSFILEPATH(106, "sys.maven.settings.settingsFilePath"), diff --git a/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java b/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java index 3808a9b6a3..3b10ce8a93 100644 --- a/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java +++ b/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java @@ -66,10 +66,7 @@ public static Configuration.OptionBuilder key(Status status) { .booleanType() .defaultValue(true) .note(Status.SYS_FLINK_SETTINGS_USERESTAPI_NOTE); - private final Configuration sqlSeparator = key(Status.SYS_FLINK_SETTINGS_SQLSEPARATOR) - .stringType() - .defaultValue(";\\n") - .note(Status.SYS_FLINK_SETTINGS_SQLSEPARATOR_NOTE); + private final Configuration jobIdWait = key(Status.SYS_FLINK_SETTINGS_JOBIDWAIT) .intType() .defaultValue(30) diff --git a/dinky-common/src/main/resources/i18n/messages_en_US.properties b/dinky-common/src/main/resources/i18n/messages_en_US.properties index 6068cb6b62..f559f5b2bd 100644 --- a/dinky-common/src/main/resources/i18n/messages_en_US.properties +++ b/dinky-common/src/main/resources/i18n/messages_en_US.properties @@ -177,8 +177,6 @@ daemon.task.not.support=threaded task types are notsupported # system config sys.flink.settings.useRestAPI=Use Rest API sys.flink.settings.useRestAPI.note=Whether to use RestAPI when operating and maintaining Flink tasks -sys.flink.settings.sqlSeparator=SQL Separator -sys.flink.settings.sqlSeparator.note=please note: The default delimiter is ';', if your SQL contains ';', please modify this configuration to other characters, for example: ';\\n', please ignore the single quotes!!!! sys.flink.settings.jobIdWait=Job submission waiting time sys.flink.settings.jobIdWait.note=Maximum waiting time (seconds) for obtaining Job ID when submitting Application or PerJob tasks sys.maven.settings.settingsFilePath=Maven configuration file path diff --git a/dinky-common/src/main/resources/i18n/messages_zh_CN.properties b/dinky-common/src/main/resources/i18n/messages_zh_CN.properties index 8714e4fb48..e46f93065a 100644 --- a/dinky-common/src/main/resources/i18n/messages_zh_CN.properties +++ b/dinky-common/src/main/resources/i18n/messages_zh_CN.properties @@ -177,8 +177,6 @@ alert.rule.checkpointTimeout=checkpoint超时 # system config sys.flink.settings.useRestAPI=使用 Rest API sys.flink.settings.useRestAPI.note=在运维 Flink 任务时是否使用 RestAPI -sys.flink.settings.sqlSeparator=SQL 分隔符 -sys.flink.settings.sqlSeparator.note=请注意: 默认分隔符为 ';' ,如果您的 SQL 中包含 ';' ,请修改此项配置为其他字符,例如: ';\\n', 请忽略单引号!!!! sys.flink.settings.jobIdWait=Job 提交等待时间 sys.flink.settings.jobIdWait.note=提交 Application 或 PerJob 任务时获取 Job ID 的最大等待时间(秒) sys.maven.settings.settingsFilePath=Maven 配置文件路径