Skip to content

Commit c2dba4d

Browse files
committed
move from and to bound to separate message
1 parent 262817a commit c2dba4d

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

ydb/public/api/protos/ydb_topic.proto

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,13 @@ message DescribeTopicResponse {
10191019
Ydb.Operations.Operation operation = 1;
10201020
}
10211021

1022+
message PartitionKeyRange {
1023+
// Inclusive left border. Emptiness means -inf.
1024+
optional bytes from_bound = 1;
1025+
// Exclusive right border. Emptiness means +inf.
1026+
optional bytes to_bound = 2;
1027+
}
1028+
10221029
// Describe topic result message that will be inside DescribeTopicResponse.operation.
10231030
message DescribeTopicResult {
10241031
// Description of scheme object.
@@ -1088,10 +1095,7 @@ message DescribeTopicResult {
10881095
// Partition location, filled only when include_location in request is true.
10891096
PartitionLocation partition_location = 6;
10901097

1091-
// Inclusive left border. Emptiness means -inf.
1092-
optional bytes from_bound = 7;
1093-
// Exclusive right border. Emptiness means +inf.
1094-
optional bytes to_bound = 8;
1098+
PartitionKeyRange key_range = 7;
10951099
}
10961100

10971101
message TopicStats {

ydb/public/sdk/cpp/client/ydb_topic/impl/topic.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,12 @@ TPartitionInfo::TPartitionInfo(const Ydb::Topic::DescribeTopicResult::PartitionI
404404
PartitionLocation_ = TPartitionLocation{partitionInfo.partition_location()};
405405
}
406406

407-
if (partitionInfo.has_from_bound()) {
408-
FromBound_ = TString(partitionInfo.from_bound());
407+
if (partitionInfo.has_key_range() && partitionInfo.key_range().has_from_bound()) {
408+
FromBound_ = TString(partitionInfo.key_range().from_bound());
409409
}
410410

411-
if (partitionInfo.has_to_bound()) {
412-
ToBound_ = TString(partitionInfo.to_bound());
411+
if (partitionInfo.has_key_range() && partitionInfo.key_range().has_to_bound()) {
412+
ToBound_ = TString(partitionInfo.key_range().to_bound());
413413
}
414414
}
415415

ydb/services/persqueue_v1/actors/schema_actors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,10 +1076,10 @@ void TDescribeTopicActor::HandleCacheNavigateResponse(TEvTxProxySchemeCache::TEv
10761076
destPart->set_active(sourcePart.GetStatus() == ::NKikimrPQ::ETopicPartitionStatus::Active);
10771077
if (sourcePart.HasKeyRange()) {
10781078
if (sourcePart.GetKeyRange().HasFromBound()) {
1079-
destPart->set_from_bound(sourcePart.GetKeyRange().GetFromBound());
1079+
destPart->mutable_key_range()->set_from_bound(sourcePart.GetKeyRange().GetFromBound());
10801080
}
10811081
if (sourcePart.GetKeyRange().HasToBound()) {
1082-
destPart->set_to_bound(sourcePart.GetKeyRange().GetToBound());
1082+
destPart->mutable_key_range()->set_to_bound(sourcePart.GetKeyRange().GetToBound());
10831083
}
10841084
}
10851085

0 commit comments

Comments
 (0)