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/04/26 07:07:18 UTC
[incubator-inlong] branch master updated: [INLONG-3943][Manager] Add inlong_cluster and inlong_cluster_node tables (#3945)
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/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new ee60e8939 [INLONG-3943][Manager] Add inlong_cluster and inlong_cluster_node tables (#3945)
ee60e8939 is described below
commit ee60e89395e8badac464a979a1eb934ff960bfaf
Author: healchow <he...@gmail.com>
AuthorDate: Tue Apr 26 15:07:13 2022 +0800
[INLONG-3943][Manager] Add inlong_cluster and inlong_cluster_node tables (#3945)
* [INLONG-3943][Manager] Add inlong_cluster and inlong_cluster_node tables
* [INLONG-3943][Manager] Add Apache license header
* [INLONG-3943][Manager] Remove unnecessary field comment
* [INLONG-3943][Manager] Remove unnecessary comment
---
...terPageRequest.java => ClusterNodeRequest.java} | 35 +--
...usterResponse.java => ClusterNodeResponse.java} | 33 +--
.../common/pojo/cluster/ClusterPageRequest.java | 1 +
.../common/pojo/cluster/ClusterRequest.java | 1 +
.../common/pojo/cluster/ClusterResponse.java | 1 +
...eRequest.java => InlongClusterPageRequest.java} | 25 ++-
...rPageRequest.java => InlongClusterRequest.java} | 45 ++--
...terResponse.java => InlongClusterResponse.java} | 32 ++-
.../manager/dao/entity/InlongClusterEntity.java | 48 +++++
.../dao/entity/InlongClusterNodeEntity.java} | 41 ++--
.../dao/mapper/InlongClusterEntityMapper.java | 38 ++++
.../dao/mapper/InlongClusterNodeEntityMapper.java | 38 ++++
.../src/main/resources/generatorConfig.xml | 194 +----------------
.../mappers/InlongClusterEntityMapper.xml | 234 +++++++++++++++++++++
.../mappers/InlongClusterNodeEntityMapper.xml | 202 ++++++++++++++++++
.../manager/service/core/InlongClusterService.java | 118 +++++++++++
.../service/core/ThirdPartyClusterService.java | 1 +
.../core/impl/InlongClusterServiceImpl.java | 96 +++++++++
.../core/impl/ThirdPartyClusterServiceImpl.java | 1 +
.../main/resources/sql/apache_inlong_manager.sql | 47 +++++
.../manager-web/sql/apache_inlong_manager.sql | 49 +++++
...ontroller.java => InlongClusterController.java} | 90 ++++----
22 files changed, 1027 insertions(+), 343 deletions(-)
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterNodeRequest.java
similarity index 64%
copy from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
copy to inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterNodeRequest.java
index 18c471cbd..2a9785542 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterNodeRequest.java
@@ -20,33 +20,34 @@ package org.apache.inlong.manager.common.pojo.cluster;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.apache.inlong.manager.common.beans.PageRequest;
+
+import javax.validation.constraints.NotBlank;
/**
- * Cluster paging query conditions
+ * Inlong cluster node request
*/
@Data
-@EqualsAndHashCode(callSuper = false)
-@ApiModel("Cluster paging query conditions")
-public class ClusterPageRequest extends PageRequest {
+@ApiModel("Cluster node request")
+public class ClusterNodeRequest {
+
+ @ApiModelProperty(value = "Primary key")
+ private Integer id;
+
+ @NotBlank
+ @ApiModelProperty(value = "ID of the parent cluster")
+ private Integer clusterId;
- @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, etc.")
+ @NotBlank
+ @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, DATA_PROXY, etc.")
private String type;
@ApiModelProperty(value = "Cluster IP")
private String ip;
- @ApiModelProperty(value = "Keywords, name, description, etc.")
- private String keyWord;
-
- @ApiModelProperty(value = "Status")
- private Integer status;
-
- @ApiModelProperty(value = "Current user", hidden = true)
- private String currentUser;
+ @ApiModelProperty(value = "Cluster port")
+ private Integer port;
- @ApiModelProperty(value = "Set name of MQ cluster", hidden = true)
- private String mqSetName;
+ @ApiModelProperty(value = "Extended params")
+ private String extParams;
}
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterNodeResponse.java
similarity index 73%
copy from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java
copy to inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterNodeResponse.java
index 5727c2ce3..52f14a38e 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterNodeResponse.java
@@ -25,45 +25,30 @@ import lombok.Data;
import java.util.Date;
/**
- * Cluster response
+ * Inlong cluster node response
*/
@Data
-@ApiModel("Cluster response")
-public class ClusterResponse {
+@ApiModel("Cluster node response")
+public class ClusterNodeResponse {
@ApiModelProperty(value = "Primary key")
private Integer id;
- @ApiModelProperty(value = "Cluster name")
- private String name;
+ @ApiModelProperty(value = "ID of the parent cluster")
+ private Integer parentId;
- @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, etc.")
+ @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, DATA_PROXY, etc.")
private String type;
+ @ApiModelProperty(value = "Extended params")
+ private String extParams;
+
@ApiModelProperty(value = "Cluster IP")
private String ip;
@ApiModelProperty(value = "Cluster port")
private Integer port;
- @ApiModelProperty(value = "Cluster token")
- private String token;
-
- @ApiModelProperty(value = "Cluster URL address")
- private String url;
-
- @ApiModelProperty(value = "Whether it is a backup cluster, 0: no, 1: yes")
- private Integer isBackup;
-
- @ApiModelProperty(value = "MQ set name")
- private String mqSetName;
-
- @ApiModelProperty(value = "MQ config info")
- private String extParams;
-
- @ApiModelProperty(value = "Name of in charges, separated by commas")
- private String inCharges;
-
@ApiModelProperty(value = "Cluster status")
private Integer status;
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
index 18c471cbd..adcce3511 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
@@ -26,6 +26,7 @@ import org.apache.inlong.manager.common.beans.PageRequest;
/**
* Cluster paging query conditions
*/
+@Deprecated
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel("Cluster paging query conditions")
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterRequest.java
index 7494a87f9..2081ba8cc 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterRequest.java
@@ -28,6 +28,7 @@ import lombok.NoArgsConstructor;
/**
* Cluster information query conditions
*/
+@Deprecated
@Data
@Builder
@NoArgsConstructor
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java
index 5727c2ce3..6974d490b 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java
@@ -27,6 +27,7 @@ import java.util.Date;
/**
* Cluster response
*/
+@Deprecated
@Data
@ApiModel("Cluster response")
public class ClusterResponse {
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterPageRequest.java
similarity index 73%
copy from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
copy to inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterPageRequest.java
index 18c471cbd..cc379c78d 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterPageRequest.java
@@ -24,21 +24,27 @@ import lombok.EqualsAndHashCode;
import org.apache.inlong.manager.common.beans.PageRequest;
/**
- * Cluster paging query conditions
+ * Inlong cluster paging query conditions
*/
@Data
@EqualsAndHashCode(callSuper = false)
-@ApiModel("Cluster paging query conditions")
-public class ClusterPageRequest extends PageRequest {
+@ApiModel("Inlong cluster paging query request")
+public class InlongClusterPageRequest extends PageRequest {
- @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, etc.")
+ @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, DATA_PROXY, etc.")
private String type;
- @ApiModelProperty(value = "Cluster IP")
- private String ip;
+ @ApiModelProperty(value = "Cluster URL")
+ private String url;
- @ApiModelProperty(value = "Keywords, name, description, etc.")
- private String keyWord;
+ @ApiModelProperty(value = "Keywords, name, cluster tag, etc.")
+ private String keyword;
+
+ @ApiModelProperty(value = "Cluster tag")
+ private String clusterTag;
+
+ @ApiModelProperty(value = "Cluster zone tag")
+ private String zoneTag;
@ApiModelProperty(value = "Status")
private Integer status;
@@ -46,7 +52,4 @@ public class ClusterPageRequest extends PageRequest {
@ApiModelProperty(value = "Current user", hidden = true)
private String currentUser;
- @ApiModelProperty(value = "Set name of MQ cluster", hidden = true)
- private String mqSetName;
-
}
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterRequest.java
similarity index 55%
copy from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
copy to inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterRequest.java
index 18c471cbd..931df5a9b 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterRequest.java
@@ -20,33 +20,44 @@ package org.apache.inlong.manager.common.pojo.cluster;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.apache.inlong.manager.common.beans.PageRequest;
+
+import javax.validation.constraints.NotBlank;
/**
- * Cluster paging query conditions
+ * Inlong cluster request
*/
@Data
-@EqualsAndHashCode(callSuper = false)
-@ApiModel("Cluster paging query conditions")
-public class ClusterPageRequest extends PageRequest {
+@ApiModel("Inlong cluster request")
+public class InlongClusterRequest {
+
+ @ApiModelProperty(value = "Primary key")
+ private Integer id;
- @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, etc.")
+ @NotBlank
+ @ApiModelProperty(value = "Cluster name")
+ private String name;
+
+ @NotBlank
+ @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, DATA_PROXY, etc.")
private String type;
- @ApiModelProperty(value = "Cluster IP")
- private String ip;
+ @ApiModelProperty(value = "Cluster url")
+ private String url;
+
+ @NotBlank
+ @ApiModelProperty(value = "Cluster tag")
+ private String clusterTag;
- @ApiModelProperty(value = "Keywords, name, description, etc.")
- private String keyWord;
+ @ApiModelProperty(value = "Cluster zone tag")
+ private String zoneTag;
- @ApiModelProperty(value = "Status")
- private Integer status;
+ @ApiModelProperty(value = "Cluster heartbeat info")
+ private String heartbeat;
- @ApiModelProperty(value = "Current user", hidden = true)
- private String currentUser;
+ @ApiModelProperty(value = "Extended params")
+ private String extParams;
- @ApiModelProperty(value = "Set name of MQ cluster", hidden = true)
- private String mqSetName;
+ @ApiModelProperty(value = "Name of responsible person, separated by commas")
+ private String inCharges;
}
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterResponse.java
similarity index 75%
copy from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java
copy to inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterResponse.java
index 5727c2ce3..a136476c6 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterResponse.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/InlongClusterResponse.java
@@ -25,11 +25,11 @@ import lombok.Data;
import java.util.Date;
/**
- * Cluster response
+ * Inlong cluster response
*/
@Data
-@ApiModel("Cluster response")
-public class ClusterResponse {
+@ApiModel("Inlong cluster response")
+public class InlongClusterResponse {
@ApiModelProperty(value = "Primary key")
private Integer id;
@@ -37,28 +37,22 @@ public class ClusterResponse {
@ApiModelProperty(value = "Cluster name")
private String name;
- @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, etc.")
+ @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, DATA_PROXY, etc.")
private String type;
- @ApiModelProperty(value = "Cluster IP")
- private String ip;
-
- @ApiModelProperty(value = "Cluster port")
- private Integer port;
-
- @ApiModelProperty(value = "Cluster token")
- private String token;
-
- @ApiModelProperty(value = "Cluster URL address")
+ @ApiModelProperty(value = "Cluster url")
private String url;
- @ApiModelProperty(value = "Whether it is a backup cluster, 0: no, 1: yes")
- private Integer isBackup;
+ @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, DATA_PROXY, etc.")
+ private String clusterTag;
+
+ @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, DATA_PROXY, etc.")
+ private String zoneTag;
- @ApiModelProperty(value = "MQ set name")
- private String mqSetName;
+ @ApiModelProperty(value = "Cluster heartbeat info")
+ private String heartbeat;
- @ApiModelProperty(value = "MQ config info")
+ @ApiModelProperty(value = "Extended params")
private String extParams;
@ApiModelProperty(value = "Name of in charges, separated by commas")
diff --git a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/InlongClusterEntity.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/InlongClusterEntity.java
new file mode 100644
index 000000000..1e7b607a6
--- /dev/null
+++ b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/InlongClusterEntity.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.dao.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class InlongClusterEntity implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private Integer id;
+ private String name;
+ private String type;
+ private String url;
+ private String clusterTag;
+ private String zoneTag;
+
+ private String extParams;
+ private String heartbeat;
+ private String inCharges;
+
+ private Integer status;
+ private Integer isDeleted;
+ private String creator;
+ private String modifier;
+ private Date createTime;
+ private Date modifyTime;
+
+}
\ No newline at end of file
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/InlongClusterNodeEntity.java
similarity index 51%
copy from inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
copy to inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/InlongClusterNodeEntity.java
index 18c471cbd..0ded49141 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/cluster/ClusterPageRequest.java
+++ b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/InlongClusterNodeEntity.java
@@ -15,38 +15,29 @@
* limitations under the License.
*/
-package org.apache.inlong.manager.common.pojo.cluster;
+package org.apache.inlong.manager.dao.entity;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.apache.inlong.manager.common.beans.PageRequest;
-/**
- * Cluster paging query conditions
- */
+import java.io.Serializable;
+import java.util.Date;
+
@Data
-@EqualsAndHashCode(callSuper = false)
-@ApiModel("Cluster paging query conditions")
-public class ClusterPageRequest extends PageRequest {
+public class InlongClusterNodeEntity implements Serializable {
- @ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, etc.")
+ private static final long serialVersionUID = 1L;
+ private Integer id;
+ private Integer parentId;
private String type;
-
- @ApiModelProperty(value = "Cluster IP")
private String ip;
+ private Integer port;
+ private String extParams;
- @ApiModelProperty(value = "Keywords, name, description, etc.")
- private String keyWord;
-
- @ApiModelProperty(value = "Status")
private Integer status;
+ private Integer isDeleted;
+ private String creator;
+ private String modifier;
+ private Date createTime;
+ private Date modifyTime;
- @ApiModelProperty(value = "Current user", hidden = true)
- private String currentUser;
-
- @ApiModelProperty(value = "Set name of MQ cluster", hidden = true)
- private String mqSetName;
-
-}
+}
\ No newline at end of file
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
new file mode 100644
index 000000000..4028460ee
--- /dev/null
+++ b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterEntityMapper.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.dao.mapper;
+
+import org.apache.inlong.manager.dao.entity.InlongClusterEntity;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface InlongClusterEntityMapper {
+
+ int insert(InlongClusterEntity record);
+
+ int insertSelective(InlongClusterEntity record);
+
+ InlongClusterEntity selectById(Integer id);
+
+ int updateByIdSelective(InlongClusterEntity record);
+
+ int updateById(InlongClusterEntity record);
+
+ int deleteByPrimaryKey(Integer id);
+
+}
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
new file mode 100644
index 000000000..d2466dc92
--- /dev/null
+++ b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/InlongClusterNodeEntityMapper.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.dao.mapper;
+
+import org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface InlongClusterNodeEntityMapper {
+
+ int insert(InlongClusterNodeEntity record);
+
+ int insertSelective(InlongClusterNodeEntity record);
+
+ InlongClusterNodeEntity selectById(Integer id);
+
+ int updateById(InlongClusterNodeEntity record);
+
+ int updateByIdSelective(InlongClusterNodeEntity record);
+
+ int deleteById(Integer id);
+
+}
\ No newline at end of file
diff --git a/inlong-manager/manager-dao/src/main/resources/generatorConfig.xml b/inlong-manager/manager-dao/src/main/resources/generatorConfig.xml
index e5876c57a..b79357660 100644
--- a/inlong-manager/manager-dao/src/main/resources/generatorConfig.xml
+++ b/inlong-manager/manager-dao/src/main/resources/generatorConfig.xml
@@ -67,196 +67,18 @@
</javaClientGenerator>
<!-- Which entities to generate -->
- <table tableName="stream_transform_field" domainObjectName="StreamTransformFieldEntity"
- enableSelectByPrimaryKey="true" enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
+ <table tableName="inlong_cluster" domainObjectName="InlongClusterEntity"
+ enableInsert="true" enableSelectByPrimaryKey="true"
+ enableUpdateByPrimaryKey="true" enableDeleteByPrimaryKey="true"
enableCountByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" enableUpdateByExample="false">
</table>
- <!--<table tableName="user" domainObjectName="UserEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="true" enableUpdateByExample="false"/>
-
- <table tableName="user_role" domainObjectName="UserRoleEntity"
- enableSelectByPrimaryKey="true" enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="inlong_group" domainObjectName="InlongGroupEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="inlong_group_ext" domainObjectName="InlongGroupExtEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="data_schema" domainObjectName="DataSchemaEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="data_proxy_cluster" domainObjectName="DataProxyClusterEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="third_party_cluster" domainObjectName="ThirdPartyClusterEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="inlong_stream" domainObjectName="InlongStreamEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="inlong_stream_field" domainObjectName="InlongStreamFieldEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="source_file_basic" domainObjectName="SourceFileBasicEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="source_file_detail" domainObjectName="SourceFileDetailEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="stream_source" domainObjectName="StreamSourceEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="stream_sink" domainObjectName="StreamSinkEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="stream_sink_ext" domainObjectName="StreamSinkExtEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="stream_sink_field" domainObjectName="StreamSinkFieldEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="common_file_server" domainObjectName="CommonFileServerEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="common_db_server" domainObjectName="CommonDbServerEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="consumption" domainObjectName="ConsumptionEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
+ <table tableName="inlong_cluster_node" domainObjectName="InlongClusterNodeEntity"
+ enableInsert="true" enableSelectByPrimaryKey="true"
+ enableUpdateByPrimaryKey="true" enableDeleteByPrimaryKey="true"
enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="sort_cluster_config" domainObjectName="SortClusterConfigEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="sort_id_params" domainObjectName="SortIdParamsEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="sort_task_id_param" domainObjectName="SortTaskIdParamEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="sort_task_sink_param" domainObjectName="SortTaskSinkParamEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="stream_config_log" domainObjectName="StreamConfigLogEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
-
- <table tableName="sort_source_config" domainObjectName="SortSourceConfigEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>-->
- <table tableName="component_heartbeat" domainObjectName="ComponentHeartbeatEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
- <table tableName="group_heartbeat" domainObjectName="GroupHeartbeatEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
- <table tableName="stream_heartbeat" domainObjectName="StreamHeartbeatEntity"
- enableSelectByPrimaryKey="true"
- enableUpdateByPrimaryKey="true"
- enableDeleteByPrimaryKey="true" enableInsert="true"
- enableCountByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" enableUpdateByExample="false"/>
+ enableSelectByExample="false" enableUpdateByExample="false">
+ </table>
</context>
</generatorConfiguration>
diff --git a/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterEntityMapper.xml b/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterEntityMapper.xml
new file mode 100644
index 000000000..2eb887761
--- /dev/null
+++ b/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterEntityMapper.xml
@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.apache.inlong.manager.dao.mapper.InlongClusterEntityMapper">
+ <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.InlongClusterEntity">
+ <id column="id" jdbcType="INTEGER" property="id"/>
+ <result column="name" jdbcType="VARCHAR" property="name"/>
+ <result column="type" jdbcType="VARCHAR" property="type"/>
+ <result column="url" jdbcType="VARCHAR" property="url"/>
+ <result column="cluster_tag" jdbcType="VARCHAR" property="clusterTag"/>
+ <result column="zone_tag" jdbcType="VARCHAR" property="zoneTag"/>
+ <result column="ext_params" jdbcType="LONGVARCHAR" property="extParams"/>
+ <result column="heartbeat" jdbcType="LONGVARCHAR" property="heartbeat"/>
+ <result column="in_charges" jdbcType="VARCHAR" property="inCharges"/>
+ <result column="status" jdbcType="INTEGER" property="status"/>
+ <result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
+ <result column="creator" jdbcType="VARCHAR" property="creator"/>
+ <result column="modifier" jdbcType="VARCHAR" property="modifier"/>
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+ <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
+ </resultMap>
+ <sql id="Base_Column_List">
+ id, name, type, url, cluster_tag, zone_tag, ext_params, heartbeat, in_charges,
+ status, is_deleted, creator, modifier, create_time, modify_time
+ </sql>
+
+ <insert id="insert" parameterType="org.apache.inlong.manager.dao.entity.InlongClusterEntity">
+ insert into inlong_cluster (id, name, type,
+ url, cluster_tag, zone_tag,
+ ext_params, heartbeat, in_charges,
+ status, is_deleted, creator,
+ modifier, create_time, modify_time)
+ values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
+ #{url,jdbcType=VARCHAR}, #{clusterTag,jdbcType=VARCHAR}, #{zoneTag,jdbcType=VARCHAR},
+ #{extParams,jdbcType=LONGVARCHAR}, #{heartbeat,jdbcType=LONGVARCHAR}, #{inCharges,jdbcType=VARCHAR},
+ #{status,jdbcType=INTEGER}, #{isDeleted,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR},
+ #{modifier,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP})
+ </insert>
+ <insert id="insertSelective" parameterType="org.apache.inlong.manager.dao.entity.InlongClusterEntity">
+ insert into inlong_cluster
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ id,
+ </if>
+ <if test="name != null">
+ name,
+ </if>
+ <if test="type != null">
+ type,
+ </if>
+ <if test="url != null">
+ url,
+ </if>
+ <if test="clusterTag != null">
+ cluster_tag,
+ </if>
+ <if test="zoneTag != null">
+ zone_tag,
+ </if>
+ <if test="inCharges != null">
+ in_charges,
+ </if>
+ <if test="status != null">
+ status,
+ </if>
+ <if test="isDeleted != null">
+ is_deleted,
+ </if>
+ <if test="creator != null">
+ creator,
+ </if>
+ <if test="modifier != null">
+ modifier,
+ </if>
+ <if test="createTime != null">
+ create_time,
+ </if>
+ <if test="modifyTime != null">
+ modify_time,
+ </if>
+ <if test="extParams != null">
+ ext_params,
+ </if>
+ <if test="heartbeat != null">
+ heartbeat,
+ </if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ #{id,jdbcType=INTEGER},
+ </if>
+ <if test="name != null">
+ #{name,jdbcType=VARCHAR},
+ </if>
+ <if test="type != null">
+ #{type,jdbcType=VARCHAR},
+ </if>
+ <if test="url != null">
+ #{url,jdbcType=VARCHAR},
+ </if>
+ <if test="clusterTag != null">
+ #{clusterTag,jdbcType=VARCHAR},
+ </if>
+ <if test="zoneTag != null">
+ #{zoneTag,jdbcType=VARCHAR},
+ </if>
+ <if test="inCharges != null">
+ #{inCharges,jdbcType=VARCHAR},
+ </if>
+ <if test="status != null">
+ #{status,jdbcType=INTEGER},
+ </if>
+ <if test="isDeleted != null">
+ #{isDeleted,jdbcType=INTEGER},
+ </if>
+ <if test="creator != null">
+ #{creator,jdbcType=VARCHAR},
+ </if>
+ <if test="modifier != null">
+ #{modifier,jdbcType=VARCHAR},
+ </if>
+ <if test="createTime != null">
+ #{createTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="modifyTime != null">
+ #{modifyTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="extParams != null">
+ #{extParams,jdbcType=LONGVARCHAR},
+ </if>
+ <if test="heartbeat != null">
+ #{heartbeat,jdbcType=LONGVARCHAR},
+ </if>
+ </trim>
+ </insert>
+
+ <select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+ select
+ <include refid="Base_Column_List"/>
+ from inlong_cluster
+ where id = #{id,jdbcType=INTEGER}
+ </select>
+
+ <update id="updateById" parameterType="org.apache.inlong.manager.dao.entity.InlongClusterEntity">
+ update inlong_cluster
+ set name = #{name,jdbcType=VARCHAR},
+ type = #{type,jdbcType=VARCHAR},
+ url = #{url,jdbcType=VARCHAR},
+ cluster_tag = #{clusterTag,jdbcType=VARCHAR},
+ zone_tag = #{zoneTag,jdbcType=VARCHAR},
+ ext_params = #{extParams,jdbcType=LONGVARCHAR},
+ heartbeat = #{heartbeat,jdbcType=LONGVARCHAR},
+ in_charges = #{inCharges,jdbcType=VARCHAR},
+ status = #{status,jdbcType=INTEGER},
+ is_deleted = #{isDeleted,jdbcType=INTEGER},
+ creator = #{creator,jdbcType=VARCHAR},
+ modifier = #{modifier,jdbcType=VARCHAR},
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+ modify_time = #{modifyTime,jdbcType=TIMESTAMP}
+ where id = #{id,jdbcType=INTEGER}
+ </update>
+ <update id="updateByIdSelective" parameterType="org.apache.inlong.manager.dao.entity.InlongClusterEntity">
+ update inlong_cluster
+ <set>
+ <if test="name != null">
+ name = #{name,jdbcType=VARCHAR},
+ </if>
+ <if test="type != null">
+ type = #{type,jdbcType=VARCHAR},
+ </if>
+ <if test="url != null">
+ url = #{url,jdbcType=VARCHAR},
+ </if>
+ <if test="clusterTag != null">
+ cluster_tag = #{clusterTag,jdbcType=VARCHAR},
+ </if>
+ <if test="zoneTag != null">
+ zone_tag = #{zoneTag,jdbcType=VARCHAR},
+ </if>
+ <if test="extParams != null">
+ ext_params = #{extParams,jdbcType=LONGVARCHAR},
+ </if>
+ <if test="heartbeat != null">
+ heartbeat = #{heartbeat,jdbcType=LONGVARCHAR},
+ </if>
+ <if test="inCharges != null">
+ in_charges = #{inCharges,jdbcType=VARCHAR},
+ </if>
+ <if test="status != null">
+ status = #{status,jdbcType=INTEGER},
+ </if>
+ <if test="isDeleted != null">
+ is_deleted = #{isDeleted,jdbcType=INTEGER},
+ </if>
+ <if test="creator != null">
+ creator = #{creator,jdbcType=VARCHAR},
+ </if>
+ <if test="modifier != null">
+ modifier = #{modifier,jdbcType=VARCHAR},
+ </if>
+ <if test="createTime != null">
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="modifyTime != null">
+ modify_time = #{modifyTime,jdbcType=TIMESTAMP},
+ </if>
+ </set>
+ where id = #{id,jdbcType=INTEGER}
+ </update>
+
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+ delete
+ from inlong_cluster
+ where id = #{id,jdbcType=INTEGER}
+ </delete>
+</mapper>
\ No newline at end of file
diff --git a/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterNodeEntityMapper.xml b/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterNodeEntityMapper.xml
new file mode 100644
index 000000000..836031fd2
--- /dev/null
+++ b/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterNodeEntityMapper.xml
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.apache.inlong.manager.dao.mapper.InlongClusterNodeEntityMapper">
+ <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity">
+ <id column="id" jdbcType="INTEGER" property="id"/>
+ <result column="parent_id" jdbcType="INTEGER" property="parentId"/>
+ <result column="type" jdbcType="VARCHAR" property="type"/>
+ <result column="ip" jdbcType="VARCHAR" property="ip"/>
+ <result column="port" jdbcType="INTEGER" property="port"/>
+ <result column="ext_params" jdbcType="LONGVARCHAR" property="extParams"/>
+ <result column="status" jdbcType="INTEGER" property="status"/>
+ <result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
+ <result column="creator" jdbcType="VARCHAR" property="creator"/>
+ <result column="modifier" jdbcType="VARCHAR" property="modifier"/>
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+ <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
+ </resultMap>
+ <sql id="Base_Column_List">
+ id, parent_id, type, ip, port, ext_params, status, is_deleted, creator, modifier,
+ create_time, modify_time
+ </sql>
+
+ <insert id="insert" useGeneratedKeys="true" keyProperty="id"
+ parameterType="org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity">
+ insert into inlong_cluster_node (id, parent_id, type,
+ ip, port, ext_params,
+ status, is_deleted, creator,
+ modifier, create_time, modify_time)
+ values (#{id,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR},
+ #{ip,jdbcType=VARCHAR}, #{port,jdbcType=INTEGER}, #{extParams,jdbcType=LONGVARCHAR},
+ #{status,jdbcType=INTEGER}, #{isDeleted,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR},
+ #{modifier,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP})
+ </insert>
+ <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"
+ parameterType="org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity">
+ insert into inlong_cluster_node
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ id,
+ </if>
+ <if test="parentId != null">
+ parent_id,
+ </if>
+ <if test="type != null">
+ type,
+ </if>
+ <if test="ip != null">
+ ip,
+ </if>
+ <if test="port != null">
+ port,
+ </if>
+ <if test="extParams != null">
+ ext_params,
+ </if>
+ <if test="status != null">
+ status,
+ </if>
+ <if test="isDeleted != null">
+ is_deleted,
+ </if>
+ <if test="creator != null">
+ creator,
+ </if>
+ <if test="modifier != null">
+ modifier,
+ </if>
+ <if test="createTime != null">
+ create_time,
+ </if>
+ <if test="modifyTime != null">
+ modify_time,
+ </if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ #{id,jdbcType=INTEGER},
+ </if>
+ <if test="parentId != null">
+ #{parentId,jdbcType=INTEGER},
+ </if>
+ <if test="type != null">
+ #{type,jdbcType=VARCHAR},
+ </if>
+ <if test="ip != null">
+ #{ip,jdbcType=VARCHAR},
+ </if>
+ <if test="port != null">
+ #{port,jdbcType=INTEGER},
+ </if>
+ <if test="extParams != null">
+ #{extParams,jdbcType=LONGVARCHAR},
+ </if>
+ <if test="status != null">
+ #{status,jdbcType=INTEGER},
+ </if>
+ <if test="isDeleted != null">
+ #{isDeleted,jdbcType=INTEGER},
+ </if>
+ <if test="creator != null">
+ #{creator,jdbcType=VARCHAR},
+ </if>
+ <if test="modifier != null">
+ #{modifier,jdbcType=VARCHAR},
+ </if>
+ <if test="createTime != null">
+ #{createTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="modifyTime != null">
+ #{modifyTime,jdbcType=TIMESTAMP},
+ </if>
+ </trim>
+ </insert>
+
+ <select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+ select
+ <include refid="Base_Column_List"/>
+ from inlong_cluster_node
+ where id = #{id,jdbcType=INTEGER}
+ </select>
+
+ <update id="updateByIdSelective"
+ parameterType="org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity">
+ update inlong_cluster_node
+ <set>
+ <if test="parentId != null">
+ parent_id = #{parentId,jdbcType=INTEGER},
+ </if>
+ <if test="type != null">
+ type = #{type,jdbcType=VARCHAR},
+ </if>
+ <if test="ip != null">
+ ip = #{ip,jdbcType=VARCHAR},
+ </if>
+ <if test="port != null">
+ port = #{port,jdbcType=INTEGER},
+ </if>
+ <if test="status != null">
+ status = #{status,jdbcType=INTEGER},
+ </if>
+ <if test="isDeleted != null">
+ is_deleted = #{isDeleted,jdbcType=INTEGER},
+ </if>
+ <if test="creator != null">
+ creator = #{creator,jdbcType=VARCHAR},
+ </if>
+ <if test="modifier != null">
+ modifier = #{modifier,jdbcType=VARCHAR},
+ </if>
+ <if test="createTime != null">
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="modifyTime != null">
+ modify_time = #{modifyTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="extParams != null">
+ ext_params = #{extParams,jdbcType=LONGVARCHAR},
+ </if>
+ </set>
+ where id = #{id,jdbcType=INTEGER}
+ </update>
+ <update id="updateById" parameterType="org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity">
+ update inlong_cluster_node
+ set parent_id = #{parentId,jdbcType=INTEGER},
+ type = #{type,jdbcType=VARCHAR},
+ ip = #{ip,jdbcType=VARCHAR},
+ port = #{port,jdbcType=INTEGER},
+ ext_params = #{extParams,jdbcType=LONGVARCHAR},
+ status = #{status,jdbcType=INTEGER},
+ is_deleted = #{isDeleted,jdbcType=INTEGER},
+ creator = #{creator,jdbcType=VARCHAR},
+ modifier = #{modifier,jdbcType=VARCHAR},
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+ modify_time = #{modifyTime,jdbcType=TIMESTAMP}
+ where id = #{id,jdbcType=INTEGER}
+ </update>
+
+ <delete id="deleteById" parameterType="java.lang.Integer">
+ delete
+ from inlong_cluster_node
+ where id = #{id,jdbcType=INTEGER}
+ </delete>
+</mapper>
\ No newline at end of file
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/InlongClusterService.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/InlongClusterService.java
new file mode 100644
index 000000000..85c2a94ec
--- /dev/null
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/InlongClusterService.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.service.core;
+
+import com.github.pagehelper.PageInfo;
+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.InlongClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.InlongClusterResponse;
+
+/**
+ * Inlong cluster service layer interface
+ */
+public interface InlongClusterService {
+
+ /**
+ * Save cluster info.
+ *
+ * @param request inlong cluster info
+ * @param operator name of operator
+ * @return cluster id after saving
+ */
+ Integer save(InlongClusterRequest request, String operator);
+
+ /**
+ * Get cluster info by id.
+ *
+ * @param id cluster id
+ * @return cluster info
+ */
+ InlongClusterResponse get(Integer id);
+
+ /**
+ * Paging query clusters according to conditions.
+ *
+ * @param request page request conditions
+ * @return cluster list
+ */
+ PageInfo<InlongClusterResponse> list(InlongClusterPageRequest request);
+
+ /**
+ * Update cluster information
+ *
+ * @param request cluster info to be modified
+ * @param operator current operator
+ * @return whether succeed
+ */
+ Boolean update(InlongClusterRequest request, String operator);
+
+ /**
+ * Delete cluster information.
+ *
+ * @param id cluster id to be deleted
+ * @param operator current operator
+ * @return whether succeed
+ */
+ Boolean delete(Integer id, String operator);
+
+ /**
+ * Save cluster node info.
+ *
+ * @param request inlong cluster info
+ * @param operator name of operator
+ * @return cluster id after saving
+ */
+ Integer saveNode(InlongClusterRequest request, String operator);
+
+ /**
+ * Get cluster node info by id.
+ *
+ * @param id cluster id
+ * @return cluster info
+ */
+ ClusterNodeResponse getNode(Integer id);
+
+ /**
+ * Paging query cluster nodes according to conditions.
+ *
+ * @param request page request conditions
+ * @return cluster node list
+ */
+ PageInfo<ClusterNodeResponse> listNode(InlongClusterPageRequest request);
+
+ /**
+ * Update cluster node.
+ *
+ * @param request cluster node to be modified
+ * @param operator current operator
+ * @return whether succeed
+ */
+ Boolean updateNode(ClusterNodeRequest request, String operator);
+
+ /**
+ * Delete cluster node.
+ *
+ * @param id cluster node id to be deleted
+ * @param operator current operator
+ * @return whether succeed
+ */
+ Boolean deleteNode(Integer id, String operator);
+
+}
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/ThirdPartyClusterService.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/ThirdPartyClusterService.java
index 9fea409b6..b2d9d5071 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/ThirdPartyClusterService.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/ThirdPartyClusterService.java
@@ -30,6 +30,7 @@ import java.util.List;
/**
* The third party cluster (such as kafka) information service layer interface
*/
+@Deprecated
public interface ThirdPartyClusterService {
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/InlongClusterServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/InlongClusterServiceImpl.java
new file mode 100644
index 000000000..51e65ecfa
--- /dev/null
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/InlongClusterServiceImpl.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.service.core.impl;
+
+import com.github.pagehelper.PageInfo;
+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.InlongClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.InlongClusterResponse;
+import org.apache.inlong.manager.dao.mapper.InlongClusterEntityMapper;
+import org.apache.inlong.manager.dao.mapper.InlongClusterNodeEntityMapper;
+import org.apache.inlong.manager.service.core.InlongClusterService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * Inlong cluster service layer implementation
+ */
+@Service
+public class InlongClusterServiceImpl implements InlongClusterService {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(InlongClusterServiceImpl.class);
+
+ @Autowired
+ private InlongClusterEntityMapper clusterMapper;
+ @Autowired
+ private InlongClusterNodeEntityMapper clusterNodeMapper;
+
+ @Override
+ public Integer save(InlongClusterRequest request, String operator) {
+ return null;
+ }
+
+ @Override
+ public InlongClusterResponse get(Integer id) {
+ return null;
+ }
+
+ @Override
+ public PageInfo<InlongClusterResponse> list(InlongClusterPageRequest request) {
+ return null;
+ }
+
+ @Override
+ public Boolean update(InlongClusterRequest request, String operator) {
+ return null;
+ }
+
+ @Override
+ public Boolean delete(Integer id, String operator) {
+ return null;
+ }
+
+ @Override
+ public Integer saveNode(InlongClusterRequest request, String operator) {
+ return null;
+ }
+
+ @Override
+ public ClusterNodeResponse getNode(Integer id) {
+ return null;
+ }
+
+ @Override
+ public PageInfo<ClusterNodeResponse> listNode(InlongClusterPageRequest request) {
+ return null;
+ }
+
+ @Override
+ public Boolean updateNode(ClusterNodeRequest request, String operator) {
+ return null;
+ }
+
+ @Override
+ public Boolean deleteNode(Integer id, String operator) {
+ return null;
+ }
+}
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ThirdPartyClusterServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ThirdPartyClusterServiceImpl.java
index 095dd0f45..1b581d14b 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ThirdPartyClusterServiceImpl.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/ThirdPartyClusterServiceImpl.java
@@ -65,6 +65,7 @@ import java.util.Map;
/**
* Implementation of cluster service
*/
+@Deprecated
@Service
public class ThirdPartyClusterServiceImpl implements ThirdPartyClusterService {
diff --git a/inlong-manager/manager-test/src/main/resources/sql/apache_inlong_manager.sql b/inlong-manager/manager-test/src/main/resources/sql/apache_inlong_manager.sql
index 63ccca42b..3eb4d1de1 100644
--- a/inlong-manager/manager-test/src/main/resources/sql/apache_inlong_manager.sql
+++ b/inlong-manager/manager-test/src/main/resources/sql/apache_inlong_manager.sql
@@ -95,6 +95,53 @@ CREATE TABLE `inlong_group_ext`
UNIQUE KEY `unique_inlong_group_key` (`inlong_group_id`, `key_name`)
);
+-- ----------------------------
+-- Table structure for inlong_cluster
+-- ----------------------------
+DROP TABLE IF EXISTS `inlong_cluster`;
+CREATE TABLE `inlong_cluster`
+(
+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Incremental primary key',
+ `name` varchar(128) NOT NULL COMMENT 'Cluster name',
+ `type` varchar(20) DEFAULT '' COMMENT 'Cluster type, such as: TUBE, PULSAR, DATA_PROXY, etc',
+ `url` varchar(512) DEFAULT NULL COMMENT 'Cluster URL',
+ `cluster_tag` varchar(128) DEFAULT NULL COMMENT 'Cluster tag, the same tab indicates that cluster belongs to the same set',
+ `zone_tag` varchar(128) DEFAULT NULL COMMENT 'Cluster zone tag',
+ `ext_params` text DEFAULT NULL COMMENT 'Extended params, will saved as JSON string',
+ `heartbeat` text DEFAULT NULL COMMENT 'Cluster heartbeat info',
+ `in_charges` varchar(512) NOT NULL COMMENT 'Name of responsible person, separated by commas',
+ `status` int(4) DEFAULT '0' COMMENT 'Cluster status',
+ `is_deleted` int(11) DEFAULT '0' COMMENT 'Whether to delete, 0: not deleted, > 0: deleted',
+ `creator` varchar(64) NOT NULL COMMENT 'Creator name',
+ `modifier` varchar(64) DEFAULT NULL COMMENT 'Modifier name',
+ `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create time',
+ `modify_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_cluster_index` (`name`, `type`, `cluster_tag`, `is_deleted`)
+);
+
+-- ----------------------------
+-- Table structure for inlong_cluster_node
+-- ----------------------------
+DROP TABLE IF EXISTS `inlong_cluster_node`;
+CREATE TABLE `inlong_cluster_node`
+(
+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Incremental primary key',
+ `parent_id` int(11) NOT NULL COMMENT 'Id of the parent cluster',
+ `type` varchar(20) DEFAULT '' COMMENT 'Cluster type, such as: DATA_PROXY, AGENT, etc',
+ `ip` varchar(512) NULL COMMENT 'Cluster IP, separated by commas, such as: 127.0.0.1:8080,host2:8081',
+ `port` int(6) NULL COMMENT 'Cluster port',
+ `ext_params` text DEFAULT NULL COMMENT 'Another fields will saved as JSON string',
+ `status` int(4) DEFAULT '0' COMMENT 'Cluster status',
+ `is_deleted` int(11) DEFAULT '0' COMMENT 'Whether to delete, 0: not deleted, > 0: deleted',
+ `creator` varchar(64) NOT NULL COMMENT 'Creator name',
+ `modifier` varchar(64) DEFAULT NULL COMMENT 'Modifier name',
+ `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create time',
+ `modify_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_cluster_node` (`cluster_name`, `type`, `ip`, `port`, `is_deleted`)
+);
+
-- ----------------------------
-- Table structure for third_party_cluster
-- ----------------------------
diff --git a/inlong-manager/manager-web/sql/apache_inlong_manager.sql b/inlong-manager/manager-web/sql/apache_inlong_manager.sql
index f99f2bc87..7d652572a 100644
--- a/inlong-manager/manager-web/sql/apache_inlong_manager.sql
+++ b/inlong-manager/manager-web/sql/apache_inlong_manager.sql
@@ -104,6 +104,55 @@ CREATE TABLE `inlong_group_ext`
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='Inlong group extension table';
+-- ----------------------------
+-- Table structure for inlong_cluster
+-- ----------------------------
+DROP TABLE IF EXISTS `inlong_cluster`;
+CREATE TABLE `inlong_cluster`
+(
+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Incremental primary key',
+ `name` varchar(128) NOT NULL COMMENT 'Cluster name',
+ `type` varchar(20) DEFAULT '' COMMENT 'Cluster type, such as: TUBE, PULSAR, DATA_PROXY, etc',
+ `url` varchar(512) DEFAULT NULL COMMENT 'Cluster URL',
+ `cluster_tag` varchar(128) DEFAULT NULL COMMENT 'Cluster tag, the same tab indicates that cluster belongs to the same set',
+ `zone_tag` varchar(128) DEFAULT NULL COMMENT 'Cluster zone tag',
+ `ext_params` text DEFAULT NULL COMMENT 'Extended params, will saved as JSON string',
+ `heartbeat` text DEFAULT NULL COMMENT 'Cluster heartbeat info',
+ `in_charges` varchar(512) NOT NULL COMMENT 'Name of responsible person, separated by commas',
+ `status` int(4) DEFAULT '0' COMMENT 'Cluster status',
+ `is_deleted` int(11) DEFAULT '0' COMMENT 'Whether to delete, 0: not deleted, > 0: deleted',
+ `creator` varchar(64) NOT NULL COMMENT 'Creator name',
+ `modifier` varchar(64) DEFAULT NULL COMMENT 'Modifier name',
+ `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create time',
+ `modify_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_cluster_index` (`name`, `type`, `cluster_tag`, `is_deleted`)
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4 COMMENT ='Inlong cluster table';
+
+-- ----------------------------
+-- Table structure for inlong_cluster_node
+-- ----------------------------
+DROP TABLE IF EXISTS `inlong_cluster_node`;
+CREATE TABLE `inlong_cluster_node`
+(
+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Incremental primary key',
+ `parent_id` int(11) NOT NULL COMMENT 'Id of the parent cluster',
+ `type` varchar(20) DEFAULT '' COMMENT 'Cluster type, such as: DATA_PROXY, AGENT, etc',
+ `ip` varchar(512) NULL COMMENT 'Cluster IP, separated by commas, such as: 127.0.0.1:8080,host2:8081',
+ `port` int(6) NULL COMMENT 'Cluster port',
+ `ext_params` text DEFAULT NULL COMMENT 'Another fields will saved as JSON string',
+ `status` int(4) DEFAULT '0' COMMENT 'Cluster status',
+ `is_deleted` int(11) DEFAULT '0' COMMENT 'Whether to delete, 0: not deleted, > 0: deleted',
+ `creator` varchar(64) NOT NULL COMMENT 'Creator name',
+ `modifier` varchar(64) DEFAULT NULL COMMENT 'Modifier name',
+ `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create time',
+ `modify_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `unique_cluster_node` (`cluster_name`, `type`, `ip`, `port`, `is_deleted`)
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4 COMMENT ='Inlong cluster node table';
+
-- ----------------------------
-- Table structure for third_party_cluster
-- ----------------------------
diff --git a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/ClusterController.java b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/InlongClusterController.java
similarity index 51%
rename from inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/ClusterController.java
rename to inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/InlongClusterController.java
index c0053267d..5fce4b31d 100644
--- a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/ClusterController.java
+++ b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/InlongClusterController.java
@@ -23,12 +23,14 @@ 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.ClusterPageRequest;
-import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
-import org.apache.inlong.manager.common.pojo.cluster.ClusterResponse;
+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.InlongClusterPageRequest;
+import org.apache.inlong.manager.common.pojo.cluster.InlongClusterRequest;
+import org.apache.inlong.manager.common.pojo.cluster.InlongClusterResponse;
import org.apache.inlong.manager.common.pojo.user.UserRoleCode;
import org.apache.inlong.manager.common.util.LoginUserUtils;
-import org.apache.inlong.manager.service.core.ThirdPartyClusterService;
+import org.apache.inlong.manager.service.core.InlongClusterService;
import org.apache.inlong.manager.service.core.operationlog.OperationLog;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,95 +44,95 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
- * Cluster controller
+ * Inlong cluster controller
*/
@RestController
@RequestMapping("/cluster")
-@Api(tags = "Cluster Config")
-public class ClusterController {
+@Api(tags = "Inlong-Cluster-API")
+public class InlongClusterController {
@Autowired
- private ThirdPartyClusterService thirdPartyClusterService;
+ private InlongClusterService clusterService;
@PostMapping(value = "/save")
- @ApiOperation(value = "Save cluster info")
+ @ApiOperation(value = "Save cluster")
@OperationLog(operation = OperationType.CREATE)
@RequiresRoles(value = UserRoleCode.ADMIN)
- public Response<Integer> save(@RequestBody ClusterRequest request) {
+ public Response<Integer> save(@RequestBody InlongClusterRequest request) {
String currentUser = LoginUserUtils.getLoginUserDetail().getUserName();
- return Response.success(thirdPartyClusterService.save(request, currentUser));
+ return Response.success(clusterService.save(request, currentUser));
}
@GetMapping(value = "/get/{id}")
- @ApiOperation(value = "Get cluster info by id")
- @ApiImplicitParam(name = "id", value = "common cluster ID", dataTypeClass = Integer.class, required = true)
- public Response<ClusterResponse> get(@PathVariable Integer id) {
- return Response.success(thirdPartyClusterService.get(id));
+ @ApiOperation(value = "Get cluster by id")
+ @ApiImplicitParam(name = "id", value = "Cluster ID", dataTypeClass = Integer.class, required = true)
+ public Response<InlongClusterResponse> get(@PathVariable Integer id) {
+ return Response.success(clusterService.get(id));
}
@PostMapping(value = "/list")
- @ApiOperation(value = "Get clusters by paginating")
- public Response<PageInfo<ClusterResponse>> list(@RequestBody ClusterPageRequest request) {
- return Response.success(thirdPartyClusterService.list(request));
+ @ApiOperation(value = "List clusters by paginating")
+ public Response<PageInfo<InlongClusterResponse>> list(@RequestBody InlongClusterPageRequest request) {
+ return Response.success(clusterService.list(request));
}
@PostMapping(value = "/update")
@OperationLog(operation = OperationType.UPDATE)
- @ApiOperation(value = "Update cluster info")
- public Response<Boolean> update(@RequestBody ClusterRequest request) {
+ @ApiOperation(value = "Update cluster")
+ public Response<Boolean> update(@RequestBody InlongClusterRequest request) {
String username = LoginUserUtils.getLoginUserDetail().getUserName();
- return Response.success(thirdPartyClusterService.update(request, username));
+ return Response.success(clusterService.update(request, username));
}
@DeleteMapping(value = "/delete/{id}")
- @ApiOperation(value = "Delete cluster info by id")
+ @ApiOperation(value = "Delete cluster by id")
@OperationLog(operation = OperationType.DELETE)
@ApiImplicitParam(name = "id", value = "Cluster ID", dataTypeClass = Integer.class, required = true)
@RequiresRoles(value = UserRoleCode.ADMIN)
public Response<Boolean> delete(@PathVariable Integer id) {
- return Response.success(thirdPartyClusterService.delete(id, LoginUserUtils.getLoginUserDetail().getUserName()));
+ return Response.success(clusterService.delete(id, LoginUserUtils.getLoginUserDetail().getUserName()));
}
@Deprecated
- @PostMapping(value = "/thirdparty/save")
- @ApiOperation(value = "Add a cluster info")
+ @PostMapping(value = "/node/save")
+ @ApiOperation(value = "Save cluster node")
@OperationLog(operation = OperationType.CREATE)
- public Response<Integer> saveClusterV1(@RequestBody ClusterRequest request) {
+ public Response<Integer> saveNode(@RequestBody InlongClusterRequest request) {
String currentUser = LoginUserUtils.getLoginUserDetail().getUserName();
- return Response.success(thirdPartyClusterService.save(request, currentUser));
+ return Response.success(clusterService.saveNode(request, currentUser));
}
@Deprecated
- @GetMapping(value = "/thirdparty/get/{id}")
- @ApiOperation(value = "Query third party cluster information of the common")
- @ApiImplicitParam(name = "id", value = "common cluster ID", dataTypeClass = Integer.class, required = true)
- public Response<ClusterResponse> getClusterV1(@PathVariable Integer id) {
- return Response.success(thirdPartyClusterService.get(id));
+ @GetMapping(value = "/node/get/{id}")
+ @ApiOperation(value = "Get cluster node by id")
+ @ApiImplicitParam(name = "id", value = "Cluster node ID", dataTypeClass = Integer.class, required = true)
+ public Response<ClusterNodeResponse> getNode(@PathVariable Integer id) {
+ return Response.success(clusterService.getNode(id));
}
@Deprecated
- @PostMapping(value = "/thirdparty/list")
- @ApiOperation(value = "Query the list of general clusters based on conditions")
- public Response<PageInfo<ClusterResponse>> listV1(@RequestBody ClusterPageRequest request) {
- return Response.success(thirdPartyClusterService.list(request));
+ @PostMapping(value = "/node/list")
+ @ApiOperation(value = "List cluster nodes by paginating")
+ public Response<PageInfo<ClusterNodeResponse>> listNode(@RequestBody InlongClusterPageRequest request) {
+ return Response.success(clusterService.listNode(request));
}
@Deprecated
- @RequestMapping(value = "/thirdparty/update", method = RequestMethod.POST)
+ @RequestMapping(value = "/node/update", method = RequestMethod.POST)
@OperationLog(operation = OperationType.UPDATE)
- @ApiOperation(value = "Modify third party cluster information of the common")
- public Response<Boolean> updateClusterV1(@RequestBody ClusterRequest request) {
+ @ApiOperation(value = "Update cluster node")
+ public Response<Boolean> updateNode(@RequestBody ClusterNodeRequest request) {
String username = LoginUserUtils.getLoginUserDetail().getUserName();
- return Response.success(thirdPartyClusterService.update(request, username));
+ return Response.success(clusterService.updateNode(request, username));
}
@Deprecated
- @RequestMapping(value = "/thirdparty/delete/{id}", method = RequestMethod.DELETE)
- @ApiOperation(value = "Delete third party cluster information")
+ @RequestMapping(value = "/node/delete/{id}", method = RequestMethod.DELETE)
+ @ApiOperation(value = "Delete cluster node")
@OperationLog(operation = OperationType.DELETE)
@ApiImplicitParam(name = "id", value = "DataProxy cluster id", dataTypeClass = Integer.class, required = true)
- public Response<Boolean> deleteV1(@PathVariable Integer id) {
- return Response.success(thirdPartyClusterService.delete(id, LoginUserUtils.getLoginUserDetail().getUserName()));
+ public Response<Boolean> deleteNode(@PathVariable Integer id) {
+ return Response.success(clusterService.deleteNode(id, LoginUserUtils.getLoginUserDetail().getUserName()));
}
}