diff options
author | azevaykin <azevaykin@yandex-team.com> | 2023-07-13 13:59:22 +0300 |
---|---|---|
committer | azevaykin <azevaykin@yandex-team.com> | 2023-07-13 13:59:22 +0300 |
commit | d7e3cf9598d887845a54189ec729c4c852a1edab (patch) | |
tree | 18ae8a2af99353115a855b729b1f17b402b317c3 | |
parent | 76d431300e8fd0c43eca55f77c4dd8ae8d70fc38 (diff) | |
download | ydb-d7e3cf9598d887845a54189ec729c4c852a1edab.tar.gz |
DescribePartition & PartitionLocation
-rw-r--r-- | ydb/public/api/grpc/ydb_topic_v1.proto | 3 | ||||
-rw-r--r-- | ydb/public/api/protos/ydb_topic.proto | 65 |
2 files changed, 66 insertions, 2 deletions
diff --git a/ydb/public/api/grpc/ydb_topic_v1.proto b/ydb/public/api/grpc/ydb_topic_v1.proto index e2ecd59273..4a59c7fb88 100644 --- a/ydb/public/api/grpc/ydb_topic_v1.proto +++ b/ydb/public/api/grpc/ydb_topic_v1.proto @@ -77,6 +77,9 @@ service TopicService { // Describe topic command. rpc DescribeTopic(DescribeTopicRequest) returns (DescribeTopicResponse); + // Describe partition command. + rpc DescribePartition(DescribePartitionRequest) returns (DescribePartitionResponse); + // Describe topic's consumer command. rpc DescribeConsumer(DescribeConsumerRequest) returns (DescribeConsumerResponse); diff --git a/ydb/public/api/protos/ydb_topic.proto b/ydb/public/api/protos/ydb_topic.proto index 0cea5ae527..6643bfe72d 100644 --- a/ydb/public/api/protos/ydb_topic.proto +++ b/ydb/public/api/protos/ydb_topic.proto @@ -49,6 +49,13 @@ message UpdateTokenRequest { message UpdateTokenResponse { } +message PartitionWithGeneration { + // Partition identifier. + int64 partition_id = 1; + + // Partition generation. + int64 generation = 2; +} //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // StreamWrite @@ -103,10 +110,14 @@ message StreamWriteMessage { string message_group_id = 4; // Explicit partition id to write to. int64 partition_id = 5; + // Explicit partition location to write to. + PartitionWithGeneration partition_with_generation = 7; } // Explicitly request for last sequential number // It may be expensive, if producer wrote to many partitions before. bool get_last_seq_no = 6; + + } // Response for handshake. @@ -150,6 +161,8 @@ message StreamWriteMessage { string message_group_id = 5; // Explicit partition id to write to. int64 partition_id = 6; + // Explicit partition location to write to. + PartitionWithGeneration partition_with_generation = 8; } // Message metadata. Overall size is limited to 4096 symbols (all keys and values combined). map<string, string> message_meta = 7; @@ -736,6 +749,14 @@ message CreateTopicResponse { message CreateTopicResult { } +// Topic partition location +message PartitionLocation { + // Node identificator. + int32 node_id = 1; + + // Partition generation. + uint64 generation = 2; +} // Describe topic request sent from client to server. message DescribeTopicRequest { @@ -746,6 +767,9 @@ message DescribeTopicRequest { // Include topic statistics. bool include_stats = 3; + + // Include partition location. + bool include_location = 4; } // Describe topic response sent from server to client. @@ -817,6 +841,9 @@ message DescribeTopicResult { // Stats for partition, filled only when include_stats in request is true. PartitionStats partition_stats = 5; + + // Partition location, filled only when include_location in request is true. + PartitionLocation partition_location = 6; } message TopicStats { @@ -832,6 +859,35 @@ message DescribeTopicResult { } } +// Describe partition request sent from client to server. +message DescribePartitionRequest { + Ydb.Operations.OperationParams operation_params = 1; + + // Topic path. + string path = 2; + + // Partition identifier. + int64 partition_id = 3; + + // Include partition statistics. + bool include_stats = 4; + + // Include partition location. + bool include_location = 5; +} + +// Describe partition response sent from server to client. +// If topic is not existed then response status will be "SCHEME_ERROR". +message DescribePartitionResponse { + // Result of request will be inside operation. + Ydb.Operations.Operation operation = 1; +} + +// Describe partition result message that will be inside DescribeTopicResponse.operation. +message DescribePartitionResult { + // Partitions description. + DescribeTopicResult.PartitionInfo partition = 1; +} // Describe topic's consumer request sent from client to server. message DescribeConsumerRequest { @@ -843,6 +899,8 @@ message DescribeConsumerRequest { string consumer = 3; // Include consumer statistics. bool include_stats = 4; + // Include partition location. + bool include_location = 5; } // Describe topic's consumer response sent from server to client. @@ -875,6 +933,9 @@ message DescribeConsumerResult { PartitionStats partition_stats = 5; // Stats for consumer of this partition, filled only when include_stats in request is true. PartitionConsumerStats partition_consumer_stats = 6; + + // Partition location, filled only when include_location in request is true. + PartitionLocation partition_location = 7; } message PartitionConsumerStats { @@ -917,8 +978,8 @@ message PartitionStats { // How much bytes were written during several windows in this partition. MultipleWindowsStat bytes_written = 5; - // Host where tablet for this partition works. Useful for debugging purposes. - int32 partition_node_id = 8; + // Partition host. Useful for debugging purposes. + int32 partition_node_id = 8 [deprecated=true]; //Use PartitionLocation } |