diff options
author | msherbakov <msherbakov@yandex-team.ru> | 2022-02-10 16:49:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:17 +0300 |
commit | a0ffafe83b7d6229709a32fa942c71d672ac989c (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/grpc/client | |
parent | c224a621661ddd69699f9476922eb316607ef57e (diff) | |
download | ydb-a0ffafe83b7d6229709a32fa942c71d672ac989c.tar.gz |
Restoring authorship annotation for <msherbakov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/grpc/client')
-rw-r--r-- | library/cpp/grpc/client/grpc_client_low.cpp | 4 | ||||
-rw-r--r-- | library/cpp/grpc/client/grpc_client_low.h | 4 | ||||
-rw-r--r-- | library/cpp/grpc/client/grpc_common.h | 28 |
3 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/grpc/client/grpc_client_low.cpp b/library/cpp/grpc/client/grpc_client_low.cpp index b2d0ea6eb2..73cc908ef8 100644 --- a/library/cpp/grpc/client/grpc_client_low.cpp +++ b/library/cpp/grpc/client/grpc_client_low.cpp @@ -15,7 +15,7 @@ #include <netinet/tcp.h> #endif -namespace NGrpc { +namespace NGrpc { void EnableGRpcTracing() { grpc_tracer_set_enabled("tcp", true); @@ -583,4 +583,4 @@ void TGRpcClientLow::ForgetContext(TContextImpl* context) { } } -} // namespace NGRpc +} // namespace NGRpc diff --git a/library/cpp/grpc/client/grpc_client_low.h b/library/cpp/grpc/client/grpc_client_low.h index e2a80e624e..ab0a0627be 100644 --- a/library/cpp/grpc/client/grpc_client_low.h +++ b/library/cpp/grpc/client/grpc_client_low.h @@ -21,7 +21,7 @@ * This file contains low level logic for grpc * This file should not be used in high level code without special reason */ -namespace NGrpc { +namespace NGrpc { const size_t DEFAULT_NUM_THREADS = 2; @@ -1396,4 +1396,4 @@ private: std::mutex JoinMutex_; }; -} // namespace NGRpc +} // namespace NGRpc diff --git a/library/cpp/grpc/client/grpc_common.h b/library/cpp/grpc/client/grpc_common.h index 12a3f7c28e..ffcdafe045 100644 --- a/library/cpp/grpc/client/grpc_common.h +++ b/library/cpp/grpc/client/grpc_common.h @@ -1,7 +1,7 @@ #pragma once #include <grpc++/grpc++.h> -#include <grpc++/resource_quota.h> +#include <grpc++/resource_quota.h> #include <util/datetime/base.h> #include <unordered_map> @@ -9,19 +9,19 @@ constexpr ui64 DEFAULT_GRPC_MESSAGE_SIZE_LIMIT = 64000000; -namespace NGrpc { +namespace NGrpc { struct TGRpcClientConfig { TString Locator; // format host:port TDuration Timeout = TDuration::Max(); // request timeout ui64 MaxMessageSize = DEFAULT_GRPC_MESSAGE_SIZE_LIMIT; // Max request and response size - ui64 MaxInboundMessageSize = 0; // overrides MaxMessageSize for incoming requests - ui64 MaxOutboundMessageSize = 0; // overrides MaxMessageSize for outgoing requests + ui64 MaxInboundMessageSize = 0; // overrides MaxMessageSize for incoming requests + ui64 MaxOutboundMessageSize = 0; // overrides MaxMessageSize for outgoing requests ui32 MaxInFlight = 0; bool EnableSsl = false; TString SslCaCert; //Implicitly enables Ssl if not empty grpc_compression_algorithm CompressionAlgoritm = GRPC_COMPRESS_NONE; - ui64 MemQuota = 0; + ui64 MemQuota = 0; std::unordered_map<TString, TString> StringChannelParams; std::unordered_map<TString, int> IntChannelParams; TString LoadBalancingPolicy = { }; @@ -48,10 +48,10 @@ struct TGRpcClientConfig { inline std::shared_ptr<grpc::ChannelInterface> CreateChannelInterface(const TGRpcClientConfig& config, grpc_socket_mutator* mutator = nullptr){ grpc::ChannelArguments args; - args.SetMaxReceiveMessageSize(config.MaxInboundMessageSize ? config.MaxInboundMessageSize : config.MaxMessageSize); - args.SetMaxSendMessageSize(config.MaxOutboundMessageSize ? config.MaxOutboundMessageSize : config.MaxMessageSize); + args.SetMaxReceiveMessageSize(config.MaxInboundMessageSize ? config.MaxInboundMessageSize : config.MaxMessageSize); + args.SetMaxSendMessageSize(config.MaxOutboundMessageSize ? config.MaxOutboundMessageSize : config.MaxMessageSize); args.SetCompressionAlgorithm(config.CompressionAlgoritm); - + for (const auto& kvp: config.StringChannelParams) { args.SetString(kvp.first, kvp.second); } @@ -60,11 +60,11 @@ inline std::shared_ptr<grpc::ChannelInterface> CreateChannelInterface(const TGRp args.SetInt(kvp.first, kvp.second); } - if (config.MemQuota) { - grpc::ResourceQuota quota; - quota.Resize(config.MemQuota); - args.SetResourceQuota(quota); - } + if (config.MemQuota) { + grpc::ResourceQuota quota; + quota.Resize(config.MemQuota); + args.SetResourceQuota(quota); + } if (mutator) { args.SetSocketMutator(mutator); } @@ -81,4 +81,4 @@ inline std::shared_ptr<grpc::ChannelInterface> CreateChannelInterface(const TGRp } } -} // namespace NGRpc +} // namespace NGRpc |