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/07/02 03:36:31 UTC
[inlong] branch master updated: [INLONG-4818][Manager] Add APIs for bind and unbind cluster tag for inlong cluster (#4836)
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 ea79a1e2c [INLONG-4818][Manager] Add APIs for bind and unbind cluster tag for inlong cluster (#4836)
ea79a1e2c is described below
commit ea79a1e2cb1a613f065208740ed32dd6904a7726
Author: healchow <he...@gmail.com>
AuthorDate: Sat Jul 2 11:36:26 2022 +0800
[INLONG-4818][Manager] Add APIs for bind and unbind cluster tag for inlong cluster (#4836)
---
.../manager/client/api/LowLevelInlongClient.java | 4 +-
.../client/api/impl/LowLevelInlongClientImpl.java | 4 +-
.../client/api/inner/InnerInlongManagerClient.java | 4 +-
.../client/api/service/InlongClusterApi.java | 4 +-
.../api/inner/InnerInlongManagerClientTest.java | 4 +-
.../inlong/manager/common/enums/ClusterType.java | 8 +-
...{ClusterTagRequest.java => BindTagRequest.java} | 20 +++--
.../{InlongClusterInfo.java => ClusterInfo.java} | 6 +-
...terPageRequest.java => ClusterPageRequest.java} | 5 +-
...longClusterRequest.java => ClusterRequest.java} | 2 +-
.../common/pojo/cluster/ClusterTagRequest.java | 2 +-
.../cluster/dataproxy/DataProxyClusterInfo.java | 8 +-
.../cluster/dataproxy/DataProxyClusterRequest.java | 8 +-
.../pojo/cluster/pulsar/PulsarClusterInfo.java | 8 +-
.../pojo/cluster/pulsar/PulsarClusterRequest.java | 8 +-
.../common/pojo/cluster/tube/TubeClusterInfo.java | 8 +-
.../pojo/cluster/tube/TubeClusterRequest.java | 8 +-
.../dao/mapper/InlongClusterEntityMapper.java | 4 +-
.../dao/mapper/InlongClusterNodeEntityMapper.java | 4 +-
.../mappers/InlongClusterEntityMapper.xml | 4 +-
.../mappers/InlongClusterNodeEntityMapper.xml | 11 ++-
.../service/cluster/AbstractClusterOperator.java | 8 +-
.../service/cluster/DataProxyClusterOperator.java | 10 +--
.../service/cluster/InlongClusterOperator.java | 10 +--
.../service/cluster/InlongClusterService.java | 30 ++++---
.../service/cluster/InlongClusterServiceImpl.java | 92 ++++++++++++++++------
.../service/cluster/PulsarClusterOperator.java | 10 +--
.../service/cluster/TubeClusterOperator.java | 10 +--
.../service/core/impl/ConsumptionServiceImpl.java | 2 +-
.../service/mq/CreatePulsarGroupTaskListener.java | 4 +-
.../mq/CreatePulsarResourceTaskListener.java | 6 +-
.../mq/CreatePulsarSubscriptionTaskListener.java | 4 +-
.../service/mq/CreatePulsarTopicTaskListener.java | 4 +-
.../service/mq/CreateTubeGroupTaskListener.java | 2 +-
.../service/mq/CreateTubeTopicTaskListener.java | 4 +-
.../mq/DeletePulsarResourceTaskListener.java | 6 +-
.../service/mq/DeletePulsarTopicTaskListener.java | 4 +-
.../service/sort/CreateSortConfigListenerV2.java | 6 +-
.../sort/CreateStreamSortConfigListener.java | 6 +-
.../ConsumptionCompleteProcessListener.java | 6 +-
.../service/cluster/InlongClusterServiceTest.java | 28 +++----
.../web/controller/InlongClusterController.java | 25 ++++--
.../controller/openapi/DataProxyController.java | 4 +-
.../controller/openapi/OpenClusterController.java | 35 +-------
44 files changed, 243 insertions(+), 207 deletions(-)
diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/LowLevelInlongClient.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/LowLevelInlongClient.java
index d38d0aa3e..4ab73e18c 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/LowLevelInlongClient.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/LowLevelInlongClient.java
@@ -19,7 +19,7 @@ package org.apache.inlong.manager.client.api;
import com.github.pagehelper.PageInfo;
import org.apache.inlong.manager.client.api.impl.LowLevelInlongClientImpl;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.group.InlongGroupListResponse;
import org.apache.inlong.manager.common.pojo.group.InlongGroupPageRequest;
@@ -47,7 +47,7 @@ public interface LowLevelInlongClient {
* @return cluster index
* @throws Exception
*/
- Integer saveCluster(InlongClusterRequest request) throws Exception;
+ Integer saveCluster(ClusterRequest request) throws Exception;
/**
* List group
diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/LowLevelInlongClientImpl.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/LowLevelInlongClientImpl.java
index c45de7819..0873702be 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/LowLevelInlongClientImpl.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/LowLevelInlongClientImpl.java
@@ -25,7 +25,7 @@ import org.apache.commons.collections.MapUtils;
import org.apache.inlong.manager.client.api.ClientConfiguration;
import org.apache.inlong.manager.client.api.LowLevelInlongClient;
import org.apache.inlong.manager.client.api.inner.InnerInlongManagerClient;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.group.InlongGroupListResponse;
import org.apache.inlong.manager.common.pojo.group.InlongGroupPageRequest;
import org.apache.inlong.manager.common.util.HttpUtils;
@@ -71,7 +71,7 @@ public class LowLevelInlongClientImpl implements LowLevelInlongClient {
}
@Override
- public Integer saveCluster(InlongClusterRequest request) throws Exception {
+ public Integer saveCluster(ClusterRequest request) throws Exception {
InnerInlongManagerClient managerClient = new InnerInlongManagerClient(this.configuration);
return managerClient.saveCluster(request);
}
diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/InnerInlongManagerClient.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/InnerInlongManagerClient.java
index d3936b2aa..3b110a64c 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/InnerInlongManagerClient.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/InnerInlongManagerClient.java
@@ -41,7 +41,7 @@ import org.apache.inlong.manager.client.api.service.WorkflowApi;
import org.apache.inlong.manager.common.auth.Authentication;
import org.apache.inlong.manager.common.auth.DefaultAuthentication;
import org.apache.inlong.manager.common.beans.Response;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupListResponse;
import org.apache.inlong.manager.common.pojo.group.InlongGroupPageRequest;
@@ -132,7 +132,7 @@ public class InnerInlongManagerClient {
* @param request cluster create request
* @return clusterIndex
*/
- public Integer saveCluster(InlongClusterRequest request) {
+ public Integer saveCluster(ClusterRequest request) {
AssertUtils.notEmpty(request.getName(), "cluster name should not be empty");
AssertUtils.notEmpty(request.getType(), "cluster type should not be empty");
AssertUtils.notEmpty(request.getClusterTags(), "cluster tags should not be empty");
diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/service/InlongClusterApi.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/service/InlongClusterApi.java
index d0b68e086..853585929 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/service/InlongClusterApi.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/service/InlongClusterApi.java
@@ -18,7 +18,7 @@
package org.apache.inlong.manager.client.api.service;
import org.apache.inlong.manager.common.beans.Response;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
@@ -26,6 +26,6 @@ import retrofit2.http.POST;
public interface InlongClusterApi {
@POST("cluster/save")
- Call<Response<Integer>> save(@Body InlongClusterRequest request);
+ Call<Response<Integer>> save(@Body ClusterRequest request);
}
diff --git a/inlong-manager/manager-client/src/test/java/org/apache/inlong/manager/client/api/inner/InnerInlongManagerClientTest.java b/inlong-manager/manager-client/src/test/java/org/apache/inlong/manager/client/api/inner/InnerInlongManagerClientTest.java
index 89b04ca41..0abe199b4 100644
--- a/inlong-manager/manager-client/src/test/java/org/apache/inlong/manager/client/api/inner/InnerInlongManagerClientTest.java
+++ b/inlong-manager/manager-client/src/test/java/org/apache/inlong/manager/client/api/inner/InnerInlongManagerClientTest.java
@@ -28,7 +28,7 @@ import org.apache.inlong.manager.client.api.ClientConfiguration;
import org.apache.inlong.manager.client.api.impl.InlongClientImpl;
import org.apache.inlong.manager.common.auth.DefaultAuthentication;
import org.apache.inlong.manager.common.beans.Response;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.group.InlongGroupExtInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupListResponse;
@@ -677,7 +677,7 @@ class InnerInlongManagerClientTest {
)
)
);
- InlongClusterRequest request = new InlongClusterRequest();
+ ClusterRequest request = new ClusterRequest();
request.setName("pulsar");
request.setType("PULSAR");
request.setClusterTags("test_cluster");
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/ClusterType.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/ClusterType.java
index 47d6aaa56..5a744c1eb 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/ClusterType.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/ClusterType.java
@@ -18,12 +18,12 @@
package org.apache.inlong.manager.common.enums;
/**
- * Enum of cluster type.
+ * Constant of cluster type.
*/
public class ClusterType {
- public static final String CLS_TUBE = "TUBE";
- public static final String CLS_PULSAR = "PULSAR";
- public static final String CLS_DATA_PROXY = "DATA_PROXY";
+ public static final String TUBE = "TUBE";
+ public static final String PULSAR = "PULSAR";
+ public static final String DATA_PROXY = "DATA_PROXY";
}
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterTagRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/BindTagRequest.java
similarity index 71%
copy from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterTagRequest.java
copy to inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/BindTagRequest.java
index ef2ffd7d2..f7ef982b3 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterTagRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/BindTagRequest.java
@@ -22,25 +22,23 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
+import java.util.List;
/**
- * Inlong cluster tag request
+ * Inlong cluster bind or unbind tag request
*/
@Data
-@ApiModel("Cluster tag request")
-public class ClusterTagRequest {
-
- @ApiModelProperty(value = "Primary key")
- private Integer id;
+@ApiModel("Cluster bind and unbind tag request")
+public class BindTagRequest {
@NotNull
- @ApiModelProperty(value = "Cluster type")
+ @ApiModelProperty(value = "Cluster tag")
private String clusterTag;
- @ApiModelProperty(value = "Extended params")
- private String extParams;
+ @ApiModelProperty(value = "Cluster-ID list which needs to bind tag")
+ private List<Integer> bindClusters;
- @ApiModelProperty(value = "Name of in charges, separated by commas")
- private String inCharges;
+ @ApiModelProperty(value = "Cluster-ID list which needs to unbind tag")
+ private List<Integer> unbindClusters;
}
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterInfo.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterInfo.java
similarity index 94%
rename from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterInfo.java
rename to inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterInfo.java
index 690d51a75..8fc65460e 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterInfo.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterInfo.java
@@ -36,7 +36,7 @@ import java.util.Date;
@AllArgsConstructor
@ApiModel("Inlong cluster info")
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, visible = true, property = "type")
-public class InlongClusterInfo {
+public class ClusterInfo {
@ApiModelProperty(value = "Primary key")
private Integer id;
@@ -83,8 +83,8 @@ public class InlongClusterInfo {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
- public InlongClusterRequest genRequest() {
- return CommonBeanUtils.copyProperties(this, InlongClusterRequest::new);
+ public ClusterRequest genRequest() {
+ return CommonBeanUtils.copyProperties(this, ClusterRequest::new);
}
}
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterPageRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
similarity index 93%
rename from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterPageRequest.java
rename to inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
index b1ca0e398..9c4d80018 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterPageRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
@@ -37,7 +37,7 @@ import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("Inlong cluster paging query request")
-public class InlongClusterPageRequest extends PageRequest {
+public class ClusterPageRequest extends PageRequest {
@ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, DATA_PROXY, etc.")
private String type;
@@ -48,6 +48,9 @@ public class InlongClusterPageRequest extends PageRequest {
@ApiModelProperty(value = "Cluster name")
private String name;
+ @ApiModelProperty(value = "Parent cluster ID, used for cluster node")
+ private Integer parentId;
+
@ApiModelProperty(value = "Keywords, name, url, cluster tag, etc.")
private String keyword;
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterRequest.java
similarity index 98%
rename from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterRequest.java
rename to inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterRequest.java
index 9d699649c..4e1a3ec7a 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterRequest.java
@@ -36,7 +36,7 @@ import javax.validation.constraints.NotBlank;
@AllArgsConstructor
@ApiModel("Inlong cluster request")
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, visible = true, property = "type")
-public class InlongClusterRequest {
+public class ClusterRequest {
@ApiModelProperty(value = "Primary key")
private Integer id;
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterTagRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterTagRequest.java
index ef2ffd7d2..8add6855f 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterTagRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterTagRequest.java
@@ -34,7 +34,7 @@ public class ClusterTagRequest {
private Integer id;
@NotNull
- @ApiModelProperty(value = "Cluster type")
+ @ApiModelProperty(value = "Cluster tag")
private String clusterTag;
@ApiModelProperty(value = "Extended params")
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/dataproxy/DataProxyClusterInfo.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/dataproxy/DataProxyClusterInfo.java
index 6fef58641..d8e7ded2a 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/dataproxy/DataProxyClusterInfo.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/dataproxy/DataProxyClusterInfo.java
@@ -22,7 +22,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.inlong.manager.common.enums.ClusterType;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.util.CommonBeanUtils;
import org.apache.inlong.manager.common.util.JsonTypeDefine;
@@ -32,14 +32,14 @@ import org.apache.inlong.manager.common.util.JsonTypeDefine;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
-@JsonTypeDefine(value = ClusterType.CLS_DATA_PROXY)
+@JsonTypeDefine(value = ClusterType.DATA_PROXY)
@ApiModel("Inlong cluster info for DataProxy")
-public class DataProxyClusterInfo extends InlongClusterInfo {
+public class DataProxyClusterInfo extends ClusterInfo {
// no fields
public DataProxyClusterInfo() {
- this.setType(ClusterType.CLS_DATA_PROXY);
+ this.setType(ClusterType.DATA_PROXY);
}
@Override
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/dataproxy/DataProxyClusterRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/dataproxy/DataProxyClusterRequest.java
index 4536b96c7..b98935bf7 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/dataproxy/DataProxyClusterRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/dataproxy/DataProxyClusterRequest.java
@@ -22,7 +22,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.inlong.manager.common.enums.ClusterType;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.util.JsonTypeDefine;
/**
@@ -31,14 +31,14 @@ import org.apache.inlong.manager.common.util.JsonTypeDefine;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
-@JsonTypeDefine(value = ClusterType.CLS_DATA_PROXY)
+@JsonTypeDefine(value = ClusterType.DATA_PROXY)
@ApiModel("Inlong cluster request for DataProxy")
-public class DataProxyClusterRequest extends InlongClusterRequest {
+public class DataProxyClusterRequest extends ClusterRequest {
// no field
public DataProxyClusterRequest() {
- this.setType(ClusterType.CLS_DATA_PROXY);
+ this.setType(ClusterType.DATA_PROXY);
}
}
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/pulsar/PulsarClusterInfo.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/pulsar/PulsarClusterInfo.java
index a05e4cc6f..a8b1b424f 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/pulsar/PulsarClusterInfo.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/pulsar/PulsarClusterInfo.java
@@ -23,7 +23,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.inlong.manager.common.enums.ClusterType;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.util.CommonBeanUtils;
import org.apache.inlong.manager.common.util.JsonTypeDefine;
@@ -33,9 +33,9 @@ import org.apache.inlong.manager.common.util.JsonTypeDefine;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
-@JsonTypeDefine(value = ClusterType.CLS_PULSAR)
+@JsonTypeDefine(value = ClusterType.PULSAR)
@ApiModel("Inlong cluster info for Pulsar")
-public class PulsarClusterInfo extends InlongClusterInfo {
+public class PulsarClusterInfo extends ClusterInfo {
@ApiModelProperty(value = "Pulsar admin URL, such as: http://127.0.0.1:8080")
private String adminUrl;
@@ -44,7 +44,7 @@ public class PulsarClusterInfo extends InlongClusterInfo {
private String tenant;
public PulsarClusterInfo() {
- this.setType(ClusterType.CLS_PULSAR);
+ this.setType(ClusterType.PULSAR);
}
@Override
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/pulsar/PulsarClusterRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/pulsar/PulsarClusterRequest.java
index 1964da6d9..612db1fb2 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/pulsar/PulsarClusterRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/pulsar/PulsarClusterRequest.java
@@ -23,7 +23,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.inlong.manager.common.enums.ClusterType;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.util.JsonTypeDefine;
/**
@@ -32,9 +32,9 @@ import org.apache.inlong.manager.common.util.JsonTypeDefine;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
-@JsonTypeDefine(value = ClusterType.CLS_PULSAR)
+@JsonTypeDefine(value = ClusterType.PULSAR)
@ApiModel("Inlong cluster request for Pulsar")
-public class PulsarClusterRequest extends InlongClusterRequest {
+public class PulsarClusterRequest extends ClusterRequest {
@ApiModelProperty(value = "Pulsar admin URL, such as: http://127.0.0.1:8080")
private String adminUrl;
@@ -43,7 +43,7 @@ public class PulsarClusterRequest extends InlongClusterRequest {
private String tenant;
public PulsarClusterRequest() {
- this.setType(ClusterType.CLS_PULSAR);
+ this.setType(ClusterType.PULSAR);
}
}
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/tube/TubeClusterInfo.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/tube/TubeClusterInfo.java
index 44fddc09a..968a0de54 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/tube/TubeClusterInfo.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/tube/TubeClusterInfo.java
@@ -22,7 +22,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.inlong.manager.common.enums.ClusterType;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.util.CommonBeanUtils;
import org.apache.inlong.manager.common.util.JsonTypeDefine;
@@ -32,14 +32,14 @@ import org.apache.inlong.manager.common.util.JsonTypeDefine;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
-@JsonTypeDefine(value = ClusterType.CLS_TUBE)
+@JsonTypeDefine(value = ClusterType.TUBE)
@ApiModel("Inlong cluster info for Tube")
-public class TubeClusterInfo extends InlongClusterInfo {
+public class TubeClusterInfo extends ClusterInfo {
// no fields
public TubeClusterInfo() {
- this.setType(ClusterType.CLS_TUBE);
+ this.setType(ClusterType.TUBE);
}
@Override
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/tube/TubeClusterRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/tube/TubeClusterRequest.java
index 574e708df..613905519 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/tube/TubeClusterRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/tube/TubeClusterRequest.java
@@ -22,7 +22,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.inlong.manager.common.enums.ClusterType;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.util.JsonTypeDefine;
/**
@@ -31,14 +31,14 @@ import org.apache.inlong.manager.common.util.JsonTypeDefine;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
-@JsonTypeDefine(value = ClusterType.CLS_TUBE)
+@JsonTypeDefine(value = ClusterType.TUBE)
@ApiModel("Inlong cluster request for Tube")
-public class TubeClusterRequest extends InlongClusterRequest {
+public class TubeClusterRequest extends ClusterRequest {
// no field
public TubeClusterRequest() {
- this.setType(ClusterType.CLS_TUBE);
+ this.setType(ClusterType.TUBE);
}
}
diff --git a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterEntityMapper.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterEntityMapper.java
index b42103ebd..7a86fcdee 100644
--- a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterEntityMapper.java
+++ b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterEntityMapper.java
@@ -18,7 +18,7 @@
package org.apache.inlong.manager.dao.mapper;
import org.apache.ibatis.annotations.Param;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest;
import org.apache.inlong.manager.dao.entity.InlongClusterEntity;
import org.springframework.stereotype.Repository;
@@ -37,7 +37,7 @@ public interface InlongClusterEntityMapper {
List<InlongClusterEntity> selectByKey(@Param("clusterTag") String clusterTag, @Param("name") String name,
@Param("type") String type);
- List<InlongClusterEntity> selectByCondition(InlongClusterPageRequest request);
+ List<InlongClusterEntity> selectByCondition(ClusterPageRequest request);
int updateById(InlongClusterEntity record);
diff --git a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterNodeEntityMapper.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterNodeEntityMapper.java
index 7a13d9939..b9ff51c7c 100644
--- a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterNodeEntityMapper.java
+++ b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterNodeEntityMapper.java
@@ -19,7 +19,7 @@ package org.apache.inlong.manager.dao.mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.inlong.manager.common.pojo.cluster.ClusterNodeRequest;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest;
import org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity;
import org.springframework.stereotype.Repository;
@@ -34,7 +34,7 @@ public interface InlongClusterNodeEntityMapper {
InlongClusterNodeEntity selectByUniqueKey(ClusterNodeRequest request);
- List<InlongClusterNodeEntity> selectByCondition(InlongClusterPageRequest request);
+ List<InlongClusterNodeEntity> selectByCondition(ClusterPageRequest request);
List<InlongClusterNodeEntity> selectByParentId(@Param("parentId") Integer parentId);
diff --git a/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterEntityMapper.xml b/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterEntityMapper.xml
index 4edbc18ba..5f6b5f5e9 100644
--- a/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterEntityMapper.xml
+++ b/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterEntityMapper.xml
@@ -65,7 +65,7 @@
from inlong_cluster
where id = #{id,jdbcType=INTEGER}
</select>
- <select id="selectByKey" parameterType="org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest"
+ <select id="selectByKey" parameterType="org.apache.inlong.manager.common.pojo.cluster.ClusterRequest"
resultType="org.apache.inlong.manager.dao.entity.InlongClusterEntity">
select
<include refid="Base_Column_List"/>
@@ -83,7 +83,7 @@
order by modify_time desc
</select>
<select id="selectByCondition"
- parameterType="org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest"
+ parameterType="org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest"
resultType="org.apache.inlong.manager.dao.entity.InlongClusterEntity">
select
<include refid="Base_Column_List"/>
diff --git a/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterNodeEntityMapper.xml b/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterNodeEntityMapper.xml
index 3be803730..541fa9640 100644
--- a/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterNodeEntityMapper.xml
+++ b/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterNodeEntityMapper.xml
@@ -57,7 +57,7 @@
from inlong_cluster_node
where id = #{id,jdbcType=INTEGER}
</select>
- <select id="selectByUniqueKey" parameterType="org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest"
+ <select id="selectByUniqueKey" parameterType="org.apache.inlong.manager.common.pojo.cluster.ClusterRequest"
resultType="org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity">
select
<include refid="Base_Column_List"/>
@@ -70,7 +70,7 @@
and port = #{port, jdbcType=INTEGER}
</select>
<select id="selectByCondition"
- parameterType="org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest"
+ parameterType="org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest"
resultType="org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity">
select
<include refid="Base_Column_List"/>
@@ -80,10 +80,13 @@
<if test="type != null and type != ''">
and type = #{type, jdbcType=VARCHAR}
</if>
+ <if test="parentId != null and parentId != ''">
+ and parent_id = #{parentId, jdbcType=INTEGER}
+ </if>
<if test="keyword != null and keyword != ''">
and (
- ip like CONCAT('%',#{keyword},'%')
- or port like CONCAT('%',#{keyword},'%')
+ ip like CONCAT('%', #{keyword}, '%')
+ or port like CONCAT('%', #{keyword}, '%')
)
</if>
</where>
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/AbstractClusterOperator.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/AbstractClusterOperator.java
index 1aaaa0299..df7148b04 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/AbstractClusterOperator.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/AbstractClusterOperator.java
@@ -18,7 +18,7 @@
package org.apache.inlong.manager.service.cluster;
import org.apache.inlong.manager.common.consts.InlongConstants;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.util.CommonBeanUtils;
import org.apache.inlong.manager.dao.entity.InlongClusterEntity;
import org.apache.inlong.manager.dao.mapper.InlongClusterEntityMapper;
@@ -38,7 +38,7 @@ public abstract class AbstractClusterOperator implements InlongClusterOperator {
@Override
@Transactional(rollbackFor = Throwable.class)
- public Integer saveOpt(InlongClusterRequest request, String operator) {
+ public Integer saveOpt(ClusterRequest request, String operator) {
InlongClusterEntity entity = CommonBeanUtils.copyProperties(request, InlongClusterEntity::new);
// set the ext params
this.setTargetEntity(request, entity);
@@ -60,11 +60,11 @@ public abstract class AbstractClusterOperator implements InlongClusterOperator {
* @param request inlong cluster request
* @param targetEntity entity which will set the new parameters
*/
- protected abstract void setTargetEntity(InlongClusterRequest request, InlongClusterEntity targetEntity);
+ protected abstract void setTargetEntity(ClusterRequest request, InlongClusterEntity targetEntity);
@Override
@Transactional(rollbackFor = Throwable.class, isolation = Isolation.REPEATABLE_READ)
- public void updateOpt(InlongClusterRequest request, String operator) {
+ public void updateOpt(ClusterRequest request, String operator) {
InlongClusterEntity entity = CommonBeanUtils.copyProperties(request, InlongClusterEntity::new);
// set the ext params
this.setTargetEntity(request, entity);
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/DataProxyClusterOperator.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/DataProxyClusterOperator.java
index b91189857..0f9181098 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/DataProxyClusterOperator.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/DataProxyClusterOperator.java
@@ -20,8 +20,8 @@ package org.apache.inlong.manager.service.cluster;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
import org.apache.inlong.manager.common.exceptions.BusinessException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.cluster.dataproxy.DataProxyClusterInfo;
import org.apache.inlong.manager.common.util.CommonBeanUtils;
import org.apache.inlong.manager.dao.entity.InlongClusterEntity;
@@ -44,16 +44,16 @@ public class DataProxyClusterOperator extends AbstractClusterOperator {
@Override
public String getClusterType() {
- return ClusterType.CLS_DATA_PROXY;
+ return ClusterType.DATA_PROXY;
}
@Override
- protected void setTargetEntity(InlongClusterRequest request, InlongClusterEntity targetEntity) {
+ protected void setTargetEntity(ClusterRequest request, InlongClusterEntity targetEntity) {
LOGGER.info("do nothing for data proxy cluster in set target entity");
}
@Override
- public InlongClusterInfo getFromEntity(InlongClusterEntity entity) {
+ public ClusterInfo getFromEntity(InlongClusterEntity entity) {
if (entity == null) {
throw new BusinessException(ErrorCodeEnum.CLUSTER_NOT_FOUND);
}
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterOperator.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterOperator.java
index b5730f8aa..7fbb7833f 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterOperator.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterOperator.java
@@ -17,8 +17,8 @@
package org.apache.inlong.manager.service.cluster;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.dao.entity.InlongClusterEntity;
/**
@@ -45,7 +45,7 @@ public interface InlongClusterOperator {
* @param operator name of the operator
* @return cluster id after saving
*/
- Integer saveOpt(InlongClusterRequest request, String operator);
+ Integer saveOpt(ClusterRequest request, String operator);
/**
* Get the cluster info from the given entity.
@@ -53,7 +53,7 @@ public interface InlongClusterOperator {
* @param entity get field value from the entity
* @return cluster info after encapsulating
*/
- InlongClusterInfo getFromEntity(InlongClusterEntity entity);
+ ClusterInfo getFromEntity(InlongClusterEntity entity);
/**
* Update the inlong cluster info.
@@ -61,6 +61,6 @@ public interface InlongClusterOperator {
* @param request request of update
* @param operator name of operator
*/
- void updateOpt(InlongClusterRequest request, String operator);
+ void updateOpt(ClusterRequest request, String operator);
}
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterService.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterService.java
index 80d4d4ca3..cc28d9e83 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterService.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterService.java
@@ -19,14 +19,15 @@ package org.apache.inlong.manager.service.cluster;
import com.github.pagehelper.PageInfo;
import org.apache.inlong.common.pojo.dataproxy.DataProxyConfig;
+import org.apache.inlong.manager.common.pojo.cluster.BindTagRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.ClusterNodeRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterNodeResponse;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterTagPageRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterTagRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterTagResponse;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
import org.apache.inlong.manager.common.pojo.dataproxy.DataProxyNodeInfo;
import java.util.List;
@@ -86,7 +87,7 @@ public interface InlongClusterService {
* @param operator name of operator
* @return cluster id after saving
*/
- Integer save(InlongClusterRequest request, String operator);
+ Integer save(ClusterRequest request, String operator);
/**
* Get cluster info by id.
@@ -94,7 +95,7 @@ public interface InlongClusterService {
* @param id cluster id
* @return cluster info
*/
- InlongClusterInfo get(Integer id);
+ ClusterInfo get(Integer id);
/**
* Get one cluster by the cluster tag, cluster name and cluster type.
@@ -105,7 +106,7 @@ public interface InlongClusterService {
* @return cluster info
* @apiNote No matter how many clusters there are, only one cluster is returned.
*/
- InlongClusterInfo getOne(String clusterTag, String clusterName, String clusterType);
+ ClusterInfo getOne(String clusterTag, String clusterName, String clusterType);
/**
* Paging query clusters according to conditions.
@@ -113,7 +114,7 @@ public interface InlongClusterService {
* @param request page request conditions
* @return cluster list
*/
- PageInfo<InlongClusterInfo> list(InlongClusterPageRequest request);
+ PageInfo<ClusterInfo> list(ClusterPageRequest request);
/**
* Update cluster information
@@ -122,7 +123,16 @@ public interface InlongClusterService {
* @param operator current operator
* @return whether succeed
*/
- Boolean update(InlongClusterRequest request, String operator);
+ Boolean update(ClusterRequest request, String operator);
+
+ /**
+ * Bind or unbind cluster tag for clusters.
+ *
+ * @param request cluster info to be modified
+ * @param operator current operator
+ * @return whether succeed
+ */
+ Boolean bindTag(BindTagRequest request, String operator);
/**
* Delete cluster information.
@@ -156,7 +166,7 @@ public interface InlongClusterService {
* @param request page request conditions
* @return cluster node list
*/
- PageInfo<ClusterNodeResponse> listNode(InlongClusterPageRequest request);
+ PageInfo<ClusterNodeResponse> listNode(ClusterPageRequest request);
/**
* Query node IP list by cluster type
@@ -190,7 +200,7 @@ public interface InlongClusterService {
* @param request request params
* @return data proxy node list
*/
- List<DataProxyNodeInfo> getDataProxyNodeList(InlongClusterPageRequest request);
+ List<DataProxyNodeInfo> getDataProxyNodeList(ClusterPageRequest request);
/**
* Get the configuration of DataProxy through the cluster name to which DataProxy belongs.
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
index 17a49dca0..381b262b0 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
@@ -20,6 +20,8 @@ package org.apache.inlong.manager.service.cluster;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
+import com.google.common.base.Joiner;
+import com.google.common.collect.Sets;
import com.google.gson.Gson;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@@ -34,14 +36,15 @@ import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
import org.apache.inlong.manager.common.enums.GroupStatus;
import org.apache.inlong.manager.common.enums.MQType;
import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.apache.inlong.manager.common.pojo.cluster.BindTagRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.ClusterNodeRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterNodeResponse;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterTagPageRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterTagRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterTagResponse;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterDTO;
import org.apache.inlong.manager.common.pojo.dataproxy.DataProxyNodeInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupBriefInfo;
@@ -67,6 +70,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -106,7 +110,7 @@ public class InlongClusterServiceImpl implements InlongClusterService {
String clusterTag = request.getClusterTag();
InlongClusterTagEntity exist = clusterTagMapper.selectByTag(clusterTag);
if (exist != null) {
- String errMsg = String.format("inlong cluster tag already exist for tag=%s", clusterTag);
+ String errMsg = String.format("inlong cluster tag [%s] already exist", clusterTag);
LOGGER.error(errMsg);
throw new BusinessException(errMsg);
}
@@ -117,6 +121,7 @@ public class InlongClusterServiceImpl implements InlongClusterService {
Date now = new Date();
entity.setCreateTime(now);
entity.setModifyTime(now);
+ entity.setIsDeleted(InlongConstants.UN_DELETED);
clusterTagMapper.insert(entity);
LOGGER.info("success to save cluster tag={} by user={}", request, operator);
return entity.getId();
@@ -160,7 +165,7 @@ public class InlongClusterServiceImpl implements InlongClusterService {
// check cluster tag if exist
InlongClusterTagEntity exist = clusterTagMapper.selectByTag(request.getClusterTag());
if (exist != null && !Objects.equals(id, exist.getId())) {
- String errMsg = String.format("inlong cluster tag already exist for tag=%s", request.getClusterTag());
+ String errMsg = String.format("inlong cluster tag [%s] already exist", request.getClusterTag());
LOGGER.error(errMsg);
throw new BusinessException(errMsg);
}
@@ -194,7 +199,7 @@ public class InlongClusterServiceImpl implements InlongClusterService {
}
@Override
- public Integer save(InlongClusterRequest request, String operator) {
+ public Integer save(ClusterRequest request, String operator) {
LOGGER.debug("begin to save inlong cluster={}", request);
Preconditions.checkNotNull(request, "inlong cluster request cannot be empty");
@@ -217,7 +222,7 @@ public class InlongClusterServiceImpl implements InlongClusterService {
}
@Override
- public InlongClusterInfo get(Integer id) {
+ public ClusterInfo get(Integer id) {
Preconditions.checkNotNull(id, "inlong cluster id cannot be empty");
InlongClusterEntity entity = clusterMapper.selectById(id);
if (entity == null) {
@@ -226,29 +231,28 @@ public class InlongClusterServiceImpl implements InlongClusterService {
}
InlongClusterOperator instance = clusterOperatorFactory.getInstance(entity.getType());
- InlongClusterInfo clusterInfo = instance.getFromEntity(entity);
+ ClusterInfo clusterInfo = instance.getFromEntity(entity);
LOGGER.debug("success to get inlong cluster info by id={}", id);
return clusterInfo;
}
@Override
- public PageInfo<InlongClusterInfo> list(InlongClusterPageRequest request) {
+ public PageInfo<ClusterInfo> list(ClusterPageRequest request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
Page<InlongClusterEntity> entityPage = (Page<InlongClusterEntity>) clusterMapper.selectByCondition(request);
-
- List<InlongClusterInfo> list = entityPage.stream()
+ List<ClusterInfo> list = entityPage.stream()
.map(entity -> {
InlongClusterOperator instance = clusterOperatorFactory.getInstance(entity.getType());
return instance.getFromEntity(entity);
}).collect(Collectors.toList());
- PageInfo<InlongClusterInfo> page = new PageInfo<>(list);
+ PageInfo<ClusterInfo> page = new PageInfo<>(list);
page.setTotal(list.size());
LOGGER.debug("success to list inlong cluster by {}", request);
return page;
}
@Override
- public InlongClusterInfo getOne(String clusterTag, String name, String type) {
+ public ClusterInfo getOne(String clusterTag, String name, String type) {
List<InlongClusterEntity> entityList = clusterMapper.selectByKey(clusterTag, name, type);
if (CollectionUtils.isEmpty(entityList)) {
throw new BusinessException(String.format("cluster not found by tag=%s, name=%s, type=%s",
@@ -257,14 +261,14 @@ public class InlongClusterServiceImpl implements InlongClusterService {
InlongClusterEntity entity = entityList.get(0);
InlongClusterOperator instance = clusterOperatorFactory.getInstance(entity.getType());
- InlongClusterInfo result = instance.getFromEntity(entity);
+ ClusterInfo result = instance.getFromEntity(entity);
LOGGER.debug("success to get inlong cluster by tag={}, name={}, type={}", clusterTag, name, type);
return result;
}
@Override
- public Boolean update(InlongClusterRequest request, String operator) {
- LOGGER.debug("begin to update inlong cluster={}", request);
+ public Boolean update(ClusterRequest request, String operator) {
+ LOGGER.debug("begin to update inlong cluster: {}", request);
Preconditions.checkNotNull(request, "inlong cluster info cannot be empty");
Integer id = request.getId();
Preconditions.checkNotNull(id, "inlong cluster id cannot be empty");
@@ -289,7 +293,43 @@ public class InlongClusterServiceImpl implements InlongClusterService {
InlongClusterOperator instance = clusterOperatorFactory.getInstance(request.getType());
instance.updateOpt(request, operator);
- LOGGER.info("success to update inlong cluster={}", request);
+ LOGGER.info("success to update inlong cluster: {} by {}", request, operator);
+ return true;
+ }
+
+ @Override
+ public Boolean bindTag(BindTagRequest request, String operator) {
+ LOGGER.info("begin to bind or unbind cluster tag: {}", request);
+ Preconditions.checkNotNull(request, "inlong cluster info cannot be empty");
+ String clusterTag = request.getClusterTag();
+ Preconditions.checkNotNull(clusterTag, "cluster tag cannot be empty");
+
+ if (CollectionUtils.isNotEmpty(request.getBindClusters())) {
+ request.getBindClusters().forEach(id -> {
+ InlongClusterEntity entity = clusterMapper.selectById(id);
+ HashSet<String> tagSet = Sets.newHashSet(entity.getClusterTags().split(","));
+ tagSet.add(clusterTag);
+ String updateTags = Joiner.on(",").join(tagSet);
+ InlongClusterEntity updateEntity = new InlongClusterEntity();
+ updateEntity.setId(id);
+ updateEntity.setClusterTags(updateTags);
+ updateEntity.setModifier(operator);
+ clusterMapper.updateByIdSelective(updateEntity);
+ });
+ }
+
+ if (CollectionUtils.isNotEmpty(request.getUnbindClusters())) {
+ request.getUnbindClusters().forEach(id -> {
+ InlongClusterEntity entity = clusterMapper.selectById(id);
+ HashSet<String> tagSet = Sets.newHashSet(entity.getClusterTags().split(","));
+ tagSet.remove(clusterTag);
+ String updateTags = Joiner.on(",").join(tagSet);
+ entity.setClusterTags(updateTags);
+ entity.setModifier(operator);
+ clusterMapper.updateByIdSelective(entity);
+ });
+ }
+ LOGGER.info("success to bind or unbind cluster tag {} by {}", request, operator);
return true;
}
@@ -350,7 +390,7 @@ public class InlongClusterServiceImpl implements InlongClusterService {
}
@Override
- public PageInfo<ClusterNodeResponse> listNode(InlongClusterPageRequest request) {
+ public PageInfo<ClusterNodeResponse> listNode(ClusterPageRequest request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
Page<InlongClusterNodeEntity> entityPage = (Page<InlongClusterNodeEntity>)
clusterNodeMapper.selectByCondition(request);
@@ -365,7 +405,7 @@ public class InlongClusterServiceImpl implements InlongClusterService {
@Override
public List<String> listNodeIpByType(String type) {
Preconditions.checkNotNull(type, "cluster type cannot be empty");
- InlongClusterPageRequest request = new InlongClusterPageRequest();
+ ClusterPageRequest request = new ClusterPageRequest();
request.setType(type);
List<InlongClusterNodeEntity> nodeList = clusterNodeMapper.selectByCondition(request);
if (CollectionUtils.isEmpty(nodeList)) {
@@ -426,10 +466,10 @@ public class InlongClusterServiceImpl implements InlongClusterService {
}
@Override
- public List<DataProxyNodeInfo> getDataProxyNodeList(InlongClusterPageRequest request) {
+ public List<DataProxyNodeInfo> getDataProxyNodeList(ClusterPageRequest request) {
LOGGER.debug("begin to list data proxy node for request={}", request);
- request.setType(ClusterType.CLS_DATA_PROXY);
+ request.setType(ClusterType.DATA_PROXY);
List<InlongClusterEntity> clusterList = clusterMapper.selectByCondition(request);
Preconditions.checkNotEmpty(clusterList,
"data proxy node not found by request=" + request);
@@ -459,10 +499,10 @@ public class InlongClusterServiceImpl implements InlongClusterService {
LOGGER.debug("GetDPConfig: begin to get config by cluster tag={} name={}", clusterTag, clusterName);
// get all data proxy clusters
- InlongClusterPageRequest request = InlongClusterPageRequest.builder()
+ ClusterPageRequest request = ClusterPageRequest.builder()
.clusterTag(clusterTag)
.name(clusterName)
- .type(ClusterType.CLS_DATA_PROXY)
+ .type(ClusterType.DATA_PROXY)
.build();
List<InlongClusterEntity> clusterList = clusterMapper.selectByCondition(request);
DataProxyConfig result = new DataProxyConfig();
@@ -499,7 +539,7 @@ public class InlongClusterServiceImpl implements InlongClusterService {
List<InlongStreamBriefInfo> streamList = streamMapper.selectBriefList(groupId);
for (InlongStreamBriefInfo streamInfo : streamList) {
List<InlongClusterEntity> pulsarClusters = clusterMapper.selectByKey(realClusterTag, null,
- ClusterType.CLS_PULSAR);
+ ClusterType.PULSAR);
if (CollectionUtils.isEmpty(pulsarClusters)) {
LOGGER.error("GetDPConfig: pulsar cluster not found by cluster tag={}", realClusterTag);
continue;
@@ -532,8 +572,8 @@ public class InlongClusterServiceImpl implements InlongClusterService {
// get mq cluster info
LOGGER.debug("GetDPConfig: begin to get mq clusters by tags={}", clusterTagList);
List<MQClusterInfo> mqSet = new ArrayList<>();
- List<String> typeList = Arrays.asList(ClusterType.CLS_TUBE, ClusterType.CLS_PULSAR);
- InlongClusterPageRequest pageRequest = InlongClusterPageRequest.builder()
+ List<String> typeList = Arrays.asList(ClusterType.TUBE, ClusterType.PULSAR);
+ ClusterPageRequest pageRequest = ClusterPageRequest.builder()
.typeList(typeList)
.clusterTagList(clusterTagList)
.build();
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/PulsarClusterOperator.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/PulsarClusterOperator.java
index dcc8d4c8d..29cd9c436 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/PulsarClusterOperator.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/PulsarClusterOperator.java
@@ -22,8 +22,8 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
import org.apache.inlong.manager.common.exceptions.BusinessException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterDTO;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterRequest;
@@ -52,11 +52,11 @@ public class PulsarClusterOperator extends AbstractClusterOperator {
@Override
public String getClusterType() {
- return ClusterType.CLS_PULSAR;
+ return ClusterType.PULSAR;
}
@Override
- public InlongClusterInfo getFromEntity(InlongClusterEntity entity) {
+ public ClusterInfo getFromEntity(InlongClusterEntity entity) {
if (entity == null) {
throw new BusinessException(ErrorCodeEnum.CLUSTER_NOT_FOUND);
}
@@ -73,7 +73,7 @@ public class PulsarClusterOperator extends AbstractClusterOperator {
}
@Override
- protected void setTargetEntity(InlongClusterRequest request, InlongClusterEntity targetEntity) {
+ protected void setTargetEntity(ClusterRequest request, InlongClusterEntity targetEntity) {
PulsarClusterRequest pulsarRequest = (PulsarClusterRequest) request;
CommonBeanUtils.copyProperties(pulsarRequest, targetEntity, true);
try {
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/TubeClusterOperator.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/TubeClusterOperator.java
index fc72f3b8b..2a7e01c48 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/TubeClusterOperator.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/TubeClusterOperator.java
@@ -20,8 +20,8 @@ package org.apache.inlong.manager.service.cluster;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
import org.apache.inlong.manager.common.exceptions.BusinessException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.cluster.tube.TubeClusterInfo;
import org.apache.inlong.manager.common.util.CommonBeanUtils;
import org.apache.inlong.manager.dao.entity.InlongClusterEntity;
@@ -45,16 +45,16 @@ public class TubeClusterOperator extends AbstractClusterOperator {
@Override
public String getClusterType() {
- return ClusterType.CLS_TUBE;
+ return ClusterType.TUBE;
}
@Override
- protected void setTargetEntity(InlongClusterRequest request, InlongClusterEntity targetEntity) {
+ protected void setTargetEntity(ClusterRequest request, InlongClusterEntity targetEntity) {
LOGGER.info("do nothing for tube cluster in set target entity");
}
@Override
- public InlongClusterInfo getFromEntity(InlongClusterEntity entity) {
+ public ClusterInfo getFromEntity(InlongClusterEntity entity) {
if (entity == null) {
throw new BusinessException(ErrorCodeEnum.CLUSTER_NOT_FOUND);
}
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ConsumptionServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ConsumptionServiceImpl.java
index e8a7f578b..dfd7565a8 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ConsumptionServiceImpl.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ConsumptionServiceImpl.java
@@ -410,7 +410,7 @@ public class ConsumptionServiceImpl implements ConsumptionService {
InlongGroupEntity inlongGroupEntity = groupMapper.selectByGroupId(groupId);
if (null != inlongGroupEntity) {
PulsarClusterInfo pulsarCluster = (PulsarClusterInfo) clusterService.getOne(
- inlongGroupEntity.getInlongClusterTag(), null, ClusterType.CLS_PULSAR);
+ inlongGroupEntity.getInlongClusterTag(), null, ClusterType.PULSAR);
String tenant = StringUtils.isEmpty(pulsarCluster.getTenant())
? InlongConstants.DEFAULT_PULSAR_TENANT : pulsarCluster.getTenant();
info.setTopic(String.format(InlongConstants.PULSAR_TOPIC_FORMAT, tenant,
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarGroupTaskListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarGroupTaskListener.java
index 460dbf928..8cb3d1568 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarGroupTaskListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarGroupTaskListener.java
@@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.pulsar.PulsarTopicBean;
@@ -85,7 +85,7 @@ public class CreatePulsarGroupTaskListener implements QueueOperateListener {
}
String clusterTag = groupInfo.getInlongClusterTag();
- InlongClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.CLS_PULSAR);
+ ClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.PULSAR);
PulsarClusterInfo pulsarCluster = (PulsarClusterInfo) clusterInfo;
try (PulsarAdmin pulsarAdmin = PulsarUtils.getPulsarAdmin(pulsarCluster)) {
String tenant = pulsarCluster.getTenant();
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarResourceTaskListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarResourceTaskListener.java
index bdc45b613..876d4bc16 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarResourceTaskListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarResourceTaskListener.java
@@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.group.pulsar.InlongPulsarInfo;
@@ -79,8 +79,8 @@ public class CreatePulsarResourceTaskListener implements QueueOperateListener {
try {
InlongPulsarInfo pulsarInfo = (InlongPulsarInfo) groupInfo;
- InlongClusterInfo clusterInfo = clusterService.getOne(groupInfo.getInlongClusterTag(), null,
- ClusterType.CLS_PULSAR);
+ ClusterInfo clusterInfo = clusterService.getOne(groupInfo.getInlongClusterTag(), null,
+ ClusterType.PULSAR);
this.createPulsarProcess(pulsarInfo, (PulsarClusterInfo) clusterInfo);
} catch (Exception e) {
log.error("create pulsar resource error for groupId={}", groupId, e);
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarSubscriptionTaskListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarSubscriptionTaskListener.java
index c06dd42aa..36190d8bc 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarSubscriptionTaskListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarSubscriptionTaskListener.java
@@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.exceptions.BusinessException;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.pulsar.PulsarTopicBean;
@@ -72,7 +72,7 @@ public class CreatePulsarSubscriptionTaskListener implements QueueOperateListene
final String streamId = streamInfo.getInlongStreamId();
String clusterTag = groupInfo.getInlongClusterTag();
- InlongClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.CLS_PULSAR);
+ ClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.PULSAR);
PulsarClusterInfo pulsarCluster = (PulsarClusterInfo) clusterInfo;
try (PulsarAdmin pulsarAdmin = PulsarUtils.getPulsarAdmin(pulsarCluster)) {
// Query data sink info based on groupId and streamId
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarTopicTaskListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarTopicTaskListener.java
index 3a506aa4c..6b52f50e1 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarTopicTaskListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarTopicTaskListener.java
@@ -22,7 +22,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.inlong.manager.common.consts.InlongConstants;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.group.pulsar.InlongPulsarInfo;
@@ -70,7 +70,7 @@ public class CreatePulsarTopicTaskListener implements QueueOperateListener {
InlongPulsarInfo pulsarInfo = (InlongPulsarInfo) groupInfo;
String pulsarTopic = streamInfo.getMqResource();
String clusterTag = pulsarInfo.getInlongClusterTag();
- InlongClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.CLS_PULSAR);
+ ClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.PULSAR);
PulsarClusterInfo pulsarCluster = (PulsarClusterInfo) clusterInfo;
String tenant = pulsarCluster.getTenant();
if (StringUtils.isEmpty(tenant)) {
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreateTubeGroupTaskListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreateTubeGroupTaskListener.java
index 3ed670a9a..388c455ad 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreateTubeGroupTaskListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreateTubeGroupTaskListener.java
@@ -60,7 +60,7 @@ public class CreateTubeGroupTaskListener implements QueueOperateListener {
InlongGroupEntity groupEntity = groupMapper.selectByGroupId(groupId);
String clusterTag = groupEntity.getInlongClusterTag();
- TubeClusterInfo tubeCluster = (TubeClusterInfo) clusterService.getOne(clusterTag, null, ClusterType.CLS_TUBE);
+ TubeClusterInfo tubeCluster = (TubeClusterInfo) clusterService.getOne(clusterTag, null, ClusterType.TUBE);
String topicName = groupEntity.getMqResource();
// Consumer naming rules: clusterTag_topicName_consumer_group
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreateTubeTopicTaskListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreateTubeTopicTaskListener.java
index 554a8d298..d5342a2f7 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreateTubeTopicTaskListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreateTubeTopicTaskListener.java
@@ -20,7 +20,7 @@ package org.apache.inlong.manager.service.mq;
import lombok.extern.slf4j.Slf4j;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.tube.TubeClusterInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.workflow.form.GroupResourceProcessForm;
@@ -59,7 +59,7 @@ public class CreateTubeTopicTaskListener implements QueueOperateListener {
try {
InlongGroupInfo groupInfo = form.getGroupInfo();
String clusterTag = groupInfo.getInlongClusterTag();
- InlongClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.CLS_TUBE);
+ ClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.TUBE);
tubeMQOperator.createTopic((TubeClusterInfo) clusterInfo, groupInfo.getMqResource(), context.getOperator());
log.info("finish to create tube topic for groupId={}", groupId);
} catch (Exception e) {
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/DeletePulsarResourceTaskListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/DeletePulsarResourceTaskListener.java
index 3699cb1dd..70c3bbc55 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/DeletePulsarResourceTaskListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/DeletePulsarResourceTaskListener.java
@@ -20,7 +20,7 @@ package org.apache.inlong.manager.service.mq;
import lombok.extern.slf4j.Slf4j;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.group.pulsar.InlongPulsarInfo;
@@ -75,8 +75,8 @@ public class DeletePulsarResourceTaskListener implements QueueOperateListener {
}
try {
InlongPulsarInfo pulsarInfo = (InlongPulsarInfo) groupInfo;
- InlongClusterInfo clusterInfo = clusterService.getOne(groupInfo.getInlongClusterTag(), null,
- ClusterType.CLS_PULSAR);
+ ClusterInfo clusterInfo = clusterService.getOne(groupInfo.getInlongClusterTag(), null,
+ ClusterType.PULSAR);
deletePulsarProcess(pulsarInfo, (PulsarClusterInfo) clusterInfo);
} catch (Exception e) {
log.error("delete pulsar resource error for groupId={}", groupId, e);
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/DeletePulsarTopicTaskListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/DeletePulsarTopicTaskListener.java
index b7c279b19..59d0f6eb4 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/DeletePulsarTopicTaskListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/DeletePulsarTopicTaskListener.java
@@ -22,7 +22,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.inlong.manager.common.consts.InlongConstants;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.group.pulsar.InlongPulsarInfo;
@@ -70,7 +70,7 @@ public class DeletePulsarTopicTaskListener implements QueueOperateListener {
InlongPulsarInfo pulsarInfo = (InlongPulsarInfo) groupInfo;
String pulsarTopic = streamInfo.getMqResource();
String clusterTag = pulsarInfo.getInlongClusterTag();
- InlongClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.CLS_PULSAR);
+ ClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.PULSAR);
PulsarClusterInfo pulsarCluster = (PulsarClusterInfo) clusterInfo;
String tenant = pulsarCluster.getTenant();
if (StringUtils.isEmpty(tenant)) {
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/CreateSortConfigListenerV2.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/CreateSortConfigListenerV2.java
index 986f12591..17886bdc9 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/CreateSortConfigListenerV2.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/CreateSortConfigListenerV2.java
@@ -29,7 +29,7 @@ import org.apache.inlong.manager.common.enums.GroupOperateType;
import org.apache.inlong.manager.common.enums.MQType;
import org.apache.inlong.manager.common.enums.SourceType;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupExtInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
@@ -148,8 +148,8 @@ public class CreateSortConfigListenerV2 implements SortOperateListener {
}
Map<String, List<StreamSource>> sourceMap = Maps.newHashMap();
- InlongClusterInfo clusterInfo = clusterService.getOne(groupInfo.getInlongClusterTag(), null,
- ClusterType.CLS_PULSAR);
+ ClusterInfo clusterInfo = clusterService.getOne(groupInfo.getInlongClusterTag(), null,
+ ClusterType.PULSAR);
PulsarClusterInfo pulsarCluster = (PulsarClusterInfo) clusterInfo;
String adminUrl = pulsarCluster.getAdminUrl();
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/CreateStreamSortConfigListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/CreateStreamSortConfigListener.java
index 63c86ecc9..e8fe29148 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/CreateStreamSortConfigListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/CreateStreamSortConfigListener.java
@@ -28,7 +28,7 @@ import org.apache.inlong.manager.common.enums.GroupOperateType;
import org.apache.inlong.manager.common.enums.MQType;
import org.apache.inlong.manager.common.enums.SourceType;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
import org.apache.inlong.manager.common.pojo.sink.StreamSink;
@@ -136,8 +136,8 @@ public class CreateStreamSortConfigListener implements SortOperateListener {
pulsarSource.setNamespace(groupInfo.getMqResource());
pulsarSource.setTopic(streamInfo.getMqResource());
- InlongClusterInfo clusterInfo = clusterService.getOne(groupInfo.getInlongClusterTag(), null,
- ClusterType.CLS_PULSAR);
+ ClusterInfo clusterInfo = clusterService.getOne(groupInfo.getInlongClusterTag(), null,
+ ClusterType.PULSAR);
PulsarClusterInfo pulsarCluster = (PulsarClusterInfo) clusterInfo;
String adminUrl = pulsarCluster.getAdminUrl();
String serviceUrl = pulsarCluster.getUrl();
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/consumption/listener/ConsumptionCompleteProcessListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/consumption/listener/ConsumptionCompleteProcessListener.java
index 544e1b03b..56009d623 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/consumption/listener/ConsumptionCompleteProcessListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/consumption/listener/ConsumptionCompleteProcessListener.java
@@ -24,7 +24,7 @@ import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.enums.ConsumptionStatus;
import org.apache.inlong.manager.common.enums.MQType;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.tube.TubeClusterInfo;
import org.apache.inlong.manager.common.pojo.pulsar.PulsarTopicBean;
@@ -121,7 +121,7 @@ public class ConsumptionCompleteProcessListener implements ProcessEventListener
Preconditions.checkNotNull(mqResource, "mq resource cannot empty for groupId=" + groupId);
String clusterTag = groupEntity.getInlongClusterTag();
- InlongClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.CLS_PULSAR);
+ ClusterInfo clusterInfo = clusterService.getOne(clusterTag, null, ClusterType.PULSAR);
PulsarClusterInfo pulsarCluster = (PulsarClusterInfo) clusterInfo;
try (PulsarAdmin pulsarAdmin = PulsarUtils.getPulsarAdmin(pulsarCluster)) {
PulsarTopicBean topicMessage = new PulsarTopicBean();
@@ -163,7 +163,7 @@ public class ConsumptionCompleteProcessListener implements ProcessEventListener
Preconditions.checkNotNull(mqResource, "mq resource cannot empty for groupId=" + groupId);
String clusterTag = groupEntity.getInlongClusterTag();
- TubeClusterInfo clusterInfo = (TubeClusterInfo) clusterService.getOne(clusterTag, null, ClusterType.CLS_TUBE);
+ TubeClusterInfo clusterInfo = (TubeClusterInfo) clusterService.getOne(clusterTag, null, ClusterType.TUBE);
try {
tubeMQOperator.createConsumerGroup(clusterInfo, entity.getTopic(), entity.getConsumerGroup(), operator);
} catch (Exception e) {
diff --git a/inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceTest.java b/inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceTest.java
index 73fc43398..9717be3ba 100644
--- a/inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceTest.java
+++ b/inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceTest.java
@@ -21,8 +21,8 @@ import com.github.pagehelper.PageInfo;
import org.apache.inlong.manager.common.enums.ClusterType;
import org.apache.inlong.manager.common.pojo.cluster.ClusterNodeRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterNodeResponse;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest;
import org.apache.inlong.manager.common.pojo.cluster.dataproxy.DataProxyClusterRequest;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterRequest;
@@ -49,7 +49,7 @@ public class InlongClusterServiceTest extends ServiceBaseTest {
DataProxyClusterRequest request = new DataProxyClusterRequest();
request.setClusterTags(clusterTag);
request.setName(clusterName);
- request.setType(ClusterType.CLS_DATA_PROXY);
+ request.setType(ClusterType.DATA_PROXY);
request.setExtTag(extTag);
request.setInCharges(GLOBAL_OPERATOR);
return clusterService.save(request, GLOBAL_OPERATOR);
@@ -62,7 +62,7 @@ public class InlongClusterServiceTest extends ServiceBaseTest {
PulsarClusterRequest request = new PulsarClusterRequest();
request.setClusterTags(clusterTag);
request.setName(clusterName);
- request.setType(ClusterType.CLS_PULSAR);
+ request.setType(ClusterType.PULSAR);
request.setAdminUrl(adminUrl);
request.setTenant("public");
request.setInCharges(GLOBAL_OPERATOR);
@@ -72,8 +72,8 @@ public class InlongClusterServiceTest extends ServiceBaseTest {
/**
* List clusters by page.
*/
- public PageInfo<InlongClusterInfo> listCluster(String type, String clusterTag) {
- InlongClusterPageRequest request = new InlongClusterPageRequest();
+ public PageInfo<ClusterInfo> listCluster(String type, String clusterTag) {
+ ClusterPageRequest request = new ClusterPageRequest();
request.setType(type);
request.setClusterTag(clusterTag);
return clusterService.list(request);
@@ -115,7 +115,7 @@ public class InlongClusterServiceTest extends ServiceBaseTest {
* List cluster nodes by page.
*/
public PageInfo<ClusterNodeResponse> listClusterNode(String type, String keyword) {
- InlongClusterPageRequest request = new InlongClusterPageRequest();
+ ClusterPageRequest request = new ClusterPageRequest();
request.setType(type);
request.setKeyword(keyword);
return clusterService.listNode(request);
@@ -153,9 +153,9 @@ public class InlongClusterServiceTest extends ServiceBaseTest {
Assertions.assertNotNull(id);
// list cluster
- PageInfo<InlongClusterInfo> listCluster = this.listCluster(ClusterType.CLS_PULSAR, clusterTag);
+ PageInfo<ClusterInfo> listCluster = this.listCluster(ClusterType.PULSAR, clusterTag);
Assertions.assertTrue(listCluster.getList().size() > 0);
- InlongClusterInfo clusterInfo = listCluster.getList().get(0);
+ ClusterInfo clusterInfo = listCluster.getList().get(0);
PulsarClusterInfo pulsarCluster = (PulsarClusterInfo) clusterInfo;
Assertions.assertEquals(adminUrl, pulsarCluster.getAdminUrl());
@@ -170,11 +170,11 @@ public class InlongClusterServiceTest extends ServiceBaseTest {
Integer parentId = id;
String ip = "127.0.0.1";
Integer port = 8080;
- Integer nodeId = this.saveClusterNode(parentId, ClusterType.CLS_PULSAR, ip, port);
+ Integer nodeId = this.saveClusterNode(parentId, ClusterType.PULSAR, ip, port);
Assertions.assertNotNull(nodeId);
// list cluster node
- PageInfo<ClusterNodeResponse> listNode = this.listClusterNode(ClusterType.CLS_PULSAR, ip);
+ PageInfo<ClusterNodeResponse> listNode = this.listClusterNode(ClusterType.PULSAR, ip);
Assertions.assertEquals(listNode.getTotal(), 1);
// update cluster node
@@ -205,15 +205,15 @@ public class InlongClusterServiceTest extends ServiceBaseTest {
// save cluster node
String ip = "127.0.0.1";
Integer port1 = 46800;
- Integer nodeId1 = this.saveClusterNode(id, ClusterType.CLS_DATA_PROXY, ip, port1);
+ Integer nodeId1 = this.saveClusterNode(id, ClusterType.DATA_PROXY, ip, port1);
Assertions.assertNotNull(nodeId1);
Integer port2 = 46801;
- Integer nodeId2 = this.saveClusterNode(id, ClusterType.CLS_DATA_PROXY, ip, port2);
+ Integer nodeId2 = this.saveClusterNode(id, ClusterType.DATA_PROXY, ip, port2);
Assertions.assertNotNull(nodeId2);
// Get the data proxy cluster ip list, the first port should is p1, second port is p2
- InlongClusterPageRequest request = new InlongClusterPageRequest();
+ ClusterPageRequest request = new ClusterPageRequest();
request.setName(clusterName);
request.setClusterTag(clusterTag);
request.setExtTag(extTag);
diff --git a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/InlongClusterController.java b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/InlongClusterController.java
index 93d661dbc..601720976 100644
--- a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/InlongClusterController.java
+++ b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/InlongClusterController.java
@@ -23,14 +23,15 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.inlong.manager.common.beans.Response;
import org.apache.inlong.manager.common.enums.OperationType;
+import org.apache.inlong.manager.common.pojo.cluster.BindTagRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
import org.apache.inlong.manager.common.pojo.cluster.ClusterNodeRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterNodeResponse;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterTagPageRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterTagRequest;
import org.apache.inlong.manager.common.pojo.cluster.ClusterTagResponse;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
import org.apache.inlong.manager.common.pojo.user.UserRoleCode;
import org.apache.inlong.manager.common.util.LoginUserUtils;
import org.apache.inlong.manager.service.cluster.InlongClusterService;
@@ -101,7 +102,7 @@ public class InlongClusterController {
@ApiOperation(value = "Save cluster")
@OperationLog(operation = OperationType.CREATE)
@RequiresRoles(value = UserRoleCode.ADMIN)
- public Response<Integer> save(@Validated @RequestBody InlongClusterRequest request) {
+ public Response<Integer> save(@Validated @RequestBody ClusterRequest request) {
String currentUser = LoginUserUtils.getLoginUserDetail().getUsername();
return Response.success(clusterService.save(request, currentUser));
}
@@ -109,24 +110,32 @@ public class InlongClusterController {
@GetMapping(value = "/cluster/get/{id}")
@ApiOperation(value = "Get cluster by id")
@ApiImplicitParam(name = "id", value = "Cluster ID", dataTypeClass = Integer.class, required = true)
- public Response<InlongClusterInfo> get(@PathVariable Integer id) {
+ public Response<ClusterInfo> get(@PathVariable Integer id) {
return Response.success(clusterService.get(id));
}
@PostMapping(value = "/cluster/list")
@ApiOperation(value = "List clusters")
- public Response<PageInfo<InlongClusterInfo>> list(@RequestBody InlongClusterPageRequest request) {
+ public Response<PageInfo<ClusterInfo>> list(@RequestBody ClusterPageRequest request) {
return Response.success(clusterService.list(request));
}
@PostMapping(value = "/cluster/update")
@OperationLog(operation = OperationType.UPDATE)
@ApiOperation(value = "Update cluster")
- public Response<Boolean> update(@Validated @RequestBody InlongClusterRequest request) {
+ public Response<Boolean> update(@Validated @RequestBody ClusterRequest request) {
String username = LoginUserUtils.getLoginUserDetail().getUsername();
return Response.success(clusterService.update(request, username));
}
+ @PostMapping(value = "/cluster/bindTag")
+ @OperationLog(operation = OperationType.UPDATE)
+ @ApiOperation(value = "Bind or unbind cluster tag")
+ public Response<Boolean> bindTag(@Validated @RequestBody BindTagRequest request) {
+ String username = LoginUserUtils.getLoginUserDetail().getUsername();
+ return Response.success(clusterService.bindTag(request, username));
+ }
+
@DeleteMapping(value = "/cluster/delete/{id}")
@ApiOperation(value = "Delete cluster by id")
@OperationLog(operation = OperationType.DELETE)
@@ -153,7 +162,7 @@ public class InlongClusterController {
@PostMapping(value = "/cluster/node/list")
@ApiOperation(value = "List cluster nodes")
- public Response<PageInfo<ClusterNodeResponse>> listNode(@RequestBody InlongClusterPageRequest request) {
+ public Response<PageInfo<ClusterNodeResponse>> listNode(@RequestBody ClusterPageRequest request) {
return Response.success(clusterService.listNode(request));
}
diff --git a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/DataProxyController.java b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/DataProxyController.java
index 795561c72..0153cd070 100644
--- a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/DataProxyController.java
+++ b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/DataProxyController.java
@@ -24,7 +24,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.apache.inlong.common.pojo.dataproxy.DataProxyConfig;
import org.apache.inlong.manager.common.beans.Response;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest;
import org.apache.inlong.manager.common.pojo.dataproxy.DataProxyNodeInfo;
import org.apache.inlong.manager.service.cluster.InlongClusterService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -50,7 +50,7 @@ public class DataProxyController {
@PostMapping(value = "/dataproxy/getIpList")
@ApiOperation(value = "Get data proxy ip list by cluster name and tag")
- public Response<List<DataProxyNodeInfo>> getIpList(@RequestBody InlongClusterPageRequest request) {
+ public Response<List<DataProxyNodeInfo>> getIpList(@RequestBody ClusterPageRequest request) {
return Response.success(clusterService.getDataProxyNodeList(request));
}
diff --git a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/OpenClusterController.java b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/OpenClusterController.java
index 45e51cdc6..88f8c7a8f 100644
--- a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/OpenClusterController.java
+++ b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/OpenClusterController.java
@@ -22,14 +22,10 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.inlong.manager.common.beans.Response;
-import org.apache.inlong.manager.common.enums.OperationType;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterInfo;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterPageRequest;
-import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterPageRequest;
import org.apache.inlong.manager.service.cluster.InlongClusterService;
-import org.apache.inlong.manager.service.core.operationlog.OperationLog;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@@ -48,40 +44,17 @@ public class OpenClusterController {
@Autowired
private InlongClusterService clusterService;
- @Deprecated
- @PostMapping(value = "/save")
- @ApiOperation(value = "Save cluster info")
- @OperationLog(operation = OperationType.CREATE)
- public Response<Integer> save(@RequestBody InlongClusterRequest request) {
- return Response.success(clusterService.save(request, "admin"));
- }
-
@GetMapping(value = "/get/{id}")
@ApiOperation(value = "Get cluster by id")
@ApiImplicitParam(name = "id", value = "common cluster ID", dataTypeClass = Integer.class, required = true)
- public Response<InlongClusterInfo> get(@PathVariable Integer id) {
+ public Response<ClusterInfo> get(@PathVariable Integer id) {
return Response.success(clusterService.get(id));
}
@PostMapping(value = "/list")
@ApiOperation(value = "Get clusters by paginating")
- public Response<PageInfo<InlongClusterInfo>> list(@RequestBody InlongClusterPageRequest request) {
+ public Response<PageInfo<ClusterInfo>> list(@RequestBody ClusterPageRequest request) {
return Response.success(clusterService.list(request));
}
- @PostMapping(value = "/update")
- @OperationLog(operation = OperationType.UPDATE)
- @ApiOperation(value = "Update cluster info")
- public Response<Boolean> update(@RequestBody InlongClusterRequest request) {
- return Response.success(clusterService.update(request, null));
- }
-
- @DeleteMapping(value = "/delete/{id}")
- @ApiOperation(value = "Delete cluster by id")
- @OperationLog(operation = OperationType.DELETE)
- @ApiImplicitParam(name = "id", value = "Cluster ID", dataTypeClass = Integer.class, required = true)
- public Response<Boolean> delete(@PathVariable Integer id) {
- return Response.success(clusterService.delete(id, null));
- }
-
}