This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new f612cf437 [INLONG-7406][Manager] Add the query criteria for
streamSource (#7407)
f612cf437 is described below
commit f612cf437f5c3b71a2d3960ceeeeb04c66aa5039
Author: fuweng11 <[email protected]>
AuthorDate: Wed Feb 22 17:34:42 2023 +0800
[INLONG-7406][Manager] Add the query criteria for streamSource (#7407)
---
.../manager/dao/mapper/InlongClusterNodeEntityMapper.java | 2 ++
.../main/resources/mappers/InlongClusterNodeEntityMapper.xml | 11 ++++++++++-
.../src/main/resources/mappers/StreamSourceEntityMapper.xml | 10 +++++++++-
.../apache/inlong/manager/pojo/source/SourcePageRequest.java | 6 ++++++
4 files changed, 27 insertions(+), 2 deletions(-)
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 83d2108a3..2c7537577 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
@@ -41,6 +41,8 @@ public interface InlongClusterNodeEntityMapper {
List<InlongClusterNodeEntity> selectByParentId(@Param("parentId") Integer
parentId,
@Param("protocolType") String protocolType);
+ List<InlongClusterNodeEntity> selectByIpAndType(@Param("ip") String ip,
@Param("type") String type);
+
int updateById(InlongClusterNodeEntity record);
int updateByIdSelective(InlongClusterNodeEntity record);
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 b65afebc5..d080dc6bc 100644
---
a/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterNodeEntityMapper.xml
+++
b/inlong-manager/manager-dao/src/main/resources/mappers/InlongClusterNodeEntityMapper.xml
@@ -132,7 +132,16 @@
</if>
</where>
</select>
-
+ <select id="selectByIpAndType"
resultType="org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity">
+ select
+ <include refid="Base_Column_List"/>
+ from inlong_cluster_node
+ where is_deleted = 0
+ <if test="type != null and type != ''">
+ and type = #{type, jdbcType=VARCHAR}
+ </if>
+ and ip = #{ip, jdbcType=VARCHAR}
+ </select>
<update id="updateById"
parameterType="org.apache.inlong.manager.dao.entity.InlongClusterNodeEntity">
update inlong_cluster_node
set parent_id = #{parentId,jdbcType=INTEGER},
diff --git
a/inlong-manager/manager-dao/src/main/resources/mappers/StreamSourceEntityMapper.xml
b/inlong-manager/manager-dao/src/main/resources/mappers/StreamSourceEntityMapper.xml
index 2858e986a..57860b97a 100644
---
a/inlong-manager/manager-dao/src/main/resources/mappers/StreamSourceEntityMapper.xml
+++
b/inlong-manager/manager-dao/src/main/resources/mappers/StreamSourceEntityMapper.xml
@@ -118,13 +118,21 @@
from stream_source
<where>
is_deleted = 0
- and inlong_group_id = #{request.inlongGroupId, jdbcType=VARCHAR}
+ <if test="request.inlongGroupId != null and request.inlongGroupId
!= ''">
+ and inlong_group_id = #{request.inlongGroupId,
jdbcType=VARCHAR}
+ </if>
<if test="request.inlongStreamId != null and
request.inlongStreamId != ''">
and inlong_stream_id = #{request.inlongStreamId,
jdbcType=VARCHAR}
</if>
<if test="request.sourceType != null and request.sourceType != ''">
and source_type = #{request.sourceType, jdbcType=VARCHAR}
</if>
+ <if test="request.dataNodeName != null and request.dataNodeName !=
''">
+ and data_node_name = #{request.dataNodeName, jdbcType=VARCHAR}
+ </if>
+ <if test="request.inlongClusterName != null and
request.inlongClusterName != ''">
+ and inlong_cluster_name = #{request.inlongClusterName,
jdbcType=VARCHAR}
+ </if>
<if test="request.keyword != null and request.keyword != ''">
and (
inlong_group_id like CONCAT('%', #{request.keyword}, '%')
diff --git
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/SourcePageRequest.java
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/SourcePageRequest.java
index ae1cd369a..d17a85a62 100644
---
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/SourcePageRequest.java
+++
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/SourcePageRequest.java
@@ -43,6 +43,12 @@ public class SourcePageRequest extends PageRequest {
@ApiModelProperty(value = "Source type, such as FILE")
private String sourceType;
+ @ApiModelProperty(value = "Data node name")
+ private String dataNodeName;
+
+ @ApiModelProperty(value = "Inlong cluster name")
+ private String inlongClusterName;
+
@ApiModelProperty(value = "Keyword, can be group id, stream id or source
name")
private String keyword;