Skip to content

Commit 98ef1cc

Browse files
committed
Add source_changefeed_name to DescribeReplicationResult
1 parent 0ca1ac0 commit 98ef1cc

File tree

7 files changed

+19
-2
lines changed

7 files changed

+19
-2
lines changed

ydb/core/grpc_services/rpc_replication.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ class TDescribeReplicationRPC: public TRpcSchemeRequestActor<TDescribeReplicatio
161161
static void ConvertItem(const NKikimrReplication::TReplicationConfig::TTargetSpecific::TTarget& from, Ydb::Replication::DescribeReplicationResult::Item& to) {
162162
to.set_source_path(from.GetSrcPath());
163163
to.set_destination_path(from.GetDstPath());
164+
if (from.GetSrcStreamName()) {
165+
to.set_source_changefeed_name(from.GetSrcStreamName());
166+
}
164167
}
165168

166169
static void ConvertState(NKikimrReplication::TReplicationState& from, Ydb::Replication::DescribeReplicationResult& to) {

ydb/core/protos/replication.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ message TReplicationConfig {
3535
message TTarget {
3636
optional string SrcPath = 1;
3737
optional string DstPath = 2;
38+
optional string SrcStreamName = 3;
3839
}
3940

4041
repeated TTarget Targets = 1;

ydb/core/tx/replication/controller/tx_describe_replication.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class TController::TTxDescribeReplication: public TTxBase {
4545
auto& item = *Result->Record.AddTargets();
4646
item.SetSrcPath(target->GetSrcPath());
4747
item.SetDstPath(target->GetDstPath());
48+
if (target->GetStreamName()) {
49+
item.SetSrcStreamName(target->GetStreamName());
50+
}
4851
}
4952

5053
auto& state = *Result->Record.MutableState();

ydb/public/api/protos/draft/ydb_replication.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ message DescribeReplicationResult {
4343
message Item {
4444
string source_path = 1;
4545
string destination_path = 2;
46+
optional string source_changefeed_name = 3;
4647
}
4748

4849
message RunningState {

ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,13 @@ int TCommandDescribe::PrintReplicationResponsePretty(const NYdb::NReplication::T
429429
}
430430

431431
if (const auto& items = desc.GetItems()) {
432-
Cout << Endl << "Items (source => destination):";
432+
Cout << Endl << "Items (source [changefeed] => destination):";
433433
for (const auto& item : items) {
434-
Cout << Endl << " " << item.SrcPath << " => " << item.DstPath;
434+
Cout << Endl << " " << item.SrcPath;
435+
if (item.SrcChangefeedName) {
436+
Cout << " [" << *item.SrcChangefeedName << "]";
437+
}
438+
Cout << " => " << item.DstPath;
435439
}
436440
}
437441

ydb/public/sdk/cpp/client/draft/ydb_replication.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ TReplicationDescription::TReplicationDescription(const Ydb::Replication::Describ
9292
Items_.push_back(TItem{
9393
.SrcPath = item.source_path(),
9494
.DstPath = item.destination_path(),
95+
.SrcChangefeedName = item.has_source_changefeed_name()
96+
? std::make_optional(item.source_changefeed_name()) : std::nullopt,
9597
});
9698
}
9799

ydb/public/sdk/cpp/client/draft/ydb_replication.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <util/generic/vector.h>
77

8+
#include <optional>
9+
810
namespace Ydb::Replication {
911
class ConnectionParams;
1012
class DescribeReplicationResult;
@@ -76,6 +78,7 @@ class TReplicationDescription {
7678
struct TItem {
7779
TString SrcPath;
7880
TString DstPath;
81+
std::optional<TString> SrcChangefeedName;
7982
};
8083

8184
enum class EState {

0 commit comments

Comments
 (0)