/**
* 时间戳的取值最小值为0,最大值为INT64.MAX
* 1. 若要查询一个范围,则指定start_time和end_time
* 2. 若要查询一个特定时间戳,则指定specific_time
*/
message TimeRange {
optional int64 start_time = 1;
optional int64 end_time = 2;
optional int64 specific_time = 3;
}
/* ############################################# GetRow ############################################# */
enum ReturnType {
RT_NONE = 0;
RT_PK = 1;
}
message ReturnContent {
optional ReturnType return_type = 1;
}
/**
* 1. 支持用户指定版本时间戳范围或者特定的版本时间来读取指定版本的列
* 2. 目前暂不支持行内的断点
*/
message GetRowRequest {
required string table_name = 1;
required bytes primary_key = 2; // encoded as InplaceRowChangeSet, but only has primary key
repeated string columns_to_get = 3; // 不指定则读出所有的列
optional TimeRange time_range = 4;
optional int32 max_versions = 5;
optional bytes filter = 7;
optional string start_column = 8;
optional string end_column = 9;
optional bytes token = 10;
}
message GetRowResponse {
required ConsumedCapacity consumed = 1;
required bytes row = 2; // encoded as InplaceRowChangeSet
optional bytes next_token = 3;
}
/* #################################################################################################### */
/* ############################################# UpdateRow ############################################# */
message UpdateRowRequest {
required string table_name = 1;
required bytes row_change = 2;
required Condition condition = 3;
optional ReturnContent return_content = 4;
}
message UpdateRowResponse {
required ConsumedCapacity consumed = 1;
optional bytes row = 2;
}
/* ####################################################################################################### */
/* ############################################# PutRow ############################################# */
/**
* 这里允许用户为每列单独设置timestamp,而不是强制整行统一一个timestamp。
*/
message PutRowRequest {
required string table_name = 1;
required bytes row = 2; // encoded as InplaceRowChangeSet
required Condition condition = 3;
optional ReturnContent return_content = 4;
}
message PutRowResponse {
required ConsumedCapacity consumed = 1;
optional bytes row = 2;
}
/* #################################################################################################### */
/* ############################################# DeleteRow ############################################# */
/**
* OTS只支持删除该行的所有列所有版本,不支持:
* 1. 删除所有列的所有小于等于某个版本的所有版本
*/
message DeleteRowRequest {
required string table_name = 1;
required bytes primary_key = 2; // encoded as InplaceRowChangeSet, but only has primary key
required Condition condition = 3;
optional ReturnContent return_content = 4;
}
message DeleteRowResponse {
required ConsumedCapacity consumed = 1;
optional bytes row = 2;
}
/* ####################################################################################################### */
/* ############################################# BatchGetRow ############################################# */
message TableInBatchGetRowRequest {
required string table_name = 1;
repeated bytes primary_key = 2; // encoded as InplaceRowChangeSet, but only has primary key
repeated bytes token = 3;
repeated string columns_to_get = 4; // 不指定则读出所有的列
optional TimeRange time_range = 5;
optional int32 max_versions = 6;
optional bytes filter = 8;
optional string start_column = 9;
optional string end_column = 10;
}
message BatchGetRowRequest {
repeated TableInBatchGetRowRequest tables = 1;
}
message RowInBatchGetRowResponse {
required bool is_ok = 1;
optional Error error = 2;
optional ConsumedCapacity consumed = 3;
optional bytes row = 4; // encoded as InplaceRowChangeSet
optional bytes next_token = 5;
}
message TableInBatchGetRowResponse {
required string table_name = 1;
repeated RowInBatchGetRowResponse rows = 2;
}
message BatchGetRowResponse {
repeated TableInBatchGetRowResponse tables = 1;
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。