You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by go...@apache.org on 2022/03/08 09:01:07 UTC
[incubator-inlong] branch master updated: [INLONG-3000][Manager] Add token field for cluster info (#3001)
This is an automated email from the ASF dual-hosted git repository.
gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new eae1790 [INLONG-3000][Manager] Add token field for cluster info (#3001)
eae1790 is described below
commit eae1790f2d1084997127711f826c9ac5cdba1e34
Author: healchow <he...@gmail.com>
AuthorDate: Tue Mar 8 17:01:02 2022 +0800
[INLONG-3000][Manager] Add token field for cluster info (#3001)
---
.../manager/common/pojo/cluster/ClusterInfo.java | 21 ++++++++++++---------
.../core/impl/ThirdPartyClusterServiceImpl.java | 7 +++----
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterInfo.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterInfo.java
index b95626d..98d205f 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterInfo.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterInfo.java
@@ -31,20 +31,20 @@ public class ClusterInfo {
@ApiModelProperty(value = "Incremental primary key")
private Integer id;
- @ApiModelProperty(value = "cluster name")
+ @ApiModelProperty(value = "Cluster name")
private String name;
- @ApiModelProperty(value = "Cluster type, including TUBE, ZK, etc.")
+ @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, etc.")
private String type;
- @ApiModelProperty(value = "Cluster IP address")
+ @ApiModelProperty(value = "Cluster IP")
private String ip;
- @ApiModelProperty(value = "Cluster port number")
+ @ApiModelProperty(value = "Cluster port")
private Integer port;
- @ApiModelProperty(value = "Name of in charges, separated by commas")
- private String inCharges;
+ @ApiModelProperty(value = "Cluster token")
+ private String token;
@ApiModelProperty(value = "Cluster URL address")
private String url;
@@ -52,13 +52,16 @@ public class ClusterInfo {
@ApiModelProperty(value = "Whether it is a backup cluster, 0: no, 1: yes")
private Integer isBackup;
- @ApiModelProperty(value = "Cluster status")
- private Integer status;
-
@ApiModelProperty(value = "MQ set name")
private String mqSetName;
@ApiModelProperty(value = "MQ config info")
private String extParams;
+ @ApiModelProperty(value = "Name of in charges, separated by commas")
+ private String inCharges;
+
+ @ApiModelProperty(value = "Cluster status")
+ private Integer status;
+
}
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ThirdPartyClusterServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ThirdPartyClusterServiceImpl.java
index c09114d..37fc782 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ThirdPartyClusterServiceImpl.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ThirdPartyClusterServiceImpl.java
@@ -19,8 +19,8 @@ package org.apache.inlong.manager.service.core.impl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
-import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
import org.apache.inlong.manager.common.enums.EntityStatus;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
import org.apache.inlong.manager.common.exceptions.BusinessException;
import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
@@ -40,7 +40,7 @@ import java.util.Date;
import java.util.List;
/**
- * Implementation of cluster information service layer interface
+ * Implementation of cluster service
*/
@Service
@Slf4j
@@ -86,8 +86,7 @@ public class ThirdPartyClusterServiceImpl implements ThirdPartyClusterService {
public Integer save(ClusterInfo clusterInfo, String operator) {
LOGGER.info("begin to insert a cluster info cluster={}", clusterInfo);
Preconditions.checkNotNull(clusterInfo, "cluster is empty");
- ThirdPartyClusterEntity entity =
- CommonBeanUtils.copyProperties(clusterInfo, ThirdPartyClusterEntity::new);
+ ThirdPartyClusterEntity entity = CommonBeanUtils.copyProperties(clusterInfo, ThirdPartyClusterEntity::new);
entity.setCreator(operator);
entity.setCreateTime(new Date());
thirdPartyClusterEntityMapper.insert(entity);