uxmpp根据分发列将每个分布式表划分为多个逻辑分片。master将这些的分片的状态、位置和相关信息统计起来放在对应的元数据表中。可以在master节点通过SQL查看这些表。
ux_dist_partition存储有关分布表的分布元数据。包括分布方法以及分发列的相关详细信息。
表?4.3.?ux_dist_partition元数据表
名称 | 类型 | 描述 |
---|---|---|
logicalrelid | regclass | 分布式表的表名。 |
partmethod | char | 分布式表的分布方法,h表示哈希分布,a表示append分布,n表示参考表。 |
partkey | text | 分发列的详细信息。 |
colocationid | integer | 此表所属的共址组(参考协同表),该值引用自ux_dist_colocation表的colocationid列。 |
repmodel | char | 数据复制的方法。c表示基于SQL语句的复制,s表示流复制。 |
ux_dist_shard存储有关分布式表的各个分片的元数据。包括有关该分片所属的分布式表的信息以及该分片的分发列的统计信息。
表?4.4.?ux_dist_shard元数据表
名称 | 类型 | 描述 |
---|---|---|
logicalrelid | regclas | 分布式表的表名。 |
shardid | bigint | 分配给分片的唯一标识符。 |
shardstorage | char | 用于此分片的存储类型。t表示存储常规存储,c表示列存,f表示外部存储。 |
shardminvalue | text | append:分布列最小值。hash:分布列最小键值。 |
shardmaxvalue | text | append:分布列最大值。hash:分布列最大键值。 |
ux_dist_placement存储worker节点上的分片和副本的统计信息。
表?4.5.?ux_dist_placement元数据表
名称 | 类型 | 描述 |
---|---|---|
shardid | bigint | 分片的唯一标识符,该值引用自ux_dist_shard表的shardid列。 |
shardstate | integer | 碎片状态。1表示活动状态,3表示非活动(故障)状态。 |
shardlength | bigint | append:分片的大小。hash:为零。 |
nodename | text | 分片所在节点IP。 |
nodeport | integer | 分片所在节点端口。 |
ux_dist_shard_placement是一个视图,显示了worker节点上的分片和副本的统计信息。包括worker的IP和端口。
表?4.6.?ux_dist_shard_placement元数据表
名称 | 类型 | 描述 |
---|---|---|
shardid | bigint | 分片的唯一标识符,该值引用自ux_dist_shard表的shardid列。 |
shardstate | integer | 碎片状态。1表示活动状态,3表示非活动(故障)状态。 |
shardlength | bigint | append:分片的大小。hash:为零。 |
nodename | text | 分片所在节点IP。 |
nodeport | integer | 分片所在节点端口。 |
placementid | bigint | 自动生成的唯一标识符。 |
ux_dist_node存储worker节点的信息。
表?4.7.?ux_dist_node元数据表
名称 | 类型 | 描述 |
---|---|---|
nodeid | integer | 自动生成的单个节点的唯一标识符。 |
groupid | integer | 节点所在组的唯一标识符,通常和nodeid一样。 |
nodename | text | 节点IP。 |
nodeport | integer | 节点端口。 |
noderack | text | (可选)worker节点位置信息。 |
hasmetadata | boolean | 保留字段。 |
isactive | boolean | 节点活动状态。 |
noderole | text | 节点级别。primary或secondary。 |
nodecluster | text | 节点集群名称。(需要手动添加,默认是default)。 |
ux_dist_colocation存储协同表的相关信息。
表?4.8.?ux_dist_colocation元数据表
名称 | 类型 | 描述 |
---|---|---|
colocationid | integer | 协同组的唯一标识符。 |
shardcount | integer | 协同表的分片数。 |
replicationfactor | integer | 协同表的复制因子。 |
distributioncolumntype | oid | 分发列的分发类型代码。 |