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 88f37ec00b [INLONG-8829][Manager] Support configuring whether to use
zookeeper by request (#8830)
88f37ec00b is described below
commit 88f37ec00b51c552070b4d7ad0a19e5dd7a3bea1
Author: fuweng11 <[email protected]>
AuthorDate: Tue Sep 5 10:30:49 2023 +0800
[INLONG-8829][Manager] Support configuring whether to use zookeeper by
request (#8830)
---
.../inlong/manager/pojo/group/InlongGroupRequest.java | 2 +-
.../manager/service/group/InlongGroupServiceImpl.java | 19 +++++++++++++++----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/group/InlongGroupRequest.java
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/group/InlongGroupRequest.java
index 74de04efa7..30893b7a09 100644
---
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/group/InlongGroupRequest.java
+++
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/group/InlongGroupRequest.java
@@ -78,7 +78,7 @@ public abstract class InlongGroupRequest extends
BaseInlongGroup {
@ApiModelProperty(value = "TubeMQ master URL")
private String tubeMaster;
- @ApiModelProperty(value = "Whether to enable zookeeper? 0: disable, 1:
enable")
+ @ApiModelProperty(value = "Whether to enable zookeeper? 0: disable, 1:
enable", notes = "In the case of standard mode, it is allowed to use zookeeper
to store metadata")
@Range(min = 0, max = 1, message = "default is 0, only supports [0:
disable, 1: enable]")
private Integer enableZookeeper;
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 5b5d01d88a..5be12a3a3a 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
@@ -155,7 +155,9 @@ public class InlongGroupServiceImpl implements
InlongGroupService {
throw new BusinessException(ErrorCodeEnum.GROUP_DUPLICATE);
}
- request.setEnableZookeeper(enableZookeeper ? InlongConstants.ENABLE_ZK
: InlongConstants.DISABLE_ZK);
+ if (request.getEnableZookeeper() == null) {
+ request.setEnableZookeeper(enableZookeeper ?
InlongConstants.ENABLE_ZK : InlongConstants.DISABLE_ZK);
+ }
InlongGroupOperator instance =
groupOperatorFactory.getInstance(request.getMqType());
groupId = instance.saveOpt(request, operator);
@@ -174,7 +176,10 @@ public class InlongGroupServiceImpl implements
InlongGroupService {
if (entity != null) {
throw new BusinessException(ErrorCodeEnum.GROUP_DUPLICATE);
}
- request.setEnableZookeeper(enableZookeeper ? InlongConstants.ENABLE_ZK
: InlongConstants.DISABLE_ZK);
+ if (request.getEnableZookeeper() == null) {
+ request.setEnableZookeeper(enableZookeeper ?
InlongConstants.ENABLE_ZK : InlongConstants.DISABLE_ZK);
+ }
+
InlongGroupOperator instance =
groupOperatorFactory.getInstance(request.getMqType());
groupId = instance.saveOpt(request, opInfo.getName());
// save ext info
@@ -391,7 +396,10 @@ public class InlongGroupServiceImpl implements
InlongGroupService {
// check whether the current status can be modified
doUpdateCheck(entity, request, operator);
- request.setEnableZookeeper(enableZookeeper ? InlongConstants.ENABLE_ZK
: InlongConstants.DISABLE_ZK);
+ if (request.getEnableZookeeper() == null) {
+ request.setEnableZookeeper(enableZookeeper ?
InlongConstants.ENABLE_ZK : InlongConstants.DISABLE_ZK);
+ }
+
InlongGroupOperator instance =
groupOperatorFactory.getInstance(request.getMqType());
instance.updateOpt(request, operator);
@@ -423,7 +431,10 @@ public class InlongGroupServiceImpl implements
InlongGroupService {
String.format("Current status=%s is not allowed to update
MQ type", curStatus));
}
// update record
- request.setEnableZookeeper(enableZookeeper ? InlongConstants.ENABLE_ZK
: InlongConstants.DISABLE_ZK);
+ if (request.getEnableZookeeper() == null) {
+ request.setEnableZookeeper(enableZookeeper ?
InlongConstants.ENABLE_ZK : InlongConstants.DISABLE_ZK);
+ }
+
InlongGroupOperator instance =
groupOperatorFactory.getInstance(request.getMqType());
instance.updateOpt(request, opInfo.getName());
// save ext info