Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions ydb/core/tx/replication/ydb_proxy/local_proxy/local_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ void TLocalProxyActor::Handle(TEvYdbProxy::TEvAlterTopicRequest::TPtr& ev) {
*consumer = c;
}

auto callback = [replyTo = ev->Sender, cookie = ev->Cookie, path = path, this](Ydb::StatusIds::StatusCode statusCode, const google::protobuf::Message*) {
auto callback = [
actorSystem = TActivationContext::ActorSystem(),
replyTo = ev->Sender,
cookie = ev->Cookie,
path = path
](Ydb::StatusIds::StatusCode statusCode, const google::protobuf::Message*) {
NYdb::NIssue::TIssues issues;
NYdb::TStatus status(static_cast<NYdb::EStatus>(statusCode), std::move(issues));
Send(replyTo, new TEvYdbProxy::TEvAlterTopicResponse(std::move(status)), 0, cookie);

actorSystem->Send(replyTo, new TEvYdbProxy::TEvAlterTopicResponse(std::move(status)), 0, cookie);
};

NGRpcService::DoAlterTopicRequest(std::make_unique<TLocalProxyRequest>(path, Database, std::move(request), callback), *this);
Expand All @@ -65,7 +71,12 @@ void TLocalProxyActor::Handle(TEvYdbProxy::TEvDescribeTopicRequest::TPtr& ev) {
auto request = std::make_unique<Ydb::Topic::DescribeTopicRequest>();
request.get()->set_path(TStringBuilder() << "/" << Database << path);

auto callback = [replyTo = ev->Sender, cookie = ev->Cookie, path = path, this](Ydb::StatusIds::StatusCode statusCode, const google::protobuf::Message* result) {
auto callback = [
actorSystem = TActivationContext::ActorSystem(),
replyTo = ev->Sender,
cookie = ev->Cookie,
path = path
](Ydb::StatusIds::StatusCode statusCode, const google::protobuf::Message* result) {
NYdb::NIssue::TIssues issues;
Ydb::Topic::DescribeTopicResult describe;
if (statusCode == Ydb::StatusIds::StatusCode::StatusIds_StatusCode_SUCCESS) {
Expand All @@ -80,7 +91,8 @@ void TLocalProxyActor::Handle(TEvYdbProxy::TEvDescribeTopicRequest::TPtr& ev) {

NYdb::TStatus status(static_cast<NYdb::EStatus>(statusCode), std::move(issues));
NYdb::NTopic::TDescribeTopicResult r(std::move(status), std::move(describe));
Send(replyTo, new TEvYdbProxy::TEvDescribeTopicResponse(r), 0, cookie);

actorSystem->Send(replyTo, new TEvYdbProxy::TEvDescribeTopicResponse(r), 0, cookie);
};

NGRpcService::DoDescribeTopicRequest(std::make_unique<TLocalProxyRequest>(path, Database, std::move(request), callback), *this);
Expand All @@ -97,7 +109,12 @@ void TLocalProxyActor::Handle(TEvYdbProxy::TEvDescribePathRequest::TPtr& ev) {
auto request = std::make_unique<Ydb::Scheme::DescribePathRequest>();
request.get()->set_path(TStringBuilder() << "/" << Database << path);

auto callback = [replyTo = ev->Sender, cookie = ev->Cookie, path = path, this](Ydb::StatusIds::StatusCode statusCode, const google::protobuf::Message* result) {
auto callback = [
actorSystem = TActivationContext::ActorSystem(),
replyTo = ev->Sender,
cookie = ev->Cookie,
path = path
](Ydb::StatusIds::StatusCode statusCode, const google::protobuf::Message* result) {
NYdb::NIssue::TIssues issues;
NYdb::NScheme::TSchemeEntry entry;
if (statusCode == Ydb::StatusIds::StatusCode::StatusIds_StatusCode_SUCCESS) {
Expand All @@ -112,7 +129,8 @@ void TLocalProxyActor::Handle(TEvYdbProxy::TEvDescribePathRequest::TPtr& ev) {

NYdb::TStatus status(static_cast<NYdb::EStatus>(statusCode), std::move(issues));
NYdb::NScheme::TDescribePathResult r(std::move(status), std::move(entry));
Send(replyTo, new TEvYdbProxy::TEvDescribePathResponse(r), 0, cookie);

actorSystem->Send(replyTo, new TEvYdbProxy::TEvDescribePathResponse(r), 0, cookie);
};

NGRpcService::DoDescribePathRequest(std::make_unique<TLocalProxyRequest>(path, Database, std::move(request), callback), *this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class TLocalProxyActor

STATEFN(StateWork);


private:
const TString Database;
TString LogPrefix;
Expand Down
Loading