You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/11/01 11:11:59 UTC
[inlong] branch master updated: [INLONG-6352][Manager] Add a global config for whether to use ZooKeeper to manage the Sort task (#6354)
This is an automated email from the ASF dual-hosted git repository.
healchow 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 ad2ecb4fe [INLONG-6352][Manager] Add a global config for whether to use ZooKeeper to manage the Sort task (#6354)
ad2ecb4fe is described below
commit ad2ecb4fe86495cd6aea8f895fe2330537eed490
Author: fuweng11 <76...@users.noreply.github.com>
AuthorDate: Tue Nov 1 19:11:53 2022 +0800
[INLONG-6352][Manager] Add a global config for whether to use ZooKeeper to manage the Sort task (#6354)
---
.../inlong/manager/service/group/InlongGroupServiceImpl.java | 7 ++++++-
.../manager-web/src/main/resources/application-dev.properties | 3 +++
.../manager-web/src/main/resources/application-prod.properties | 3 +++
.../manager-web/src/main/resources/application-test.properties | 3 +++
4 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java
index f89fd0f70..6a5839065 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java
@@ -64,6 +64,7 @@ import org.apache.inlong.manager.service.stream.InlongStreamService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
@@ -91,6 +92,9 @@ public class InlongGroupServiceImpl implements InlongGroupService {
private static final Logger LOGGER = LoggerFactory.getLogger(InlongGroupServiceImpl.class);
+ @Value("${sort.enable.zookeeper:false}")
+ private boolean enableZookeeper;
+
@Autowired
private InlongGroupEntityMapper groupMapper;
@Autowired
@@ -154,7 +158,7 @@ public class InlongGroupServiceImpl implements InlongGroupService {
LOGGER.error("groupId {} has already exists", groupId);
throw new BusinessException(ErrorCodeEnum.GROUP_DUPLICATE);
}
-
+ request.setEnableZookeeper(enableZookeeper ? InlongConstants.ENABLE_ZK : InlongConstants.DISABLE_ZK);
InlongGroupOperator instance = groupOperatorFactory.getInstance(request.getMqType());
groupId = instance.saveOpt(request, operator);
@@ -246,6 +250,7 @@ public class InlongGroupServiceImpl implements InlongGroupService {
// check whether the current status can be modified
checkGroupCanUpdate(entity, request, operator);
+ request.setEnableZookeeper(enableZookeeper ? InlongConstants.ENABLE_ZK : InlongConstants.DISABLE_ZK);
InlongGroupOperator instance = groupOperatorFactory.getInstance(request.getMqType());
instance.updateOpt(request, operator);
diff --git a/inlong-manager/manager-web/src/main/resources/application-dev.properties b/inlong-manager/manager-web/src/main/resources/application-dev.properties
index 2a3f4e767..53dd907c1 100644
--- a/inlong-manager/manager-web/src/main/resources/application-dev.properties
+++ b/inlong-manager/manager-web/src/main/resources/application-dev.properties
@@ -82,3 +82,6 @@ data.cleansing.interval.seconds=1800
data.cleansing.before.days=10
# The maximum size of data to be deleted in batch, default is 100
data.cleansing.batchSize=100
+
+# Whether to use ZooKeeper to manage the Sort task config, default is false, which means not using ZooKeeper
+sort.enable.zookeeper=false
diff --git a/inlong-manager/manager-web/src/main/resources/application-prod.properties b/inlong-manager/manager-web/src/main/resources/application-prod.properties
index a0f785e40..b11bfdf1f 100644
--- a/inlong-manager/manager-web/src/main/resources/application-prod.properties
+++ b/inlong-manager/manager-web/src/main/resources/application-prod.properties
@@ -80,3 +80,6 @@ data.cleansing.interval.seconds=1800
data.cleansing.before.days=10
# The maximum size of data to be deleted in batch, default is 100
data.cleansing.batchSize=100
+
+# Whether to use ZooKeeper to manage the Sort task config, default is false, which means not using ZooKeeper
+sort.enable.zookeeper=false
diff --git a/inlong-manager/manager-web/src/main/resources/application-test.properties b/inlong-manager/manager-web/src/main/resources/application-test.properties
index 28cd6a856..203124fc2 100644
--- a/inlong-manager/manager-web/src/main/resources/application-test.properties
+++ b/inlong-manager/manager-web/src/main/resources/application-test.properties
@@ -81,3 +81,6 @@ data.cleansing.interval.seconds=1800
data.cleansing.before.days=10
# The maximum size of data to be deleted in batch, default is 100
data.cleansing.batchSize=100
+
+# Whether to use ZooKeeper to manage the Sort task config, default is false, which means not using ZooKeeper
+sort.enable.zookeeper=false