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/07/22 02:15:23 UTC

[inlong] branch master updated: [INLONG-5175][Manager] Remove redundant StreamSinkExt table and classes (#5176)

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 0c316306b [INLONG-5175][Manager] Remove redundant StreamSinkExt table and classes (#5176)
0c316306b is described below

commit 0c316306bf6f228fb465bbb5e3a9e21df818ba5a
Author: ciscozhou <45...@users.noreply.github.com>
AuthorDate: Fri Jul 22 10:15:19 2022 +0800

    [INLONG-5175][Manager] Remove redundant StreamSinkExt table and classes (#5176)
---
 .../manager/dao/entity/StreamSinkExtEntity.java    |  39 ------
 .../dao/mapper/StreamSinkExtEntityMapper.java      |  68 ---------
 .../mappers/StreamSinkExtEntityMapper.xml          | 156 ---------------------
 .../main/resources/h2/apache_inlong_manager.sql    |  16 ---
 .../manager-web/sql/apache_inlong_manager.sql      |  17 ---
 5 files changed, 296 deletions(-)

diff --git a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/StreamSinkExtEntity.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/StreamSinkExtEntity.java
deleted file mode 100644
index e6d782745..000000000
--- a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/StreamSinkExtEntity.java
+++ /dev/null
@@ -1,39 +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.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-import lombok.Data;
-
-/**
- * Stream sink ext entity, including key name, key value, etc.
- */
-@Data
-public class StreamSinkExtEntity implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-    private Integer id;
-    private String sinkType;
-    private Integer sinkId;
-    private String keyName;
-    private String keyValue;
-    private Integer isDeleted;
-    private Date modifyTime;
-
-}
\ No newline at end of file
diff --git a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/StreamSinkExtEntityMapper.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/StreamSinkExtEntityMapper.java
deleted file mode 100644
index 7f03fcbf9..000000000
--- a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/StreamSinkExtEntityMapper.java
+++ /dev/null
@@ -1,68 +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.StreamSinkExtEntity;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface StreamSinkExtEntityMapper {
-
-    int deleteByPrimaryKey(Integer id);
-
-    int insert(StreamSinkExtEntity record);
-
-    int insertSelective(StreamSinkExtEntity record);
-
-    StreamSinkExtEntity selectByPrimaryKey(Integer id);
-
-    int updateByPrimaryKeySelective(StreamSinkExtEntity record);
-
-    int updateByPrimaryKey(StreamSinkExtEntity record);
-
-    /**
-     * According to the sink type and sink id, physically delete the corresponding extended information
-     *
-     * @param sinkType sink type
-     * @param sinkId sink id
-     * @return rows deleted
-     */
-    int deleteBySinkTypeAndId(@Param("sinkType") String sinkType, @Param("sinkId") Integer sinkId);
-
-    /**
-     * According to the sink type and sink id, logically delete the corresponding extended information
-     *
-     * @param sinkId sink id
-     * @return rows updated
-     */
-    int logicDeleteAll(@Param("sinkId") Integer sinkId);
-
-    /**
-     * According to the sink type and sink id, query the corresponding extended information
-     *
-     * @param sinkType sink type
-     * @param sinkId sink id
-     * @return extended info list
-     */
-    List<StreamSinkExtEntity> selectBySinkTypeAndId(@Param("sinkType") String sinkType,
-            @Param("sinkId") Integer sinkId);
-
-}
\ No newline at end of file
diff --git a/inlong-manager/manager-dao/src/main/resources/mappers/StreamSinkExtEntityMapper.xml b/inlong-manager/manager-dao/src/main/resources/mappers/StreamSinkExtEntityMapper.xml
deleted file mode 100644
index 2e13c7a3f..000000000
--- a/inlong-manager/manager-dao/src/main/resources/mappers/StreamSinkExtEntityMapper.xml
+++ /dev/null
@@ -1,156 +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.StreamSinkExtEntityMapper">
-    <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.StreamSinkExtEntity">
-        <id column="id" jdbcType="INTEGER" property="id"/>
-        <result column="sink_type" jdbcType="VARCHAR" property="sinkType"/>
-        <result column="sink_id" jdbcType="INTEGER" property="sinkId"/>
-        <result column="key_name" jdbcType="VARCHAR" property="keyName"/>
-        <result column="key_value" jdbcType="VARCHAR" property="keyValue"/>
-        <result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
-        <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        id, sink_type, sink_id, key_name, key_value, is_deleted, modify_time
-    </sql>
-    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from stream_sink_ext
-        where id = #{id,jdbcType=INTEGER}
-    </select>
-    <select id="selectBySinkTypeAndId" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from stream_sink_ext
-        where sink_type = #{sinkType, jdbcType=VARCHAR}
-        and sink_id = #{sinkId, jdbcType=INTEGER}
-        and is_deleted = 0
-    </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-        delete
-        from stream_sink_ext
-        where id = #{id,jdbcType=INTEGER}
-    </delete>
-    <delete id="deleteBySinkTypeAndId">
-        delete
-        from stream_sink_ext
-        where sink_type = #{sinkType, jdbcType=VARCHAR}
-          and sink_id = #{sinkId, jdbcType=INTEGER}
-    </delete>
-    <insert id="insert" parameterType="org.apache.inlong.manager.dao.entity.StreamSinkExtEntity">
-        insert into stream_sink_ext (id, sink_type, sink_id,
-                                     key_name, key_value, is_deleted, modify_time)
-        values (#{id,jdbcType=INTEGER}, #{sinkType,jdbcType=VARCHAR}, #{sinkId,jdbcType=INTEGER},
-                #{keyName,jdbcType=VARCHAR}, #{keyValue,jdbcType=VARCHAR}, #{isDeleted,jdbcType=INTEGER},
-                #{modifyTime,jdbcType=TIMESTAMP})
-    </insert>
-    <insert id="insertSelective" parameterType="org.apache.inlong.manager.dao.entity.StreamSinkExtEntity">
-        insert into stream_sink_ext
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="id != null">
-                id,
-            </if>
-            <if test="sinkType != null">
-                sink_type,
-            </if>
-            <if test="sinkId != null">
-                sink_id,
-            </if>
-            <if test="keyName != null">
-                key_name,
-            </if>
-            <if test="keyValue != null">
-                key_value,
-            </if>
-            <if test="isDeleted != null">
-                is_deleted,
-            </if>
-            <if test="modifyTime != null">
-                modify_time,
-            </if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="id != null">
-                #{id,jdbcType=INTEGER},
-            </if>
-            <if test="sinkType != null">
-                #{sinkType,jdbcType=VARCHAR},
-            </if>
-            <if test="sinkId != null">
-                #{sinkId,jdbcType=INTEGER},
-            </if>
-            <if test="keyName != null">
-                #{keyName,jdbcType=VARCHAR},
-            </if>
-            <if test="keyValue != null">
-                #{keyValue,jdbcType=VARCHAR},
-            </if>
-            <if test="isDeleted != null">
-                #{isDeleted,jdbcType=INTEGER},
-            </if>
-            <if test="modifyTime != null">
-                #{modifyTime,jdbcType=TIMESTAMP},
-            </if>
-        </trim>
-    </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="org.apache.inlong.manager.dao.entity.StreamSinkExtEntity">
-        update stream_sink_ext
-        <set>
-            <if test="sinkType != null">
-                sink_type = #{sinkType,jdbcType=VARCHAR},
-            </if>
-            <if test="sinkId != null">
-                sink_id = #{sinkId,jdbcType=INTEGER},
-            </if>
-            <if test="keyName != null">
-                key_name = #{keyName,jdbcType=VARCHAR},
-            </if>
-            <if test="keyValue != null">
-                key_value = #{keyValue,jdbcType=VARCHAR},
-            </if>
-            <if test="isDeleted != null">
-                is_deleted = #{isDeleted,jdbcType=INTEGER},
-            </if>
-            <if test="modifyTime != null">
-                modify_time = #{modifyTime,jdbcType=TIMESTAMP},
-            </if>
-        </set>
-        where id = #{id,jdbcType=INTEGER}
-    </update>
-    <update id="updateByPrimaryKey" parameterType="org.apache.inlong.manager.dao.entity.StreamSinkExtEntity">
-        update stream_sink_ext
-        set sink_type   = #{sinkType,jdbcType=VARCHAR},
-            sink_id     = #{sinkId,jdbcType=INTEGER},
-            key_name    = #{keyName,jdbcType=VARCHAR},
-            key_value   = #{keyValue,jdbcType=VARCHAR},
-            is_deleted  = #{isDeleted,jdbcType=INTEGER},
-            modify_time = #{modifyTime,jdbcType=TIMESTAMP}
-        where id = #{id,jdbcType=INTEGER}
-    </update>
-    <update id="logicDeleteAll">
-        update stream_sink_ext
-        set is_deleted = id
-        where sink_id = #{sinkId, jdbcType=INTEGER}
-          and is_deleted = 0
-    </update>
-</mapper>
\ No newline at end of file
diff --git a/inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql b/inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql
index d19693e92..66cedc5f4 100644
--- a/inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql
+++ b/inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql
@@ -462,22 +462,6 @@ CREATE TABLE IF NOT EXISTS `stream_sink`
     UNIQUE KEY `unique_sink_name` (`inlong_group_id`, `inlong_stream_id`, `sink_name`, `is_deleted`)
 );
 
--- ----------------------------
--- Table structure for stream_sink_ext
--- ----------------------------
-CREATE TABLE IF NOT EXISTS `stream_sink_ext`
-(
-    `id`          int(11)      NOT NULL AUTO_INCREMENT COMMENT 'Incremental primary key',
-    `sink_type`   varchar(20)  NOT NULL COMMENT 'Sink type, including: HDFS, HIVE, etc.',
-    `sink_id`     int(11)      NOT NULL COMMENT 'Sink id',
-    `key_name`    varchar(256) NOT NULL COMMENT 'Configuration item name',
-    `key_value`   text                  DEFAULT NULL COMMENT 'The value of the configuration item',
-    `is_deleted`  int(11)               DEFAULT '0' COMMENT 'Whether to delete, 0: not deleted, > 0: deleted',
-    `modify_time` timestamp    NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modify time',
-    PRIMARY KEY (`id`),
-    KEY `sink_id_index` (`sink_id`)
-);
-
 -- ----------------------------
 -- Table structure for stream_source_field
 -- ----------------------------
diff --git a/inlong-manager/manager-web/sql/apache_inlong_manager.sql b/inlong-manager/manager-web/sql/apache_inlong_manager.sql
index d90678dda..21e53c05b 100644
--- a/inlong-manager/manager-web/sql/apache_inlong_manager.sql
+++ b/inlong-manager/manager-web/sql/apache_inlong_manager.sql
@@ -487,23 +487,6 @@ CREATE TABLE IF NOT EXISTS `stream_sink`
 ) ENGINE = InnoDB
   DEFAULT CHARSET = utf8mb4 COMMENT ='Stream sink table';
 
--- ----------------------------
--- Table structure for stream_sink_ext
--- ----------------------------
-CREATE TABLE IF NOT EXISTS `stream_sink_ext`
-(
-    `id`          int(11)      NOT NULL AUTO_INCREMENT COMMENT 'Incremental primary key',
-    `sink_type`   varchar(20)  NOT NULL COMMENT 'Sink type, including: HDFS, HIVE, etc.',
-    `sink_id`     int(11)      NOT NULL COMMENT 'Sink id',
-    `key_name`    varchar(256) NOT NULL COMMENT 'Configuration item name',
-    `key_value`   text                  DEFAULT NULL COMMENT 'The value of the configuration item',
-    `is_deleted`  int(11)               DEFAULT '0' COMMENT 'Whether to delete, 0: not deleted, > 0: deleted',
-    `modify_time` timestamp    NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modify time',
-    PRIMARY KEY (`id`),
-    KEY `sink_id_index` (`sink_id`)
-) ENGINE = InnoDB
-  DEFAULT CHARSET = utf8mb4 COMMENT ='Stream sink extension table';
-
 -- ----------------------------
 -- Table structure for stream_source_field
 -- ----------------------------