diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2023-08-24 11:49:47 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-08-24 12:00:19 +0300 |
commit | 42c2d9c8d8eb9f477b0f1933f64cd14678c00bc3 (patch) | |
tree | f36a51e63ee0e578b1500d7b4429799762e4a723 | |
parent | 231316331fffaf4dbe8386ae274e185ca89324b0 (diff) | |
download | ydb-42c2d9c8d8eb9f477b0f1933f64cd14678c00bc3.tar.gz |
Intermediate changes
-rw-r--r-- | yt/yt/client/hedging/cache.h | 20 | ||||
-rw-r--r-- | yt/yt/client/hedging/rpc.h | 8 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/cache/proto/config.proto | 48 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/cache/ya.make | 11 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/hedging/proto/config.proto | 45 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/hedging/ya.make | 5 |
6 files changed, 90 insertions, 47 deletions
diff --git a/yt/yt/client/hedging/cache.h b/yt/yt/client/hedging/cache.h index e957cecc7e..ebfbb715d2 100644 --- a/yt/yt/client/hedging/cache.h +++ b/yt/yt/client/hedging/cache.h @@ -6,10 +6,26 @@ #include <util/generic/strbuf.h> + +namespace NYT::NClient::NCache { + +//////////////////////////////////////////////////////////////////////////////// + + class TConfig; + class TClustersConfig; + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT::NClient::NCache + +//////////////////////////////////////////////////////////////////////////////// + namespace NYT::NClient::NHedging::NRpc { -class TConfig; -class TClustersConfig; +//////////////////////////////////////////////////////////////////////////////// + +using NYT::NClient::NCache::TConfig; +using NYT::NClient::NCache::TClustersConfig; //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/hedging/rpc.h b/yt/yt/client/hedging/rpc.h index 102e6b6791..1e573e84fa 100644 --- a/yt/yt/client/hedging/rpc.h +++ b/yt/yt/client/hedging/rpc.h @@ -3,6 +3,8 @@ #include <yt/yt/client/api/public.h> #include <yt/yt/client/api/rpc_proxy/config.h> +#include <yt/yt_proto/yt/client/hedging/proto/config.pb.h> + #include <util/generic/strbuf.h> @@ -10,7 +12,11 @@ namespace NYT::NClient::NHedging::NRpc { //////////////////////////////////////////////////////////////////////////////// -class TConfig; +using NYT::NClient::NCache::TConfig; +using NYT::NClient::NCache::TClustersConfig; +using NYT::NClient::NCache::ECompressionCodec; + +//////////////////////////////////////////////////////////////////////////////// NApi::NRpcProxy::TConnectionConfigPtr GetConnectionConfig(const TConfig& config); diff --git a/yt/yt_proto/yt/client/cache/proto/config.proto b/yt/yt_proto/yt/client/cache/proto/config.proto new file mode 100644 index 0000000000..9fcc31fdd2 --- /dev/null +++ b/yt/yt_proto/yt/client/cache/proto/config.proto @@ -0,0 +1,48 @@ +package NYT.NClient.NCache; + +import "yt_proto/yt/core/yson/proto/protobuf_interop.proto"; + +option (NYT.NYson.NProto.derive_underscore_case_names) = true; + +enum ECompressionCodec { + None = 0; + Lz4 = 1; +}; + +// Connection options. +message TConfig +{ + optional string ClusterName = 1; + optional string ProxyRole = 2; + optional uint32 ChannelPoolSize = 3; + optional uint32 ChannelPoolRebalanceIntervalSeconds = 4; + + // All timeouts in milliseconds. + optional uint32 DefaultTransactionTimeout = 5; + optional uint32 DefaultSelectRowsTimeout = 6; + optional uint32 DefaultLookupRowsTimeout = 7; + optional uint32 DefaultTotalStreamingTimeout = 8; + optional uint32 DefaultStreamingStallTimeout = 9; + optional uint32 DefaultPingPeriod = 10; + optional uint32 ModifyRowsBatchCapacity = 11; + + optional ECompressionCodec ResponseCodec = 12 [default = None]; + + optional bool EnableRetries = 13; + optional uint32 RetryBackoffTime = 14; + optional uint32 RetryAttempts = 15; + optional uint32 RetryTimeout = 16; +}; + +message TClustersConfig +{ + // In DefaultConfig and ClusterConfigs field .ClusterName is ignored + // and field .ProxyRole can be overwritten with explicitly provided in cluster url one. + + // DefaultConfig is used for clusters not mentioned in ClusterConfigs. + optional TConfig DefaultConfig = 1; + // Per-cluster configs. + map<string, TConfig> ClusterConfigs = 2 [ + (NYT.NYson.NProto.yson_map) = true + ]; +}; diff --git a/yt/yt_proto/yt/client/cache/ya.make b/yt/yt_proto/yt/client/cache/ya.make new file mode 100644 index 0000000000..4c86b0fae3 --- /dev/null +++ b/yt/yt_proto/yt/client/cache/ya.make @@ -0,0 +1,11 @@ +PROTO_LIBRARY(yt-client-cache-proto) + +SRCS( + proto/config.proto +) + +PEERDIR(yt/yt_proto/yt/core) + +EXCLUDE_TAGS(GO_PROTO) + +END() diff --git a/yt/yt_proto/yt/client/hedging/proto/config.proto b/yt/yt_proto/yt/client/hedging/proto/config.proto index c69bad5621..e847da9b73 100644 --- a/yt/yt_proto/yt/client/hedging/proto/config.proto +++ b/yt/yt_proto/yt/client/hedging/proto/config.proto @@ -1,57 +1,16 @@ package NYT.NClient.NHedging.NRpc; +import public "yt/yt_proto/yt/client/cache/proto/config.proto"; import "yt_proto/yt/core/yson/proto/protobuf_interop.proto"; option (NYT.NYson.NProto.derive_underscore_case_names) = true; -enum ECompressionCodec { - None = 0; - Lz4 = 1; -}; - -// Connection options. -message TConfig -{ - optional string ClusterName = 1; - optional string ProxyRole = 2; - optional uint32 ChannelPoolSize = 3; - optional uint32 ChannelPoolRebalanceIntervalSeconds = 4; - - // All timeouts in milliseconds. - optional uint32 DefaultTransactionTimeout = 5; - optional uint32 DefaultSelectRowsTimeout = 6; - optional uint32 DefaultLookupRowsTimeout = 7; - optional uint32 DefaultTotalStreamingTimeout = 8; - optional uint32 DefaultStreamingStallTimeout = 9; - optional uint32 DefaultPingPeriod = 10; - optional uint32 ModifyRowsBatchCapacity = 11; - - optional ECompressionCodec ResponseCodec = 12 [default = None]; - - optional bool EnableRetries = 13; - optional uint32 RetryBackoffTime = 14; - optional uint32 RetryAttempts = 15; - optional uint32 RetryTimeout = 16; -}; - -message TClustersConfig -{ - // In DefaultConfig and ClusterConfigs field .ClusterName is ignored - // and field .ProxyRole can be overwritten with explicitly provided in cluster url one. - - // DefaultConfig is used for clusters not mentioned in ClusterConfigs. - optional TConfig DefaultConfig = 1; - // Per-cluster configs. - map<string, TConfig> ClusterConfigs = 2 [ - (NYT.NYson.NProto.yson_map) = true - ]; -}; message THedgingClientConfig { // All timeouts also in milliseconds. message TClientOptions { - optional TConfig ClientConfig = 1; + optional NYT.NClient.NCache.TConfig ClientConfig = 1; optional uint32 InitialPenalty = 2; }; diff --git a/yt/yt_proto/yt/client/hedging/ya.make b/yt/yt_proto/yt/client/hedging/ya.make index ed37725349..11f73bf7b6 100644 --- a/yt/yt_proto/yt/client/hedging/ya.make +++ b/yt/yt_proto/yt/client/hedging/ya.make @@ -4,7 +4,10 @@ SRCS( proto/config.proto ) -PEERDIR(yt/yt_proto/yt/core) +PEERDIR( + yt/yt_proto/yt/core + yt/yt_proto/yt/client/cache +) EXCLUDE_TAGS(GO_PROTO) |