初始化3.0.0版本

This commit is contained in:
zengqiao
2022-08-18 17:04:05 +08:00
parent 462303fca0
commit 51832385b1
2446 changed files with 93177 additions and 127211 deletions

View File

@@ -0,0 +1,26 @@
{
"_source": "timestamp",
"size": 1,
"query": {
"bool": {
"must": [
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
%s
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,44 @@
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"brokerId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"aggs": {
"hist": {
"date_histogram": {
"field": "timestamp",
"fixed_interval": "%s",
"time_zone": "Asia/Shanghai",
"min_doc_count": 0
},
"aggs": {
%s
}
}
}
}

View File

@@ -0,0 +1,34 @@
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"brokerId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"aggs": {
%s
}
}

View File

@@ -0,0 +1,45 @@
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"aggs": {
"hist": {
"terms": {
"field": "brokerId",
"collect_mode": "breadth_first"
},
"aggs": {
"hist": {
"date_histogram": {
"field": "timestamp",
"fixed_interval": "%s",
"time_zone": "Asia/Shanghai",
"min_doc_count": 0
},
"aggs": {
%s
}
}
}
}
}
}

View File

@@ -0,0 +1,38 @@
{
"size": 1,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"brokerId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,37 @@
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"aggs": {
"hist": {
"date_histogram": {
"field": "timestamp",
"fixed_interval": "%s",
"time_zone": "Asia/Shanghai",
"min_doc_count": 0
},
"aggs": {
%s
}
}
}
}

View File

@@ -0,0 +1,27 @@
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"aggs": {
%s
}
}

View File

@@ -0,0 +1,31 @@
{
"size": 1,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,17 @@
{
"query": {
"bool": {
"must": [
{
"term": {
"timestamp": {
"value": %d
}
}
}
%s
]
}
},
"sort":[%s]
}

View File

@@ -0,0 +1,38 @@
{
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"group": {
"value": "%s"
}
}
},
{
"term": {
"groupMetric": {
"value": "1"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
},
%s
]
}
}
}

View File

@@ -0,0 +1,40 @@
{
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"group": {
"value": "%s"
}
}
},
{
"term": {
"groupMetric": {
"value": "1"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
],
"must_not": [
%s
]
}
}
}

View File

@@ -0,0 +1,45 @@
{
"size": 1000,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"group": {
"value": "%s"
}
}
},
{
"term": {
"groupMetric": {
"value": "0"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,71 @@
{
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"group": {
"value": "%s"
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"term": {
"partitionId": {
"value": %d
}
}
},
{
"term": {
"groupMetric": {
"value": "0"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
],
"aggs": {
"hist": {
"date_histogram": {
"field": "timestamp",
"fixed_interval": "%s",
"time_zone": "Asia/Shanghai",
"min_doc_count": 0
},
"aggs": {
%s
}
}
}
}

View File

@@ -0,0 +1,55 @@
{
"size": 1,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"group": {
"value": "%s"
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"term": {
"groupMetric": {
"value": "0"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"aggs": {
%s
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,51 @@
{
"size": 1000,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"group": {
"value": "%s"
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"term": {
"groupMetric": {
"value": "0"
}
}
},
{
"term": {
"timestamp": {
"value": %d
}
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,52 @@
{
"size": 1,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"term": {
"brokerId": {
"value": %d
}
}
},
{
"term": {
"partitionId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,37 @@
{
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,34 @@
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"brokerId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"aggs": {
%s
}
}

View File

@@ -0,0 +1,52 @@
{
"size": 1,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"brokerId": {
"value": %d
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"term": {
"partitionId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,38 @@
{
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"term": {
"brokerAgg": {
"value": "1"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
},
%s
]
}
}
}

View File

@@ -0,0 +1,40 @@
{
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"term": {
"brokerAgg": {
"value": "1"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
],
"must_not": [
%s
]
}
}
}

View File

@@ -0,0 +1,44 @@
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"aggs": {
"hist": {
"date_histogram": {
"field": "timestamp",
"fixed_interval": "%s",
"time_zone": "Asia/Shanghai",
"min_doc_count": 0
},
"aggs": {
%s
}
}
}
}

View File

@@ -0,0 +1,36 @@
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
%s
]
}
},
"aggs": {
"hist": {
"terms": {
"field": "topic",
"collect_mode": "breadth_first"
},
"aggs": {
%s
}
}
}
}

View File

@@ -0,0 +1,45 @@
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"aggs": {
"hist": {
"terms": {
"field": "topic",
"collect_mode": "breadth_first"
},
"aggs": {
"hist": {
"date_histogram": {
"field": "timestamp",
"fixed_interval": "%s",
"time_zone": "Asia/Shanghai",
"min_doc_count": 0
},
"aggs": {
%s
}
}
}
}
}
}

View File

@@ -0,0 +1,32 @@
{
"size": 1,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
}
]
}
},
"sort":[%s]
}

View File

@@ -0,0 +1,39 @@
{
"size":1000,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"brokerAgg": {
"value": "1"
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
%s
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,45 @@
{
"size": 1,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"topic": {
"value": "%s"
}
}
},
{
"term": {
"brokerId": {
"value": %d
}
}
},
{
"range": {
"timestamp": {
"gte": %d,
"lte": %d
}
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}

View File

@@ -0,0 +1,32 @@
{
"size": 5000,
"query": {
"bool": {
"must": [
{
"term": {
"clusterPhyId": {
"value": %d
}
}
},
{
"term": {
"timestamp": {
"value": %d
}
}
},
{
"term": {
"brokerAgg": {
"value": "1"
}
}
}
%s
]
}
},
"sort":[%s]
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.broker.BrokerConfigDAO">
<resultMap id="BrokerConfigMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.broker.BrokerConfigPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="broker_id" property="brokerId" />
<result column="config_name" property="configName" />
<result column="config_value" property="configValue" />
<result column="diff_type" property="diffType" />
</resultMap>
<insert id="replace" parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.broker.BrokerConfigPO">
REPLACE ks_km_broker_config
(cluster_phy_id, broker_id, config_name, config_value, diff_type, update_time)
VALUES
(#{clusterPhyId}, #{brokerId}, #{configName}, #{configValue}, #{diffType}, #{updateTime})
</insert>
</mapper>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.broker.BrokerDAO">
<resultMap id="BrokerMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.broker.BrokerPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="broker_id" property="brokerId" />
<result column="host" property="host" />
<result column="port" property="port" />
<result column="jmx_port" property="jmxPort" />
<result column="start_timestamp" property="startTimestamp" />
<result column="status" property="status" />
</resultMap>
<insert id="replace" parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.broker.BrokerPO">
REPLACE ks_km_broker
(cluster_phy_id, broker_id, host, port, jmx_port, start_timestamp, status, update_time)
VALUES
(#{clusterPhyId}, #{brokerId}, #{host}, #{port}, #{jmxPort}, #{startTimestamp}, #{status}, #{updateTime})
</insert>
</mapper>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.cluster.ClusterPhyDAO">
<resultMap id="ClusterPhyMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.cluster.ClusterPhyPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="name" property="name" />
<result column="zookeeper" property="zookeeper" />
<result column="bootstrap_servers" property="bootstrapServers" />
<result column="kafka_version" property="kafkaVersion" />
<result column="client_properties" property="clientProperties" />
<result column="jmx_properties" property="jmxProperties" />
<result column="auth_type" property="authType" />
<result column="run_state" property="runState" />
<result column="description" property="description" />
</resultMap>
<insert id="addAndSetId"
parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.cluster.ClusterPhyPO"
useGeneratedKeys="true"
keyProperty="id">
INSERT INTO ks_km_physical_cluster
(name, zookeeper, bootstrap_servers, kafka_version, client_properties, jmx_properties, description, auth_type, run_state)
VALUES
(#{name}, #{zookeeper}, #{bootstrapServers}, #{kafkaVersion}, #{clientProperties}, #{jmxProperties}, #{description}, #{authType}, #{runState})
</insert>
</mapper>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.group.GroupMemberDAO">
<resultMap id="GroupMemberMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.group.GroupMemberPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="topic_name" property="topicName" />
<result column="group_name" property="groupName" />
<result column="state" property="state" />
<result column="member_count" property="memberCount" />
</resultMap>
<insert id="replace" parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.group.GroupMemberPO">
REPLACE ks_km_group_member
(cluster_phy_id, topic_name, group_name, `state`, member_count, update_time)
VALUES
(#{clusterPhyId}, #{topicName}, #{groupName}, #{state}, #{memberCount}, #{updateTime})
</insert>
</mapper>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.health.HealthCheckResultDAO">
<resultMap id="ClusterPhyMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.health.HealthCheckResultPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="dimension" property="dimension" />
<result column="config_name" property="configName" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="res_name" property="resName" />
<result column="passed" property="passed" />
</resultMap>
<insert id="replace" parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.health.HealthCheckResultPO">
REPLACE ks_km_health_check_result
(dimension, config_name, cluster_phy_id, res_name, passed)
VALUES
(#{dimension}, #{configName}, #{clusterPhyId}, #{resName}, #{passed})
</insert>
</mapper>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.KafkaAclDAO">
<resultMap id="ClusterPhyMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.KafkaAclPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="principal" property="principal" />
<result column="operation" property="operation" />
<result column="permission_type" property="permissionType" />
<result column="host" property="host" />
<result column="resource_type" property="resourceType" />
<result column="resource_name" property="resourceName" />
<result column="pattern_type" property="patternType" />
<result column="unique_field" property="uniqueField" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.kafkacontroller.KafkaControllerDAO">
<resultMap id="KafkaControllerMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.kafkacontrollr.KafkaControllerPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="broker_id" property="brokerId" />
<result column="broker_host" property="brokerHost" />
<result column="broker_rack" property="brokerRack" />
<result column="timestamp" property="timestamp" />
</resultMap>
<select id="listAllLatest" resultMap="KafkaControllerMap">
SELECT Table_B.* FROM
(SELECT max(`id`) as id FROM `ks_km_kafka_controller` GROUP BY `cluster_phy_id`) AS Table_A
JOIN `ks_km_kafka_controller` AS Table_B ON
Table_A.id=Table_B.id;
</select>
</mapper>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.KafkaUserDAO">
<resultMap id="ClusterPhyMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.KafkaUserPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="name" property="name" />
<result column="token" property="token" />
</resultMap>
<insert id="replace" parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.KafkaUserPO">
REPLACE ks_km_kafka_acl
(cluster_phy_id, `name`, token, update_time)
VALUES
(#{clusterPhyId}, #{name}, #{token}, #{updateTime})
</insert>
</mapper>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.partition.PartitionDAO">
<resultMap id="PartitionMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.partition.PartitionPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="topic_name" property="topicName" />
<result column="partition_id" property="partitionId" />
<result column="leader_broker_id" property="leaderBrokerId" />
<result column="in_sync_replicas" property="inSyncReplicas" />
<result column="assign_replicas" property="assignReplicas" />
</resultMap>
<insert id="replace" parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.partition.PartitionPO">
REPLACE ks_km_partition
(cluster_phy_id, topic_name, partition_id, leader_broker_id, in_sync_replicas, assign_replicas)
VALUES
(#{clusterPhyId}, #{topicName}, #{partitionId}, #{leaderBrokerId}, #{inSyncReplicas}, #{assignReplicas})
</insert>
</mapper>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.config.PlatformClusterConfigDAO">
<resultMap id="PlatformClusterConfigMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.config.PlatformClusterConfigPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_id" property="clusterId" />
<result column="value_group" property="valueGroup" />
<result column="value_name" property="valueName" />
<result column="value" property="value" />
<result column="description" property="description" />
<result column="operator" property="operator" />
</resultMap>
<insert id="batchReplace" parameterType="java.util.List">
REPLACE INTO ks_km_platform_cluster_config (
cluster_id,
`value_group`,
`value_name`,
`value`,
description,
operator
) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.clusterId},
#{item.valueGroup},
#{item.valueName},
#{item.value},
#{item.description},
#{item.operator}
)
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.reassign.ReassignJobDAO">
<resultMap id="ReassignJobMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.reassign.ReassignJobPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="reassignment_json" property="reassignmentJson" />
<result column="description" property="description" />
<result column="throttle_unit_byte" property="throttleUnitByte" />
<result column="start_time" property="startTime" />
<result column="finished_time" property="finishedTime" />
<result column="creator" property="creator" />
<result column="status" property="status" />
</resultMap>
<insert id="addAndSetId" parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.reassign.ReassignJobPO">
INSERT INTO ks_km_reassign_job
(id, cluster_phy_id, reassignment_json, description, throttle_unit_byte, start_time, finished_time, creator, status)
VALUES
(#{id}, #{clusterPhyId}, #{reassignmentJson}, #{description}, #{throttleUnitByte}, #{startTime}, #{finishedTime}, #{creator}, #{status})
</insert>
</mapper>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaojukeji.know.streaming.km.persistence.mysql.topic.TopicDAO">
<resultMap id="TopicMap" type="com.xiaojukeji.know.streaming.km.common.bean.po.topic.TopicPO">
<id column="id" property="id" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="cluster_phy_id" property="clusterPhyId" />
<result column="topic_name" property="topicName" />
<result column="replica_num" property="replicaNum" />
<result column="partition_num" property="partitionNum" />
<result column="broker_ids" property="brokerIds" />
<result column="partition_map" property="partitionMap" />
<result column="retention_ms" property="retentionMs" />
<result column="type" property="type" />
<result column="description" property="description" />
</resultMap>
<insert id="replaceAll" parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.topic.TopicPO">
REPLACE ks_km_topic
(cluster_phy_id, topic_name, replica_num, partition_num, broker_ids, partition_map, retention_ms, `type`, description)
VALUES
(#{clusterPhyId}, #{topicName}, #{replicaNum}, #{partitionNum}, #{brokerIds}, #{partitionMap}, #{retentionMs}, #{type}, #{description})
</insert>
<update id="updateConfig" parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.topic.TopicPO">
UPDATE ks_km_topic SET retention_ms = #{retentionMs} WHERE cluster_phy_id = #{clusterPhyId} AND topic_name = #{topicName}
</update>
</mapper>