Skip to content

Commit

Permalink
#30
Browse files Browse the repository at this point in the history
monitor 相关sql调整
  • Loading branch information
TannerCai committed Mar 28, 2019
1 parent 4acd3e0 commit 16877ba
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pallas-core/src/main/resources/db/ddl/h2/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ CREATE TABLE IF NOT EXISTS `cluster` (
`create_time` timestamp NOT NULL DEFAULT '1980-01-01 01:01:01' COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT '1980-01-01 01:01:01' COMMENT '更新时间',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否己删除',
`real_clusters` varchar(512) NOT NULL DEFAULT '' COMMENT '当为逻辑集群时,此项不为空,值为集群id集合,逗号分开,如:3,5',
`accessible_ps` varchar(512) DEFAULT '' COMMENT 'ࠉӔ؃ϊ֢ٶܯȺքpallas-searchܯȺ',
`real_clusters` varchar(512) NOT NULL DEFAULT '' COMMENT '当为逻辑集群时,此项不为空,值为集群id集合,逗号分开,如:3,5',
`accessible_ps` varchar(512) DEFAULT '' COMMENT '可以访问这个集群的pallas-search集群',
`monitor_level` varchar(256) DEFAULT '' COMMENT '监控等级',
PRIMARY KEY (`id`),
UNIQUE KEY `cluster_id_unqiue` (`cluster_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
Expand Down
3 changes: 2 additions & 1 deletion pallas-core/src/main/resources/db/ddl/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ CREATE TABLE IF NOT EXISTS `cluster` (
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否己删除',
`real_clusters` varchar(512) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '当为逻辑集群时,此项不为空,值为集群id集合,逗号分开,如:3,5',
`accessible_ps` varchar(512) COLLATE utf8_bin DEFAULT '' COMMENT 'ࠉӔ؃ϊ֢ٶܯȺքpallas-searchܯȺ',
`accessible_ps` varchar(512) COLLATE utf8_bin DEFAULT '' COMMENT '可以访问这个集群的pallas-search集群',
`monitor_level` varchar(256) COLLATE utf8_bin DEFAULT '' COMMENT '监控等级',
PRIMARY KEY (`id`),
UNIQUE KEY `cluster_id_unqiue` (`cluster_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
Expand Down
2 changes: 1 addition & 1 deletion pallas-core/src/main/resources/mapper/ClusterMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
#{description,jdbcType=LONGVARCHAR},
</if>
<if test="createTime != null">
#{createTime, jdbcType=TIMESTAMP}
#{createTime, jdbcType=TIMESTAMP},
</if>
<if test="monitorLevel != null">
#{monitorLevel, jdbcType=VARCHAR}
Expand Down
3 changes: 2 additions & 1 deletion pallas-core/src/main/resources/mapper/h2/ClusterMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<if test="params.clusterId != null and params.clusterId !=''">
or description like concat('%', #{params.clusterId}, '%')
</if>
order by update_time desc
</select>

<delete id="deleteByClusterId" parameterType="java.lang.String">
Expand All @@ -83,7 +84,7 @@
insert into cluster (cluster_id, http_address, client_address,
real_clusters, accessible_ps, description, create_time, monitor_level)
values (#{clusterId,jdbcType=VARCHAR}, #{httpAddress,jdbcType=VARCHAR}, #{clientAddress,jdbcType=VARCHAR},
#{realClusters,jdbcType=VARCHAR}, #{accessiblePs,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR}), #{createTime, jdbcType=TIMESTAMP, #{monitorLevel,jdbcType=VARCHAR}
#{realClusters,jdbcType=VARCHAR}, #{accessiblePs,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR}), #{createTime, jdbcType=TIMESTAMP}, #{monitorLevel,jdbcType=VARCHAR}
</insert>
<insert id="insertSelective" parameterType="com.vip.pallas.mybatis.entity.Cluster">
insert into cluster
Expand Down
2 changes: 1 addition & 1 deletion pallas-it/src/test/resources/db/dml/h2/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ REPLACE INTO `permission` VALUES (1,'cluster.all','cluster.all.write','','System

CREATE ALIAS IF NOT EXISTS FIND_IN_SET FOR "com.vip.pallas.utils.H2DBFunctions.getClusterIds";

REPLACE INTO `cluster` VALUES (1,'pallas-test-cluster','开源测试演示','127.0.0.1:9200','127.0.0.1:9300',NULL,now(),0,'','SHARED-CLUSTER');
REPLACE INTO `cluster` VALUES (1,'pallas-test-cluster','开源测试演示','127.0.0.1:9200','127.0.0.1:9300',NULL,now(),0,'','SHARED-CLUSTER', '{"cluster": 0,"index": 0}');

REPLACE INTO `index` (`id`, `index_name`, `description`, `cluster_name`, `stat`, `create_time`, `update_time`, `is_deleted`, `timeout`, `retry`, `slower_than`) VALUES ('1', 'product_comment', '商品评价测试索引', 'pallas-test-cluster', 'inactive', now(), now(), '0', '0', '0', '200');

Expand Down

0 comments on commit 16877ba

Please sign in to comment.