赛尔校园公共服务平台 Logo
平台使用
阿里云
百度云
移动云
智算服务
教育生态
登录 →
赛尔校园公共服务平台 Logo
平台使用 阿里云 百度云 移动云 智算服务 教育生态
登录
  1. 首页
  2. 阿里云
  3. 表格存储
  4. 开发参考
  5. API参考(数据管理)
  6. API概览
  7. 数据表操作
  8. ComputeSplitPointsBySize

ComputeSplitPointsBySize

  • 数据表操作
  • 发布于 2025-04-22
  • 0 次阅读
文档编辑
文档编辑

调用ComputeSplitPointsBySize接口将全表的数据在逻辑上划分成接近指定大小的若干分片,返回这些分片之间的分割点以及分片所在机器的提示。一般用于计算引擎规划并发度等执行计划。

请求消息结构

message ComputeSplitPointsBySizeRequest {
    required string table_name = 1;
    required int64 split_size = 2; // in 100MB
    optional int64 split_size_unit_in_byte = 3;
    optional int32 split_point_limit = 4;
}

名称

类型

是否必选

描述

table_name

string

是

要切分的数据所在的表名。

split_size

int64

是

每个分片的近似大小,以百兆为单位。

split_size_unit_in_byte

int64

否

指定分割大小的单位,以便在分割点计算时使用正确的单位,并确保计算结果的准确性。

split_point_limit

int32

否

指定对分割点数量的限制,以便在进行分割点计算时控制返回的分割点数量。

响应消息结构

message ComputeSplitPointsBySizeResponse {
    required ConsumedCapacity consumed = 1;
    repeated PrimaryKeySchema schema = 2;

    /**
     * Split points between splits, in the increasing order
     *
     * A split is a consecutive range of primary keys,
     * whose data size is about split_size specified in the request.
     * The size could be hard to be precise.
     *
     * A split point is an array of primary-key column w.r.t. table schema,
     * which is never longer than that of table schema.
     * Tailing -inf will be omitted to reduce transmission payloads.
     */
    repeated bytes split_points = 3;

    /**
     * Locations where splits lies in.
     *
     * By the managed nature of TableStore, these locations are no more than hints.
     * If a location is not suitable to be seen, an empty string will be placed.
     */
     repeated SplitLocation locations = 4;
}

名称

类型

描述

consumed

ConsumedCapacity

本次请求消耗的服务能力单元。

schema

PrimaryKeySchema

该表的Schema,与建表时的Schema相同。

split_points

repeated bytes

分片之间的分割点。分割点之间保证单调增。每个分割点都是以Plainbuffer编码的行,并且只有primary-key项。为了减少传输的数据量,分割点最后的-inf不会传输。

locations

repeated SplitLocation

分割点所在机器的提示。可以为空。

例如有一张表有三列主键,其中首列主键类型为string。调用该API后得到5个分片,分别为(-inf,-inf,-inf)到("a",-inf,-inf)、("a",-inf,-inf)到("b",-inf,-inf)、("b",-inf,-inf)到("c",-inf,-inf)、("c",-inf,-inf)到("d",-inf,-inf)和("d",-inf,-inf)到(+inf,+inf,+inf)。前三个落在"machine-A",后两个落在"machine-B"。那么,split_points为(示意)[("a"),("b"),("c"),("d")],而locations为(示意)"machine-A"*3, "machine-B"*2。

使用SDK

Java SDK:指定大小计算分片

服务能力单元消耗

消耗的读服务能力单元数量与分片的数量相同。不消耗写服务能力单元。

相关文章

CreateTable 2025-04-22 14:34

调用CreateTable接口根据给定的表结构信息创建相应的数据表。 注意事项

ListTable 2025-04-22 14:34

调用ListTable接口获取当前实例下已创建的所有表的表名。 注意事项 如果一个表刚刚创建成功,该表名会出现在ListTableRespon

DescribeTable 2025-04-22 14:34

调用DescribeTable接口查询指定表的结构信息以及预留读吞吐量和预留写吞吐量设置信息。 请求消息结构

UpdateTable 2025-04-22 14:34

您可以调用 UpdateTable 接口修改表的配置信息 table_options 和 Stream 配置 StreamSpecification。如果表处于CU 模式(原按量模式)的高性能型实例中,您还可以为数据表配置预留读/写吞吐量

DeleteTable 2025-04-22 14:34

调用DeleteTable接口删除本实例下指定的表。 请求消息结构

ComputeSplitPointsBySize 2025-04-22 14:34

调用ComputeSplitPointsBySize接口将全表的数据在逻辑上划分成接近指定大小的若干分片,返回这些分片之间的分割点以及分片所在机器的提示。一般用于计算引擎规划并发度等执行计划。 请求消息结构

目录
Copyright © 2025 your company All Rights Reserved. Powered by 赛尔网络.
京ICP备14022346号-15
gongan beian 京公网安备11010802041014号