You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/04/12 01:41:56 UTC
[incubator-inlong] branch master updated: [INLONG-3627][Manager] Remove deprecated source_file related classes (#3628)
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/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 945fe149f [INLONG-3627][Manager] Remove deprecated source_file related classes (#3628)
945fe149f is described below
commit 945fe149f275d7bf83771e1f4ea81d79e67558d2
Author: ciscozhou <45...@users.noreply.github.com>
AuthorDate: Tue Apr 12 09:41:51 2022 +0800
[INLONG-3627][Manager] Remove deprecated source_file related classes (#3628)
---
.../dao/mapper/SourceFileBasicEntityMapper.java | 54 ---
.../dao/mapper/SourceFileDetailEntityMapper.java | 94 ------
.../mappers/SourceFileBasicEntityMapper.xml | 272 ---------------
.../mappers/SourceFileDetailEntityMapper.xml | 373 ---------------------
.../manager/service/core/SourceDbService.java | 140 --------
.../manager/service/core/SourceFileService.java | 141 --------
.../service/core/impl/SourceFileServiceImpl.java | 365 --------------------
.../listener/GroupCompleteProcessListener.java | 10 -
.../stream/StreamCompleteProcessListener.java | 9 +-
.../web/controller/SourceFileController.java | 128 -------
10 files changed, 1 insertion(+), 1585 deletions(-)
diff --git a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SourceFileBasicEntityMapper.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SourceFileBasicEntityMapper.java
deleted file mode 100644
index 2c881fc75..000000000
--- a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SourceFileBasicEntityMapper.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.ibatis.annotations.Param;
-import org.apache.inlong.manager.dao.entity.SourceFileBasicEntity;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface SourceFileBasicEntityMapper {
-
- int deleteByPrimaryKey(Integer id);
-
- int insert(SourceFileBasicEntity record);
-
- int insertSelective(SourceFileBasicEntity record);
-
- SourceFileBasicEntity selectByPrimaryKey(Integer id);
-
- int updateByPrimaryKeySelective(SourceFileBasicEntity record);
-
- int updateByPrimaryKey(SourceFileBasicEntity record);
-
- SourceFileBasicEntity selectByIdentifier(@Param("groupId") String groupId, @Param("streamId") String streamId);
-
- /**
- * According to the inlong group id and inlong stream id,
- * physically delete the basic information of the file data source
- */
- int deleteByIdentifier(@Param("groupId") String groupId, @Param("streamId") String streamId);
-
- /**
- * According to the inlong group id and inlong stream id,
- * logical delete the basic information of the file data source
- */
- int logicDeleteByIdentifier(@Param("groupId") String groupId, @Param("streamId") String streamId,
- @Param("operator") String operator);
-
-}
\ No newline at end of file
diff --git a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SourceFileDetailEntityMapper.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SourceFileDetailEntityMapper.java
deleted file mode 100644
index fa618de1a..000000000
--- a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SourceFileDetailEntityMapper.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.ibatis.annotations.Param;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailPageRequest;
-import org.apache.inlong.manager.dao.entity.SourceFileDetailEntity;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface SourceFileDetailEntityMapper {
-
- int deleteByPrimaryKey(Integer id);
-
- int insert(SourceFileDetailEntity record);
-
- int insertSelective(SourceFileDetailEntity record);
-
- SourceFileDetailEntity selectByPrimaryKey(Integer id);
-
- int updateByPrimaryKeySelective(SourceFileDetailEntity record);
-
- int updateByPrimaryKey(SourceFileDetailEntity record);
-
- /**
- * Update source db detail status after approving inlong group
- *
- * @param groupId Inlong group id
- * @param streamId Inlong stream id
- * @param status Modified status
- * @param modifier Modifier name
- * @return whether succeed
- * @apiNote If stream id is null, update all inlong stream associated with group id
- */
- boolean updateStatusAfterApprove(@Param("groupId") String groupId, @Param("streamId") String streamId,
- @Param("status") Integer status, @Param("modifier") String modifier);
-
- List<SourceFileDetailEntity> selectByCondition(SourceFileDetailPageRequest request);
-
- /**
- * Query whether the same file data source details exist
- *
- * @param groupId inlong group id
- * @param streamId inlong stream id
- * @param ip IP of file source
- * @param username username corresponding to the data source IP
- * @return number of eligible file sources
- */
- Integer selectDetailExist(@Param("groupId") String groupId, @Param("streamId") String streamId,
- @Param("ip") String ip, @Param("username") String username);
-
- /**
- * According to inlong group id and inlong stream id, query file source details
- *
- * @param groupId inlong group id
- * @param streamId inlong stream id
- * @return file source list
- */
- List<SourceFileDetailEntity> selectByIdentifier(@Param("groupId") String groupId,
- @Param("streamId") String streamId);
-
- /**
- * According to inlong group id and inlong stream id, physically delete file data source details
- *
- * @return rows deleted
- */
- int deleteByIdentifier(@Param("groupId") String groupId, @Param("streamId") String streamId);
-
- /**
- * According to inlong group id and inlong stream id, logically delete file data source details
- *
- * @return rows updated
- */
- int logicDeleteByIdentifier(@Param("groupId") String groupId, @Param("streamId") String streamId,
- @Param("operator") String operator);
-
-}
\ No newline at end of file
diff --git a/inlong-manager/manager-dao/src/main/resources/mappers/SourceFileBasicEntityMapper.xml b/inlong-manager/manager-dao/src/main/resources/mappers/SourceFileBasicEntityMapper.xml
deleted file mode 100644
index 7bf871480..000000000
--- a/inlong-manager/manager-dao/src/main/resources/mappers/SourceFileBasicEntityMapper.xml
+++ /dev/null
@@ -1,272 +0,0 @@
-<?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.SourceFileBasicEntityMapper">
- <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.SourceFileBasicEntity">
- <id column="id" jdbcType="INTEGER" property="id"/>
- <result column="inlong_group_id" jdbcType="VARCHAR" property="inlongGroupId"/>
- <result column="inlong_stream_id" jdbcType="VARCHAR" property="inlongStreamId"/>
- <result column="is_hybrid_source" jdbcType="INTEGER" property="isHybridSource"/>
- <result column="is_table_mapping" jdbcType="INTEGER" property="isTableMapping"/>
- <result column="date_offset" jdbcType="INTEGER" property="dateOffset"/>
- <result column="date_offset_unit" jdbcType="VARCHAR" property="dateOffsetUnit"/>
- <result column="file_rolling_type" jdbcType="VARCHAR" property="fileRollingType"/>
- <result column="upload_max_size" jdbcType="INTEGER" property="uploadMaxSize"/>
- <result column="need_compress" jdbcType="INTEGER" property="needCompress"/>
- <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"/>
- <result column="temp_view" jdbcType="LONGVARCHAR" property="tempView"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, inlong_group_id, inlong_stream_id, is_hybrid_source, is_table_mapping,
- date_offset, date_offset_unit, file_rolling_type, upload_max_size, need_compress,
- is_deleted, creator, modifier, create_time, modify_time, temp_view
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from source_file_basic
- where id = #{id,jdbcType=INTEGER}
- </select>
- <select id="selectByIdentifier" resultType="org.apache.inlong.manager.dao.entity.SourceFileBasicEntity">
- select
- <include refid="Base_Column_List"/>
- from source_file_basic
- where inlong_group_id = #{groupId, jdbcType=VARCHAR}
- and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
- and is_deleted = 0
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete
- from source_file_basic
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByIdentifier">
- delete
- from source_file_basic
- where inlong_group_id = #{groupId, jdbcType=VARCHAR}
- and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
- and is_deleted = 0
- </delete>
- <insert id="insert" useGeneratedKeys="true" keyProperty="id"
- parameterType="org.apache.inlong.manager.dao.entity.SourceFileBasicEntity">
- insert into source_file_basic (id, inlong_group_id, inlong_stream_id,
- is_hybrid_source, is_table_mapping,
- date_offset, date_offset_unit,
- file_rolling_type, upload_max_size,
- need_compress, is_deleted,
- creator, modifier,
- create_time, modify_time, temp_view)
- values (#{id,jdbcType=INTEGER}, #{inlongGroupId,jdbcType=VARCHAR}, #{inlongStreamId,jdbcType=VARCHAR},
- #{isHybridSource,jdbcType=INTEGER}, #{isTableMapping,jdbcType=INTEGER},
- #{dateOffset,jdbcType=INTEGER}, #{dateOffsetUnit,jdbcType=VARCHAR},
- #{fileRollingType,jdbcType=VARCHAR}, #{uploadMaxSize,jdbcType=INTEGER},
- #{needCompress,jdbcType=INTEGER}, #{isDeleted,jdbcType=INTEGER},
- #{creator,jdbcType=VARCHAR}, #{modifier,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP}, #{tempView,jdbcType=LONGVARCHAR})
- </insert>
- <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"
- parameterType="org.apache.inlong.manager.dao.entity.SourceFileBasicEntity">
- insert into source_file_basic
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="inlongGroupId != null">
- inlong_group_id,
- </if>
- <if test="inlongStreamId != null">
- inlong_stream_id,
- </if>
- <if test="isHybridSource != null">
- is_hybrid_source,
- </if>
- <if test="isTableMapping != null">
- is_table_mapping,
- </if>
- <if test="dateOffset != null">
- date_offset,
- </if>
- <if test="dateOffsetUnit != null">
- date_offset_unit,
- </if>
- <if test="fileRollingType != null">
- file_rolling_type,
- </if>
- <if test="uploadMaxSize != null">
- upload_max_size,
- </if>
- <if test="needCompress != null">
- need_compress,
- </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="tempView != null">
- temp_view,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="inlongGroupId != null">
- #{inlongGroupId,jdbcType=VARCHAR},
- </if>
- <if test="inlongStreamId != null">
- #{inlongStreamId,jdbcType=VARCHAR},
- </if>
- <if test="isHybridSource != null">
- #{isHybridSource,jdbcType=INTEGER},
- </if>
- <if test="isTableMapping != null">
- #{isTableMapping,jdbcType=INTEGER},
- </if>
- <if test="dateOffset != null">
- #{dateOffset,jdbcType=INTEGER},
- </if>
- <if test="dateOffsetUnit != null">
- #{dateOffsetUnit,jdbcType=VARCHAR},
- </if>
- <if test="fileRollingType != null">
- #{fileRollingType,jdbcType=VARCHAR},
- </if>
- <if test="uploadMaxSize != null">
- #{uploadMaxSize,jdbcType=INTEGER},
- </if>
- <if test="needCompress != null">
- #{needCompress,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="tempView != null">
- #{tempView,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective"
- parameterType="org.apache.inlong.manager.dao.entity.SourceFileBasicEntity">
- update source_file_basic
- <set>
- <if test="inlongGroupId != null">
- inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR},
- </if>
- <if test="inlongStreamId != null">
- inlong_stream_id = #{inlongStreamId,jdbcType=VARCHAR},
- </if>
- <if test="isHybridSource != null">
- is_hybrid_source = #{isHybridSource,jdbcType=INTEGER},
- </if>
- <if test="isTableMapping != null">
- is_table_mapping = #{isTableMapping,jdbcType=INTEGER},
- </if>
- <if test="dateOffset != null">
- date_offset = #{dateOffset,jdbcType=INTEGER},
- </if>
- <if test="dateOffsetUnit != null">
- date_offset_unit = #{dateOffsetUnit,jdbcType=VARCHAR},
- </if>
- <if test="fileRollingType != null">
- file_rolling_type = #{fileRollingType,jdbcType=VARCHAR},
- </if>
- <if test="uploadMaxSize != null">
- upload_max_size = #{uploadMaxSize,jdbcType=INTEGER},
- </if>
- <if test="needCompress != null">
- need_compress = #{needCompress,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="tempView != null">
- temp_view = #{tempView,jdbcType=LONGVARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="org.apache.inlong.manager.dao.entity.SourceFileBasicEntity">
- update source_file_basic
- set inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR},
- inlong_stream_id = #{inlongStreamId,jdbcType=VARCHAR},
- is_hybrid_source = #{isHybridSource,jdbcType=INTEGER},
- is_table_mapping = #{isTableMapping,jdbcType=INTEGER},
- date_offset = #{dateOffset,jdbcType=INTEGER},
- date_offset_unit = #{dateOffsetUnit,jdbcType=VARCHAR},
- file_rolling_type = #{fileRollingType,jdbcType=VARCHAR},
- upload_max_size = #{uploadMaxSize,jdbcType=INTEGER},
- need_compress = #{needCompress,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},
- temp_view = #{tempView,jdbcType=LONGVARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="logicDeleteByIdentifier">
- update source_file_basic
- set is_deleted = 1,
- modifier = #{operator,jdbcType=VARCHAR}
- where inlong_group_id = #{groupId, jdbcType=VARCHAR}
- and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
- and is_deleted = 0
- </update>
-</mapper>
\ No newline at end of file
diff --git a/inlong-manager/manager-dao/src/main/resources/mappers/SourceFileDetailEntityMapper.xml b/inlong-manager/manager-dao/src/main/resources/mappers/SourceFileDetailEntityMapper.xml
deleted file mode 100644
index d63488236..000000000
--- a/inlong-manager/manager-dao/src/main/resources/mappers/SourceFileDetailEntityMapper.xml
+++ /dev/null
@@ -1,373 +0,0 @@
-<?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.SourceFileDetailEntityMapper">
- <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.SourceFileDetailEntity">
- <id column="id" jdbcType="INTEGER" property="id"/>
- <result column="inlong_group_id" jdbcType="VARCHAR" property="inlongGroupId"/>
- <result column="inlong_stream_id" jdbcType="VARCHAR" property="inlongStreamId"/>
- <result column="access_type" jdbcType="VARCHAR" property="accessType"/>
- <result column="server_name" jdbcType="VARCHAR" property="serverName"/>
- <result column="ip" jdbcType="VARCHAR" property="ip"/>
- <result column="port" jdbcType="INTEGER" property="port"/>
- <result column="is_inner_ip" jdbcType="INTEGER" property="isInnerIp"/>
- <result column="issue_type" jdbcType="VARCHAR" property="issueType"/>
- <result column="username" jdbcType="VARCHAR" property="username"/>
- <result column="password" jdbcType="VARCHAR" property="password"/>
- <result column="file_path" jdbcType="VARCHAR" property="filePath"/>
- <result column="status" jdbcType="INTEGER" property="status"/>
- <result column="previous_status" jdbcType="INTEGER" property="previousStatus"/>
- <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"/>
- <result column="temp_view" jdbcType="LONGVARCHAR" property="tempView"/>
- </resultMap>
-
- <sql id="Base_Column_List">
- id, inlong_group_id, inlong_stream_id, access_type, server_name, ip, port, is_inner_ip,
- issue_type, username, password, file_path, status, previous_status,
- is_deleted, creator, modifier, create_time, modify_time, temp_view
- </sql>
-
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from source_file_detail
- where id = #{id,jdbcType=INTEGER}
- </select>
- <select id="selectByCondition" resultMap="BaseResultMap"
- parameterType="org.apache.inlong.manager.common.pojo.source.SourceFileDetailPageRequest">
- select
- <include refid="Base_Column_List"/>
- from source_file_detail
- <where>
- is_deleted = 0
- <if test="inlongGroupId != null and inlongGroupId != ''">
- and inlong_group_id = #{inlongGroupId, jdbcType=VARCHAR}
- </if>
- <if test="keyWord != null and keyWord != ''">
- and ip like CONCAT('%', #{keyWord}, '%')
- </if>
- <if test="accessType != null and accessType != ''">
- and access_type = #{accessType, jdbcType=VARCHAR}
- </if>
- <if test="status != null and status != ''">
- and status = #{status, jdbcType=INTEGER}
- </if>
- </where>
- order by modify_time desc
- </select>
- <select id="selectDetailExist" resultType="java.lang.Integer">
- select count(1)
- from source_file_detail
- where inlong_group_id = #{groupId, jdbcType=VARCHAR}
- and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
- and ip = #{ip, jdbcType=VARCHAR}
- and username = #{username, jdbcType=VARCHAR}
- and is_deleted = 0
- </select>
-
- <select id="selectByIdentifier" resultType="org.apache.inlong.manager.dao.entity.SourceFileDetailEntity">
- select
- <include refid="Base_Column_List"/>
- from source_file_detail
- <where>
- is_deleted = 0
- <if test="groupId != null and groupId != ''">
- and inlong_group_id = #{groupId, jdbcType=VARCHAR}
- </if>
- <if test="streamId != null and streamId != ''">
- and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
- </if>
- </where>
- order by modify_time desc
- </select>
-
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete
- from source_file_detail
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByIdentifier">
- delete
- from source_file_detail
- where inlong_group_id = #{groupId, jdbcType=VARCHAR}
- and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
- and is_deleted = 0
- </delete>
- <insert id="insert" useGeneratedKeys="true" keyProperty="id"
- parameterType="org.apache.inlong.manager.dao.entity.SourceFileDetailEntity">
- insert into source_file_detail (id, inlong_group_id, inlong_stream_id,
- access_type, server_name, ip,
- port, is_inner_ip, issue_type,
- username, password, file_path,
- status, previous_status,
- is_deleted, creator, modifier,
- create_time, modify_time, temp_view)
- values (#{id,jdbcType=INTEGER}, #{inlongGroupId,jdbcType=VARCHAR}, #{inlongStreamId,jdbcType=VARCHAR},
- #{accessType,jdbcType=VARCHAR}, #{serverName,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR},
- #{port,jdbcType=INTEGER}, #{isInnerIp,jdbcType=INTEGER}, #{issueType,jdbcType=VARCHAR},
- #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR},
- #{status,jdbcType=INTEGER}, #{previousStatus,jdbcType=INTEGER},
- #{isDeleted,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR}, #{modifier,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP}, #{tempView,jdbcType=LONGVARCHAR})
- </insert>
- <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"
- parameterType="org.apache.inlong.manager.dao.entity.SourceFileDetailEntity">
- insert into source_file_detail
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="inlongGroupId != null">
- inlong_group_id,
- </if>
- <if test="inlongStreamId != null">
- inlong_stream_id,
- </if>
- <if test="accessType != null">
- access_type,
- </if>
- <if test="serverName != null">
- server_name,
- </if>
- <if test="ip != null">
- ip,
- </if>
- <if test="port != null">
- port,
- </if>
- <if test="isInnerIp != null">
- is_inner_ip,
- </if>
- <if test="issueType != null">
- issue_type,
- </if>
- <if test="username != null">
- username,
- </if>
- <if test="password != null">
- password,
- </if>
- <if test="filePath != null">
- file_path,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="previousStatus != null">
- previous_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="tempView != null">
- temp_view,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="inlongGroupId != null">
- #{inlongGroupId,jdbcType=VARCHAR},
- </if>
- <if test="inlongStreamId != null">
- #{inlongStreamId,jdbcType=VARCHAR},
- </if>
- <if test="accessType != null">
- #{accessType,jdbcType=VARCHAR},
- </if>
- <if test="serverName != null">
- #{serverName,jdbcType=VARCHAR},
- </if>
- <if test="ip != null">
- #{ip,jdbcType=VARCHAR},
- </if>
- <if test="port != null">
- #{port,jdbcType=INTEGER},
- </if>
- <if test="isInnerIp != null">
- #{isInnerIp,jdbcType=INTEGER},
- </if>
- <if test="issueType != null">
- #{issueType,jdbcType=VARCHAR},
- </if>
- <if test="username != null">
- #{username,jdbcType=VARCHAR},
- </if>
- <if test="password != null">
- #{password,jdbcType=VARCHAR},
- </if>
- <if test="filePath != null">
- #{filePath,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="previousStatus != null">
- #{previousStatus,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="tempView != null">
- #{tempView,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective"
- parameterType="org.apache.inlong.manager.dao.entity.SourceFileDetailEntity">
- update source_file_detail
- <set>
- <if test="inlongGroupId != null">
- inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR},
- </if>
- <if test="inlongStreamId != null">
- inlong_stream_id = #{inlongStreamId,jdbcType=VARCHAR},
- </if>
- <if test="accessType != null">
- access_type = #{accessType,jdbcType=VARCHAR},
- </if>
- <if test="serverName != null">
- server_name = #{serverName,jdbcType=VARCHAR},
- </if>
- <if test="ip != null">
- ip = #{ip,jdbcType=VARCHAR},
- </if>
- <if test="port != null">
- port = #{port,jdbcType=INTEGER},
- </if>
- <if test="isInnerIp != null">
- is_inner_ip = #{isInnerIp,jdbcType=INTEGER},
- </if>
- <if test="issueType != null">
- issue_type = #{issueType,jdbcType=VARCHAR},
- </if>
- <if test="username != null">
- username = #{username,jdbcType=VARCHAR},
- </if>
- <if test="password != null">
- password = #{password,jdbcType=VARCHAR},
- </if>
- <if test="filePath != null">
- file_path = #{filePath,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="previousStatus != null">
- previous_status = #{previousStatus,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="tempView != null">
- temp_view = #{tempView,jdbcType=LONGVARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
-
- <update id="updateByPrimaryKey" parameterType="org.apache.inlong.manager.dao.entity.SourceFileDetailEntity">
- update source_file_detail
- set inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR},
- inlong_stream_id = #{inlongStreamId,jdbcType=VARCHAR},
- access_type = #{accessType,jdbcType=VARCHAR},
- server_name = #{serverName,jdbcType=VARCHAR},
- ip = #{ip,jdbcType=VARCHAR},
- port = #{port,jdbcType=INTEGER},
- is_inner_ip = #{isInnerIp,jdbcType=INTEGER},
- issue_type = #{issueType,jdbcType=VARCHAR},
- username = #{username,jdbcType=VARCHAR},
- password = #{password,jdbcType=VARCHAR},
- file_path = #{filePath,jdbcType=VARCHAR},
- status = #{status,jdbcType=INTEGER},
- previous_status = #{previousStatus,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},
- temp_view = #{tempView,jdbcType=LONGVARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="logicDeleteByIdentifier">
- update source_file_detail
- set is_deleted = 1,
- modifier = #{operator,jdbcType=VARCHAR}
- where inlong_group_id = #{groupId, jdbcType=VARCHAR}
- and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
- and is_deleted = 0
- </update>
- <update id="updateStatusAfterApprove">
- update source_file_detail
- <set>
- status = #{status, jdbcType=INTEGER},
- modifier = #{modifier, jdbcType=VARCHAR}
- </set>
- <where>
- inlong_group_id = #{groupId, jdbcType=VARCHAR}
- <if test="streamId != null and streamId != ''">
- and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
- </if>
- and is_deleted = 0
- </where>
- </update>
-</mapper>
\ No newline at end of file
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/SourceDbService.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/SourceDbService.java
deleted file mode 100644
index d829f3eb7..000000000
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/SourceDbService.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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.source.SourceDbBasicInfo;
-import org.apache.inlong.manager.common.pojo.source.SourceDbDetailInfo;
-import org.apache.inlong.manager.common.pojo.source.SourceDbDetailListVO;
-import org.apache.inlong.manager.common.pojo.source.SourceDbDetailPageRequest;
-
-import java.util.List;
-
-/**
- * DB data source service layer interface
- */
-@Deprecated
-public interface SourceDbService {
-
- /**
- * Save the basic information of the DB data source
- *
- * @param basicInfo DB data source basic information
- * @param operator operator name
- * @return Primary key after saving
- */
- Integer saveBasic(SourceDbBasicInfo basicInfo, String operator);
-
- /**
- * Query the basic information of the data source based on the inlong group id and the inlong stream id
- *
- * @param groupId Inlong group id
- * @param streamId Inlong stream id
- * @return Basic data source information
- */
- SourceDbBasicInfo getBasicByIdentifier(String groupId, String streamId);
-
- /**
- * Modify the basic information of the data source
- *
- * @param basicInfo Data source information that needs to be modified
- * @param operator operator name
- * @return whether succeed
- */
- boolean updateBasic(SourceDbBasicInfo basicInfo, String operator);
-
- /**
- * Tombstone data source basic information
- *
- * @param id Data source basic information id
- * @return whether succeed
- */
- boolean logicDeleteBasic(Integer id, String operator);
-
- /**
- * ave DB data source details
- *
- * @param detailInfo DB data source details
- * @param operator perator name
- * @return Primary key after saving
- */
- Integer saveDetail(SourceDbDetailInfo detailInfo, String operator);
-
- /**
- * Query DB data source details based on id
- *
- * @param id Data source id
- * @return Data source details
- */
- SourceDbDetailInfo getDetailById(Integer id);
-
- /**
- * Query a detailed list of DB data sources based on inlong group id and inlong stream id
- *
- * @param groupId Inlong group id
- * @param streamId Inlong stream id, can be null
- * @return Data source details
- */
- List<SourceDbDetailInfo> listDetailByIdentifier(String groupId, String streamId);
-
- /**
- * Query the detailed list of data sources based on conditions
- *
- * @param request Data source paging query request
- * @return Data source pagination list
- */
- PageInfo<SourceDbDetailListVO> listByCondition(SourceDbDetailPageRequest request);
-
- /**
- * Modify data source details
- *
- * @param detailInfo Data source information that needs to be modified
- * @param operator perator name
- * @return whether succeed
- */
- boolean updateDetail(SourceDbDetailInfo detailInfo, String operator);
-
- /**
- * Tombstone data source details
- *
- * @param id Data source id
- * @param operator perator name
- * @return whether succeed
- */
- boolean logicDeleteDetail(Integer id, String operator);
-
- /**
- * Physically delete the basic and detailed information of the data source
- *
- * @param groupId The inlong group id to which the data source belongs
- * @param streamId The inlong stream id to which the data source belongs
- * @return whether succeed
- */
- boolean deleteAllByIdentifier(String groupId, String streamId);
-
- /**
- * Tombstone data source basic information and detailed information
- *
- * @param groupId The inlong group id to which the data source belongs
- * @param streamId The inlong stream id to which the data source belongs
- * @param operator perator name
- * @return whether succeed
- */
- boolean logicDeleteAllByIdentifier(String groupId, String streamId, String operator);
-
-}
\ No newline at end of file
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/SourceFileService.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/SourceFileService.java
deleted file mode 100644
index e3678d4b7..000000000
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/SourceFileService.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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.source.SourceFileBasicInfo;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailInfo;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailListVO;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailPageRequest;
-
-import java.util.List;
-
-/**
- * File data source service layer interface
- */
-@Deprecated
-public interface SourceFileService {
-
- /**
- * Save the basic information of the file data source
- *
- * @param basicInfo Basic information of file data source
- * @param operator Operator name
- * @return Primary key after saving
- */
- Integer saveBasic(SourceFileBasicInfo basicInfo, String operator);
-
- /**
- * Query the basic information of the data source based on the inlong stream id
- *
- * @param groupId Inlong group id
- * @param streamId Inlong stream id
- * @return Basic data source information
- */
- SourceFileBasicInfo getBasicByIdentifier(String groupId, String streamId);
-
- /**
- * Modify the basic information of the data source
- *
- * @param basicInfo Data source information that needs to be modified
- * @param operator Operator name
- * @return Whether succeed
- */
- boolean updateBasic(SourceFileBasicInfo basicInfo, String operator);
-
- /**
- * Tombstone data source basic information
- *
- * @param id Data source basic information id
- * @param operator Operator name
- * @return Whether succeed
- */
- boolean logicDeleteBasic(Integer id, String operator);
-
- /**
- * Save file data source details
- *
- * @param detailInfo File data source details
- * @param operator Operator name
- * @return Primary key after saving
- */
- Integer saveDetail(SourceFileDetailInfo detailInfo, String operator);
-
- /**
- * Query file data source details based on id
- *
- * @param id Data source id
- * @return Data source details
- */
- SourceFileDetailInfo getDetailById(Integer id);
-
- /**
- * Query a detailed list of file data sources based on inlong group id and inlong stream id
- *
- * @param groupId Inlong group id
- * @param streamId Inlong stream id, can be null
- * @return Data source details
- */
- List<SourceFileDetailInfo> listDetailByIdentifier(String groupId, String streamId);
-
- /**
- * Query the detailed list of data sources based on conditions
- *
- * @param request Data source paging query request
- * @return Data source pagination list
- */
- PageInfo<SourceFileDetailListVO> listByCondition(SourceFileDetailPageRequest request);
-
- /**
- * Modify data source details
- *
- * @param detailInfo Data source information that needs to be modified
- * @param operator Operator name
- * @return Whether succeed
- */
- boolean updateDetail(SourceFileDetailInfo detailInfo, String operator);
-
- /**
- * Tombstone data source details
- *
- * @param id Data source id
- * @param operator Operator name
- * @return Whether succeed
- */
- boolean logicDeleteDetail(Integer id, String operator);
-
- /**
- * Physically delete the basic and detailed information of the data source
- *
- * @param groupId The inlong group id to which the data source belongs
- * @param streamId The inlong stream id to which the data source belongs
- * @return Whether succeed
- */
- boolean deleteAllByIdentifier(String groupId, String streamId);
-
- /**
- * Tombstone data source basic information and detailed information
- *
- * @param groupId The inlong group id to which the data source belongs
- * @param streamId The inlong stream id to which the data source belongs
- * @param operator Operator name
- * @return Whether succeed
- */
- boolean logicDeleteAllByIdentifier(String groupId, String streamId, String operator);
-
-}
\ No newline at end of file
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/SourceFileServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/SourceFileServiceImpl.java
deleted file mode 100644
index 1647b644b..000000000
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/SourceFileServiceImpl.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * 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.Page;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.inlong.manager.common.enums.Constant;
-import org.apache.inlong.manager.common.enums.EntityStatus;
-import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
-import org.apache.inlong.manager.common.exceptions.BusinessException;
-import org.apache.inlong.manager.common.pojo.source.SourceFileBasicInfo;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailInfo;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailListVO;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailPageRequest;
-import org.apache.inlong.manager.common.util.CommonBeanUtils;
-import org.apache.inlong.manager.common.util.Preconditions;
-import org.apache.inlong.manager.dao.entity.InlongGroupEntity;
-import org.apache.inlong.manager.dao.entity.SourceFileBasicEntity;
-import org.apache.inlong.manager.dao.entity.SourceFileDetailEntity;
-import org.apache.inlong.manager.dao.mapper.InlongGroupEntityMapper;
-import org.apache.inlong.manager.dao.mapper.SourceFileBasicEntityMapper;
-import org.apache.inlong.manager.dao.mapper.SourceFileDetailEntityMapper;
-import org.apache.inlong.manager.service.core.SourceFileService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-
-/**
- * File data source service layer implementation
- */
-@Deprecated
-@Service
-public class SourceFileServiceImpl implements SourceFileService {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SourceFileServiceImpl.class);
-
- @Autowired
- private SourceFileBasicEntityMapper fileBasicMapper;
- @Autowired
- private SourceFileDetailEntityMapper fileDetailMapper;
- @Autowired
- private InlongGroupEntityMapper groupMapper;
-
- @Override
- public Integer saveBasic(SourceFileBasicInfo basicInfo, String operator) {
- LOGGER.info("begin to save file data source basic={}", basicInfo);
- Preconditions.checkNotNull(basicInfo, "file data source basic is empty");
- String groupId = basicInfo.getInlongGroupId();
- String streamId = basicInfo.getInlongStreamId();
- Preconditions.checkNotNull(groupId, Constant.GROUP_ID_IS_EMPTY);
- Preconditions.checkNotNull(streamId, Constant.STREAM_ID_IS_EMPTY);
-
- // Check if it can be added
- this.checkGroupIsTempStatus(groupId);
-
- // Each groupId + streamId has only 1 valid basic information
- SourceFileBasicEntity exist = fileBasicMapper.selectByIdentifier(groupId, streamId);
- if (exist != null) {
- LOGGER.error("file data source basic already exists, please check");
- throw new BusinessException(ErrorCodeEnum.SOURCE_DUPLICATE);
- }
-
- SourceFileBasicEntity entity = CommonBeanUtils.copyProperties(basicInfo, SourceFileBasicEntity::new);
- entity.setCreator(operator);
- entity.setModifier(operator);
- entity.setCreateTime(new Date());
- fileBasicMapper.insertSelective(entity);
-
- LOGGER.info("success to save file data source basic");
- return entity.getId();
- }
-
- @Override
- public SourceFileBasicInfo getBasicByIdentifier(String groupId, String streamId) {
- Preconditions.checkNotNull(groupId, Constant.GROUP_ID_IS_EMPTY);
- Preconditions.checkNotNull(streamId, Constant.STREAM_ID_IS_EMPTY);
-
- SourceFileBasicEntity entity = fileBasicMapper.selectByIdentifier(groupId, streamId);
- SourceFileBasicInfo basicInfo = new SourceFileBasicInfo();
- if (entity == null) {
- LOGGER.error("file data source basic not found by streamId={}", streamId);
- // throw new BusinessException(ErrorCodeEnum.DATA_SOURCE_BASIC_NOTFOUND);
- return basicInfo;
- }
- CommonBeanUtils.copyProperties(entity, basicInfo);
-
- LOGGER.debug("success to get file data source basic");
- return basicInfo;
- }
-
- @Override
- public boolean updateBasic(SourceFileBasicInfo basicInfo, String operator) {
- LOGGER.info("begin to update file data source basic={}", basicInfo);
- Preconditions.checkNotNull(basicInfo, "file data source basic is empty");
-
- // The groupId may be modified, it is necessary to determine whether the inlong group status of
- // the modified groupId supports modification
- this.checkGroupIsTempStatus(basicInfo.getInlongGroupId());
-
- // If id is empty, add
- if (basicInfo.getId() == null) {
- this.saveBasic(basicInfo, operator);
- } else {
- SourceFileBasicEntity basicEntity = fileBasicMapper.selectByPrimaryKey(basicInfo.getId());
- if (basicEntity == null) {
- LOGGER.error("file data source basic not found by id={}, update failed", basicInfo.getId());
- throw new BusinessException(ErrorCodeEnum.SOURCE_BASIC_NOT_FOUND);
- }
-
- BeanUtils.copyProperties(basicInfo, basicEntity);
- basicEntity.setModifier(operator);
- fileBasicMapper.updateByPrimaryKeySelective(basicEntity);
- }
-
- LOGGER.info("success to update file data source basic");
- return true;
- }
-
- @Transactional(rollbackFor = Throwable.class)
- @Override
- public boolean logicDeleteBasic(Integer id, String operator) {
- LOGGER.info("begin to delete file data source basic, id={}", id);
- Preconditions.checkNotNull(id, "file data source basic's id is null");
-
- SourceFileBasicEntity entity = fileBasicMapper.selectByPrimaryKey(id);
- if (entity == null) {
- LOGGER.error("file data source basic not found by id={}, delete failed", id);
- throw new BusinessException(ErrorCodeEnum.SOURCE_BASIC_NOT_FOUND);
- }
-
- String groupId = entity.getInlongGroupId();
- String streamId = entity.getInlongStreamId();
- // Check if it can be deleted
- this.checkGroupIsTempStatus(groupId);
-
- // If there are related data source details, it is not allowed to delete
- List<SourceFileDetailEntity> detailEntities = fileDetailMapper.selectByIdentifier(groupId, streamId);
- if (CollectionUtils.isNotEmpty(detailEntities)) {
- LOGGER.error("the data source basic have [{}] details, delete failed", detailEntities.size());
- throw new BusinessException(ErrorCodeEnum.SOURCE_BASIC_DELETE_HAS_DETAIL);
- }
-
- entity.setIsDeleted(1);
- entity.setModifier(operator);
- int resultCount = fileBasicMapper.updateByPrimaryKey(entity);
-
- LOGGER.info("success to delete file data source basic");
- return resultCount >= 0;
- }
-
- @Override
- public Integer saveDetail(SourceFileDetailInfo detailInfo, String operator) {
- LOGGER.info("begin to save file data source detail={}", detailInfo);
- Preconditions.checkNotNull(detailInfo, "file data source detail is empty");
- Preconditions.checkNotNull(detailInfo.getInlongGroupId(), Constant.GROUP_ID_IS_EMPTY);
- Preconditions.checkNotNull(detailInfo.getInlongStreamId(), Constant.STREAM_ID_IS_EMPTY);
-
- // Check if it can be added
- InlongGroupEntity inlongGroupEntity = this.checkGroupIsTempStatus(detailInfo.getInlongGroupId());
-
- // If there are data sources under the same groupId, streamId, ip, username, the addition fails
- String groupId = detailInfo.getInlongGroupId();
- String streamId = detailInfo.getInlongStreamId();
- String ip = detailInfo.getIp();
- String username = detailInfo.getUsername();
- Integer count = fileDetailMapper.selectDetailExist(groupId, streamId, ip, username);
- if (count > 0) {
- LOGGER.error("file data source already exists: groupId=" + groupId + ", streamId=" + streamId
- + ", ip=" + ip + ", username=" + username);
- throw new BusinessException(ErrorCodeEnum.SOURCE_DUPLICATE);
- }
-
- detailInfo.setStatus(EntityStatus.AGENT_ADD.getCode());
- SourceFileDetailEntity detailEntity = CommonBeanUtils.copyProperties(detailInfo, SourceFileDetailEntity::new);
- detailEntity.setCreator(operator);
- detailEntity.setModifier(operator);
- Date now = new Date();
- detailEntity.setCreateTime(now);
- detailEntity.setModifyTime(now);
- fileDetailMapper.insertSelective(detailEntity);
-
- LOGGER.info("success to save file data source detail");
- return detailEntity.getId();
- }
-
- @Override
- public SourceFileDetailInfo getDetailById(Integer id) {
- Preconditions.checkNotNull(id, "file data source detail's id is null");
-
- SourceFileDetailEntity entity = fileDetailMapper.selectByPrimaryKey(id);
- if (entity == null) {
- LOGGER.error("file data source detail not found by id={}", id);
- throw new BusinessException(ErrorCodeEnum.SOURCE_DETAIL_NOT_FOUND);
- }
- SourceFileDetailInfo detailInfo = CommonBeanUtils.copyProperties(entity, SourceFileDetailInfo::new);
-
- LOGGER.debug("success to get file data source detail");
- return detailInfo;
- }
-
- @Override
- public List<SourceFileDetailInfo> listDetailByIdentifier(String groupId, String streamId) {
- Preconditions.checkNotNull(groupId, Constant.GROUP_ID_IS_EMPTY);
-
- List<SourceFileDetailEntity> entities = fileDetailMapper.selectByIdentifier(groupId, streamId);
- if (CollectionUtils.isEmpty(entities)) {
- LOGGER.warn("file data source detail not found");
- // throw new BusinessException(ErrorCodeEnum.DATA_SOURCE_DETAIL_NOTFOUND);
- return Collections.emptyList();
- }
-
- List<SourceFileDetailInfo> infoList = CommonBeanUtils.copyListProperties(entities, SourceFileDetailInfo::new);
- LOGGER.debug("success to list file data source detail");
- return infoList;
- }
-
- @Override
- public PageInfo<SourceFileDetailListVO> listByCondition(SourceFileDetailPageRequest request) {
- PageHelper.startPage(request.getPageNum(), request.getPageSize());
- Page<SourceFileDetailEntity> page = (Page<SourceFileDetailEntity>) fileDetailMapper.selectByCondition(request);
- List<SourceFileDetailListVO> detailList = CommonBeanUtils.copyListProperties(page, SourceFileDetailListVO::new);
-
- // Encapsulate the paging query results into the PageInfo object to obtain related paging information
- PageInfo<SourceFileDetailListVO> pageInfo = new PageInfo<>(detailList);
- pageInfo.setTotal(page.getTotal());
-
- LOGGER.debug("success to list file data source detail");
- return pageInfo;
- }
-
- @Transactional(rollbackFor = Throwable.class)
- @Override
- public boolean updateDetail(SourceFileDetailInfo detailInfo, String operator) {
- LOGGER.info("begin to update file data source detail={}", detailInfo);
- Preconditions.checkNotNull(detailInfo, "file data source detail is empty");
-
- Integer id = detailInfo.getId();
- Preconditions.checkNotNull(id, Constant.ID_IS_EMPTY);
-
- SourceFileDetailEntity entity = fileDetailMapper.selectByPrimaryKey(id);
- if (entity == null) {
- LOGGER.error("file data source detail not found by id=" + id);
- throw new BusinessException(ErrorCodeEnum.SOURCE_DETAIL_NOT_FOUND);
- }
-
- // After the approval is passed, the status needs to be revised to be revised to be issued: 205
- this.checkGroupIsTempStatus(detailInfo.getInlongGroupId());
- detailInfo.setStatus(EntityStatus.AGENT_ADD.getCode());
-
- SourceFileDetailEntity updateEntity = CommonBeanUtils.copyProperties(detailInfo, SourceFileDetailEntity::new);
- updateEntity.setModifier(operator);
- updateEntity.setModifyTime(new Date());
- fileDetailMapper.updateByPrimaryKeySelective(updateEntity);
-
- LOGGER.info("success to update file data source detail");
- return true;
- }
-
- @Transactional(rollbackFor = Throwable.class)
- @Override
- public boolean logicDeleteDetail(Integer id, String operator) {
- LOGGER.info("begin to delete file data source detail, id={}", id);
- Preconditions.checkNotNull(id, "file data source detail's id is null");
-
- SourceFileDetailEntity entity = fileDetailMapper.selectByPrimaryKey(id);
- if (entity == null) {
- LOGGER.error("file data source detail not found by id={}", id);
- throw new BusinessException(ErrorCodeEnum.SOURCE_DETAIL_NOT_FOUND);
- }
-
- // Check if it can be deleted
- InlongGroupEntity bizEntity = this.checkGroupIsTempStatus(entity.getInlongGroupId());
-
- // After the approval is passed, the status needs to be modified to delete to be issued: 204
- if (EntityStatus.GROUP_CONFIG_SUCCESSFUL.getCode().equals(bizEntity.getStatus())) {
- entity.setPreviousStatus(entity.getStatus());
- entity.setStatus(EntityStatus.AGENT_DELETE.getCode());
- } else {
- entity.setPreviousStatus(entity.getStatus());
- entity.setStatus(EntityStatus.AGENT_DISABLE.getCode());
- }
-
- entity.setIsDeleted(EntityStatus.IS_DELETED.getCode());
- entity.setModifier(operator);
- int resultCount = fileDetailMapper.updateByPrimaryKey(entity);
-
- LOGGER.info("success to delete file data source detail");
- return resultCount >= 0;
- }
-
- @Transactional(rollbackFor = Throwable.class)
- @Override
- public boolean deleteAllByIdentifier(String groupId, String streamId) {
- LOGGER.info("begin delete all file basic and detail by groupId={}, streamId={}", groupId, streamId);
- Preconditions.checkNotNull(groupId, Constant.GROUP_ID_IS_EMPTY);
- Preconditions.checkNotNull(streamId, Constant.STREAM_ID_IS_EMPTY);
-
- // Check if it can be deleted
- this.checkGroupIsTempStatus(groupId);
-
- fileBasicMapper.deleteByIdentifier(groupId, streamId);
- fileDetailMapper.deleteByIdentifier(groupId, streamId);
- LOGGER.info("success delete all file basic and detail");
- return true;
- }
-
- @Transactional(rollbackFor = Throwable.class)
- @Override
- public boolean logicDeleteAllByIdentifier(String groupId, String streamId, String operator) {
- LOGGER.info("begin logic delete all file basic and detail by groupId={}, streamId={}", groupId, streamId);
- Preconditions.checkNotNull(groupId, Constant.GROUP_ID_IS_EMPTY);
- Preconditions.checkNotNull(streamId, Constant.STREAM_ID_IS_EMPTY);
-
- // Check if it can be deleted
- this.checkGroupIsTempStatus(groupId);
-
- fileBasicMapper.logicDeleteByIdentifier(groupId, streamId, operator);
- fileDetailMapper.logicDeleteByIdentifier(groupId, streamId, operator);
- LOGGER.info("success logic delete all file basic and detail");
- return true;
- }
-
- /**
- * Check whether the inlong group status is temporary
- *
- * @param groupId Inlong group id
- * @return Inlong group entity for caller reuse
- */
- private InlongGroupEntity checkGroupIsTempStatus(String groupId) {
- InlongGroupEntity inlongGroupEntity = groupMapper.selectByGroupId(groupId);
- Preconditions.checkNotNull(inlongGroupEntity, "groupId is invalid");
- // Add/modify/delete is not allowed under certain inlong group status
- if (EntityStatus.GROUP_TEMP_STATUS.contains(inlongGroupEntity.getStatus())) {
- LOGGER.error("inlong group status was not allowed to add/update/delete data source info");
- throw new BusinessException(ErrorCodeEnum.SOURCE_OPT_NOT_ALLOWED);
- }
-
- return inlongGroupEntity;
- }
-
-}
\ No newline at end of file
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/group/listener/GroupCompleteProcessListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/group/listener/GroupCompleteProcessListener.java
index 31d9e0a0c..d15dc8b69 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/group/listener/GroupCompleteProcessListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/group/listener/GroupCompleteProcessListener.java
@@ -23,7 +23,6 @@ import org.apache.inlong.manager.common.enums.GroupState;
import org.apache.inlong.manager.common.enums.SourceState;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
import org.apache.inlong.manager.common.pojo.workflow.form.GroupResourceProcessForm;
-import org.apache.inlong.manager.dao.mapper.SourceFileDetailEntityMapper;
import org.apache.inlong.manager.service.core.InlongGroupService;
import org.apache.inlong.manager.service.core.InlongStreamService;
import org.apache.inlong.manager.service.source.StreamSourceService;
@@ -47,8 +46,6 @@ public class GroupCompleteProcessListener implements ProcessEventListener {
private InlongStreamService streamService;
@Autowired
private StreamSourceService sourceService;
- @Autowired
- private SourceFileDetailEntityMapper fileDetailMapper;
@Override
public ProcessEvent event() {
@@ -71,13 +68,6 @@ public class GroupCompleteProcessListener implements ProcessEventListener {
// Update status of other related configs
streamService.updateStatus(groupId, null, EntityStatus.STREAM_CONFIG_SUCCESSFUL.getCode(), applicant);
-
- // TODO Remove update source file / db detail status
- // Update file data source status
- fileDetailMapper.updateStatusAfterApprove(groupId, null, EntityStatus.AGENT_ADD.getCode(), applicant);
- // dbDetailMapper.updateStatusAfterApprove(bid, null, EntityStatus.AGENT_WAIT_CREATE.getCode(), username);
-
- // Update stream source status
sourceService.updateStatus(groupId, null, SourceState.TO_BE_ISSUED_ADD.getCode(), applicant);
return ListenerResult.success();
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/stream/StreamCompleteProcessListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/stream/StreamCompleteProcessListener.java
index 6b61f548c..15d69c89f 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/stream/StreamCompleteProcessListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/stream/StreamCompleteProcessListener.java
@@ -22,7 +22,6 @@ import org.apache.inlong.manager.common.enums.EntityStatus;
import org.apache.inlong.manager.common.enums.SourceState;
import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
import org.apache.inlong.manager.common.pojo.workflow.form.GroupResourceProcessForm;
-import org.apache.inlong.manager.dao.mapper.SourceFileDetailEntityMapper;
import org.apache.inlong.manager.service.core.InlongGroupService;
import org.apache.inlong.manager.service.core.InlongStreamService;
import org.apache.inlong.manager.service.source.StreamSourceService;
@@ -46,8 +45,6 @@ public class StreamCompleteProcessListener implements ProcessEventListener {
private InlongStreamService streamService;
@Autowired
private StreamSourceService sourceService;
- @Autowired
- private SourceFileDetailEntityMapper fileDetailMapper;
@Override
public ProcessEvent event() {
@@ -64,13 +61,9 @@ public class StreamCompleteProcessListener implements ProcessEventListener {
String streamId = form.getInlongStreamId();
String applicant = context.getApplicant();
- // update inlong group status
+ // Update status of other related configs
groupService.updateStatus(groupId, EntityStatus.GROUP_CONFIG_SUCCESSFUL.getCode(), applicant);
- // update inlong stream status
streamService.updateStatus(groupId, streamId, EntityStatus.STREAM_CONFIG_SUCCESSFUL.getCode(), applicant);
- // update file data source status
- fileDetailMapper.updateStatusAfterApprove(groupId, streamId, EntityStatus.AGENT_ADD.getCode(), applicant);
- // Update stream source status
sourceService.updateStatus(groupId, streamId, SourceState.TO_BE_ISSUED_ADD.getCode(), applicant);
return ListenerResult.success();
diff --git a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/SourceFileController.java b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/SourceFileController.java
deleted file mode 100644
index 56d71aafb..000000000
--- a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/SourceFileController.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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.web.controller;
-
-import com.github.pagehelper.PageInfo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-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.source.SourceFileBasicInfo;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailInfo;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailListVO;
-import org.apache.inlong.manager.common.pojo.source.SourceFileDetailPageRequest;
-import org.apache.inlong.manager.common.util.LoginUserUtils;
-import org.apache.inlong.manager.service.core.SourceFileService;
-import org.apache.inlong.manager.service.core.operationlog.OperationLog;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * File-based data source control layer
- */
-@Deprecated
-@RestController
-@RequestMapping("/datasource/file")
-@Api(tags = "DataSource - File")
-public class SourceFileController {
-
- @Autowired
- SourceFileService fileSourceService;
-
- @RequestMapping(value = "/saveBasic", method = RequestMethod.POST)
- @OperationLog(operation = OperationType.CREATE)
- @ApiOperation(value = "Save basic information of file data source")
- public Response<Integer> saveBasic(@RequestBody SourceFileBasicInfo basicInfo) {
- int result = fileSourceService.saveBasic(basicInfo, LoginUserUtils.getLoginUserDetail().getUserName());
- return Response.success(result);
- }
-
- @RequestMapping(value = "/getBasic", method = RequestMethod.GET)
- @ApiOperation(value = "Query basic information of file data source")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "groupId", dataTypeClass = String.class, required = true),
- @ApiImplicitParam(name = "streamId", dataTypeClass = String.class, required = true)
- })
- public Response<SourceFileBasicInfo> getBasic(@RequestParam(name = "groupId") String groupId,
- @RequestParam(name = "streamId") String streamId) {
- return Response.success(fileSourceService.getBasicByIdentifier(groupId, streamId));
- }
-
- @RequestMapping(value = "/updateBasic", method = RequestMethod.POST)
- @OperationLog(operation = OperationType.UPDATE)
- @ApiOperation(value = "Update basic information of file data source")
- public Response<Boolean> updateBasic(@RequestBody SourceFileBasicInfo basicInfo) {
- boolean result = fileSourceService.updateBasic(basicInfo, LoginUserUtils.getLoginUserDetail().getUserName());
- return Response.success(result);
- }
-
- @RequestMapping(value = "/deleteBasic/{id}", method = RequestMethod.DELETE)
- @OperationLog(operation = OperationType.DELETE)
- @ApiOperation(value = "Delete basic information of file data source")
- @ApiImplicitParam(name = "id", value = "File data source id", dataTypeClass = String.class, required = true)
- public Response<Boolean> deleteBasic(@PathVariable Integer id) {
- return Response
- .success(fileSourceService.logicDeleteBasic(id, LoginUserUtils.getLoginUserDetail().getUserName()));
- }
-
- @RequestMapping(value = "/saveDetail", method = RequestMethod.POST)
- @OperationLog(operation = OperationType.CREATE)
- @ApiOperation(value = "Save file data source details")
- public Response<Integer> saveDetail(@RequestBody SourceFileDetailInfo detailInfo) {
- int result = fileSourceService.saveDetail(detailInfo, LoginUserUtils.getLoginUserDetail().getUserName());
- return Response.success(result);
- }
-
- @RequestMapping(value = "/getDetail/{id}", method = RequestMethod.GET)
- @ApiOperation(value = "Query file data source details")
- @ApiImplicitParam(name = "id", value = "id", dataTypeClass = String.class, required = true)
- public Response<SourceFileDetailInfo> getDetail(@PathVariable Integer id) {
- return Response.success(fileSourceService.getDetailById(id));
- }
-
- @RequestMapping(value = "/listDetail/", method = RequestMethod.GET)
- @ApiOperation(value = "Paging query file data source details")
- public Response<PageInfo<SourceFileDetailListVO>> listByCondition(SourceFileDetailPageRequest request) {
- return Response.success(fileSourceService.listByCondition(request));
- }
-
- @RequestMapping(value = "/updateDetail", method = RequestMethod.POST)
- @OperationLog(operation = OperationType.UPDATE)
- @ApiOperation(value = "Modify file data source details")
- public Response<Boolean> updateDetail(@RequestBody SourceFileDetailInfo detailInfo) {
- boolean result = fileSourceService.updateDetail(detailInfo, LoginUserUtils.getLoginUserDetail().getUserName());
- return Response.success(result);
- }
-
- @RequestMapping(value = "/deleteDetail/{id}", method = RequestMethod.DELETE)
- @OperationLog(operation = OperationType.DELETE)
- @ApiOperation(value = "Delete file data source details")
- @ApiImplicitParam(name = "id", value = "File data source id", dataTypeClass = String.class, required = true)
- public Response<Boolean> deleteDetail(@PathVariable Integer id) {
- return Response
- .success(fileSourceService.logicDeleteDetail(id, LoginUserUtils.getLoginUserDetail().getUserName()));
- }
-
-}
\ No newline at end of file