diff options
author | vvshlyaga <vvshlyaga@yandex-team.com> | 2025-06-09 12:14:15 +0300 |
---|---|---|
committer | vvshlyaga <vvshlyaga@yandex-team.com> | 2025-06-09 12:32:16 +0300 |
commit | 446923703073861dee8045587d3d4fbf7b51bcf9 (patch) | |
tree | d04bbaa20788f0dca893a2bdaa681c03f019b214 | |
parent | 74bfd43caa67a648e551e77fd740e24c3ee151cb (diff) | |
download | ydb-446923703073861dee8045587d3d4fbf7b51bcf9.tar.gz |
YT-25105: code style fixes after PR
commit_hash:4b8e9a684475618f2b78dec973ca596929882257
-rw-r--r-- | yt/yt/core/rpc/bus/channel.cpp | 2 | ||||
-rw-r--r-- | yt/yt/core/rpc/client-inl.h | 2 | ||||
-rw-r--r-- | yt/yt/core/rpc/client.cpp | 7 | ||||
-rw-r--r-- | yt/yt/core/rpc/client.h | 8 | ||||
-rw-r--r-- | yt/yt/core/ytree/ypath_client.cpp | 4 | ||||
-rw-r--r-- | yt/yt/core/ytree/ypath_client.h | 2 |
6 files changed, 16 insertions, 9 deletions
diff --git a/yt/yt/core/rpc/bus/channel.cpp b/yt/yt/core/rpc/bus/channel.cpp index 9ee42a06b1b..47f6f0f3f80 100644 --- a/yt/yt/core/rpc/bus/channel.cpp +++ b/yt/yt/core/rpc/bus/channel.cpp @@ -889,7 +889,7 @@ private: Bus_->GetEndpointDescription(), GetMessageBodySize(requestMessage), GetTotalMessageAttachmentSize(requestMessage), - request->GetRequestInfo() ? std::string(Format(", %v", *request->GetRequestInfo())) : std::string()); + !request->GetRequestInfo().empty() ? std::string(Format(", %v", request->GetRequestInfo())) : std::string()); } diff --git a/yt/yt/core/rpc/client-inl.h b/yt/yt/core/rpc/client-inl.h index 112642b00c4..b8218486f01 100644 --- a/yt/yt/core/rpc/client-inl.h +++ b/yt/yt/core/rpc/client-inl.h @@ -40,7 +40,7 @@ void IClientRequest::RequireServerFeature(E featureId) template <class... TArgs> void TClientRequest::SetRequestInfo(TFormatString<TArgs...> format, TArgs&&... args) { - RequestInfo_ = Format(format, std::forward<TArgs>(args)...); + SetRawRequestInfo(Format(format, std::forward<TArgs>(args)...)); } //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/rpc/client.cpp b/yt/yt/core/rpc/client.cpp index 1953601581a..009062a7288 100644 --- a/yt/yt/core/rpc/client.cpp +++ b/yt/yt/core/rpc/client.cpp @@ -219,7 +219,7 @@ std::string TClientRequest::GetMethod() const return FromProto<std::string>(Header_.method()); } -const std::optional<std::string>& TClientRequest::GetRequestInfo() const +const std::string& TClientRequest::GetRequestInfo() const { return RequestInfo_; } @@ -365,6 +365,11 @@ TClientContextPtr TClientRequest::CreateClientContext() MemoryUsageTracker_ ? MemoryUsageTracker_ : Channel_->GetChannelMemoryTracker()); } +void TClientRequest::SetRawRequestInfo(std::string requestInfo) +{ + RequestInfo_ = std::move(requestInfo); +} + void TClientRequest::OnPullRequestAttachmentsStream() { auto payload = RequestAttachmentsStream_->TryPull(); diff --git a/yt/yt/core/rpc/client.h b/yt/yt/core/rpc/client.h index 63a0b40fade..0ac4d05fdf9 100644 --- a/yt/yt/core/rpc/client.h +++ b/yt/yt/core/rpc/client.h @@ -63,7 +63,7 @@ struct IClientRequest virtual std::string GetService() const = 0; virtual std::string GetMethod() const = 0; - virtual const std::optional<std::string>& GetRequestInfo() const = 0; + virtual const std::string& GetRequestInfo() const = 0; virtual void DeclareClientFeature(int featureId) = 0; virtual void RequireServerFeature(int featureId) = 0; @@ -179,7 +179,7 @@ public: template <class... TArgs> void SetRequestInfo(TFormatString<TArgs...> format, TArgs&&... args); - const std::optional<std::string>& GetRequestInfo() const override; + const std::string& GetRequestInfo() const override; using NRpc::IClientRequest::DeclareClientFeature; using NRpc::IClientRequest::RequireServerFeature; @@ -255,10 +255,12 @@ private: std::string User_; std::string UserTag_; - std::optional<std::string> RequestInfo_; + std::string RequestInfo_; TWeakPtr<IClientRequestControl> RequestControl_; + void SetRawRequestInfo(std::string requestInfo); + void OnPullRequestAttachmentsStream(); void OnRequestStreamingPayloadAcked(int sequenceNumber, const TError& error); void OnResponseAttachmentsStreamRead(); diff --git a/yt/yt/core/ytree/ypath_client.cpp b/yt/yt/core/ytree/ypath_client.cpp index c9cc57a7531..903d06ea746 100644 --- a/yt/yt/core/ytree/ypath_client.cpp +++ b/yt/yt/core/ytree/ypath_client.cpp @@ -77,9 +77,9 @@ std::string TYPathRequest::GetService() const return FromProto<std::string>(Header_.service()); } -const std::optional<std::string>& TYPathRequest::GetRequestInfo() const +const std::string& TYPathRequest::GetRequestInfo() const { - static const std::optional<std::string> Empty = std::nullopt; + static const std::string Empty; return Empty; } diff --git a/yt/yt/core/ytree/ypath_client.h b/yt/yt/core/ytree/ypath_client.h index 02ab95b2e40..cf656fe9101 100644 --- a/yt/yt/core/ytree/ypath_client.h +++ b/yt/yt/core/ytree/ypath_client.h @@ -34,7 +34,7 @@ public: NRpc::TRealmId GetRealmId() const override; std::string GetMethod() const override; std::string GetService() const override; - const std::optional<std::string>& GetRequestInfo() const override; + const std::string& GetRequestInfo() const override; using NRpc::IClientRequest::DeclareClientFeature; using NRpc::IClientRequest::RequireServerFeature; |