You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2023/04/18 09:35:00 UTC
[inlong] branch master updated: [INLONG-6668][Sort] Reusing existing constants (#7864)
This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 2173339b2 [INLONG-6668][Sort] Reusing existing constants (#7864)
2173339b2 is described below
commit 2173339b23c60aa8d683457f37d403c3a3f10be4
Author: Bibhu <pr...@gmail.com>
AuthorDate: Tue Apr 18 15:04:53 2023 +0530
[INLONG-6668][Sort] Reusing existing constants (#7864)
Co-authored-by: healchow <he...@gmail.com>
---
.../main/java/org/apache/inlong/common/constant/Constants.java | 1 +
.../org/apache/inlong/manager/plugin/flink/enums/Constants.java | 8 +++-----
.../org/apache/inlong/manager/plugin/util/FlinkConfiguration.java | 4 ++--
.../main/java/org/apache/inlong/sort/configuration/Constants.java | 4 +++-
.../base/src/main/java/org/apache/inlong/sort/base/Constants.java | 3 ++-
5 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/inlong-common/src/main/java/org/apache/inlong/common/constant/Constants.java b/inlong-common/src/main/java/org/apache/inlong/common/constant/Constants.java
index 983ac3988..3aaee8238 100644
--- a/inlong-common/src/main/java/org/apache/inlong/common/constant/Constants.java
+++ b/inlong-common/src/main/java/org/apache/inlong/common/constant/Constants.java
@@ -28,5 +28,6 @@ public class Constants {
// default kafka topic is {groupId}.{streamId}
public static final String DEFAULT_KAFKA_TOPIC_FORMAT = "%s.%s";
+ public static final String METRICS_AUDIT_PROXY_HOSTS_KEY = "metrics.audit.proxy.hosts";
}
diff --git a/inlong-manager/manager-plugins/src/main/java/org/apache/inlong/manager/plugin/flink/enums/Constants.java b/inlong-manager/manager-plugins/src/main/java/org/apache/inlong/manager/plugin/flink/enums/Constants.java
index a594fd6bc..873f20650 100644
--- a/inlong-manager/manager-plugins/src/main/java/org/apache/inlong/manager/plugin/flink/enums/Constants.java
+++ b/inlong-manager/manager-plugins/src/main/java/org/apache/inlong/manager/plugin/flink/enums/Constants.java
@@ -40,8 +40,6 @@ public class Constants {
public static final String DRAIN = "flink.drain";
- public static final String METRICS_AUDIT_PROXY_HOSTS = "metrics.audit.proxy.hosts";
-
// dataflow
public static final String SOURCE_INFO = "source_info";
@@ -79,9 +77,9 @@ public class Constants {
public static final String SEPARATOR = ":";
/**
- * Generate the Job name through {@link ProcessForm}: <br/>
- * When the ProcessForm is {@link GroupResourceProcessForm}, the format of the job name is 'InLong-Sort-{Group ID}',
- * otherwise take the {@link Constants#DEFAULT_SORT_JOB_NAME}: 'InLong-Sort-Job'.
+ * Generate the Job name through {@link ProcessForm}: <br/>
+ * When the ProcessForm is {@link GroupResourceProcessForm}, the format of the job name is 'InLong-Sort-{Group ID}',
+ * otherwise take the {@link Constants#DEFAULT_SORT_JOB_NAME}: 'InLong-Sort-Job'.
*/
public static Function<ProcessForm, String> SORT_JOB_NAME_GENERATOR =
(ProcessForm processForm) -> Optional.of(processForm)
diff --git a/inlong-manager/manager-plugins/src/main/java/org/apache/inlong/manager/plugin/util/FlinkConfiguration.java b/inlong-manager/manager-plugins/src/main/java/org/apache/inlong/manager/plugin/util/FlinkConfiguration.java
index c6022cb68..8b51b8c2b 100644
--- a/inlong-manager/manager-plugins/src/main/java/org/apache/inlong/manager/plugin/util/FlinkConfiguration.java
+++ b/inlong-manager/manager-plugins/src/main/java/org/apache/inlong/manager/plugin/util/FlinkConfiguration.java
@@ -29,7 +29,7 @@ import java.util.Properties;
import static org.apache.inlong.manager.plugin.flink.enums.Constants.ADDRESS;
import static org.apache.inlong.manager.plugin.flink.enums.Constants.JOB_MANAGER_PORT;
-import static org.apache.inlong.manager.plugin.flink.enums.Constants.METRICS_AUDIT_PROXY_HOSTS;
+import static org.apache.inlong.common.constant.Constants.METRICS_AUDIT_PROXY_HOSTS_KEY;
import static org.apache.inlong.manager.plugin.flink.enums.Constants.DRAIN;
import static org.apache.inlong.manager.plugin.flink.enums.Constants.PARALLELISM;
import static org.apache.inlong.manager.plugin.flink.enums.Constants.PORT;
@@ -102,7 +102,7 @@ public class FlinkConfiguration {
flinkConfig.setSavepointDirectory(properties.getProperty(SAVEPOINT_DIRECTORY));
flinkConfig.setJobManagerPort(Integer.valueOf(properties.getProperty(JOB_MANAGER_PORT)));
flinkConfig.setDrain(Boolean.parseBoolean(properties.getProperty(DRAIN)));
- flinkConfig.setAuditProxyHosts(properties.getProperty(METRICS_AUDIT_PROXY_HOSTS));
+ flinkConfig.setAuditProxyHosts(properties.getProperty(METRICS_AUDIT_PROXY_HOSTS_KEY));
return flinkConfig;
}
diff --git a/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/configuration/Constants.java b/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/configuration/Constants.java
index 49fa9ab37..d14127dde 100644
--- a/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/configuration/Constants.java
+++ b/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/configuration/Constants.java
@@ -18,6 +18,8 @@
package org.apache.inlong.sort.configuration;
import java.time.Duration;
+
+import static org.apache.inlong.common.constant.Constants.METRICS_AUDIT_PROXY_HOSTS_KEY;
import static org.apache.inlong.sort.configuration.ConfigOptions.key;
/**
@@ -299,7 +301,7 @@ public class Constants {
+ "default is 'groupId=xxx&streamId=xxx&nodeId=xxx'");
public static final ConfigOption<String> METRICS_AUDIT_PROXY_HOSTS =
- ConfigOptions.key("metrics.audit.proxy.hosts")
+ ConfigOptions.key(METRICS_AUDIT_PROXY_HOSTS_KEY)
.noDefaultValue()
.withDescription("Audit proxy host address for reporting audit metrics. \n"
+ "e.g. 127.0.0.1:10081,0.0.0.1:10081");
diff --git a/inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/Constants.java b/inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/Constants.java
index 702329e6c..cd7acc921 100644
--- a/inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/Constants.java
+++ b/inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/Constants.java
@@ -20,6 +20,7 @@ package org.apache.inlong.sort.base;
import org.apache.flink.configuration.ConfigOption;
import org.apache.flink.configuration.ConfigOptions;
import org.apache.inlong.sort.base.sink.SchemaUpdateExceptionPolicy;
+import static org.apache.inlong.common.constant.Constants.METRICS_AUDIT_PROXY_HOSTS_KEY;
/**
* connector base option constant
@@ -144,7 +145,7 @@ public final class Constants {
+ "default is 'groupId=xxx&streamId=xxx&nodeId=xxx'");
public static final ConfigOption<String> INLONG_AUDIT =
- ConfigOptions.key("metrics.audit.proxy.hosts")
+ ConfigOptions.key(METRICS_AUDIT_PROXY_HOSTS_KEY)
.stringType()
.noDefaultValue()
.withDescription("Audit proxy host address for reporting audit metrics. \n"