aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2023-09-29 20:14:55 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2023-09-29 23:07:46 +0300
commit2021044a4be8d9ab35bfa6c54c7db848c888efca (patch)
tree887eb65dad263e4cf04b7c02a7e4b6b124ff1992
parent26791e84bc7a83160afd1eb15be36b77a8f281ce (diff)
downloadydb-2021044a4be8d9ab35bfa6c54c7db848c888efca.tar.gz
Intermediate changes
-rw-r--r--yt/yt/client/cache/cache_base.cpp6
-rw-r--r--yt/yt/client/cache/rpc.cpp2
-rw-r--r--yt/yt/client/federated/cache.cpp14
-rw-r--r--yt/yt/client/federated/unittests/cache_ut.cpp3
-rw-r--r--yt/yt/client/hedging/cache.h4
5 files changed, 25 insertions, 4 deletions
diff --git a/yt/yt/client/cache/cache_base.cpp b/yt/yt/client/cache/cache_base.cpp
index ea8833b592..2528ea03ea 100644
--- a/yt/yt/client/cache/cache_base.cpp
+++ b/yt/yt/client/cache/cache_base.cpp
@@ -16,8 +16,10 @@ NApi::IClientPtr TClientsCacheBase::GetClient(TStringBuf clusterUrl)
auto client = CreateClient(clusterUrl);
- auto guard = WriterGuard(Lock_);
- return Clients_.try_emplace(clusterUrl, client).first->second;
+ {
+ auto guard = WriterGuard(Lock_);
+ return Clients_.try_emplace(clusterUrl, client).first->second;
+ }
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/client/cache/rpc.cpp b/yt/yt/client/cache/rpc.cpp
index 4557ea044a..ed0fc21450 100644
--- a/yt/yt/client/cache/rpc.cpp
+++ b/yt/yt/client/cache/rpc.cpp
@@ -14,6 +14,8 @@
namespace NYT::NClient::NCache {
+////////////////////////////////////////////////////////////////////////////////
+
NCompression::ECodec GetResponseCodecFromProto(const ECompressionCodec& protoCodec)
{
switch (protoCodec) {
diff --git a/yt/yt/client/federated/cache.cpp b/yt/yt/client/federated/cache.cpp
index ab64ca070a..d3223c620e 100644
--- a/yt/yt/client/federated/cache.cpp
+++ b/yt/yt/client/federated/cache.cpp
@@ -26,7 +26,7 @@ public:
, Options_(std::move(options))
, FederationConfig_(std::move(federationConfig))
, ClusterSeparator_(std::move(clusterSeparator))
- {}
+ {}
protected:
NApi::IClientPtr CreateClient(TStringBuf clusterUrl) override
@@ -104,6 +104,18 @@ IClientsCachePtr CreateFederatedClientsCache(
}
IClientsCachePtr CreateFederatedClientsCache(
+ const TConfig& config,
+ TString chaosBundleName,
+ TString clusterSeparator)
+{
+ return CreateFederatedClientsCache(
+ config,
+ NCache::GetClientOpsFromEnvStatic(),
+ std::move(chaosBundleName),
+ std::move(clusterSeparator));
+}
+
+IClientsCachePtr CreateFederatedClientsCache(
TString chaosBundleName,
TString clusterSeparator)
{
diff --git a/yt/yt/client/federated/unittests/cache_ut.cpp b/yt/yt/client/federated/unittests/cache_ut.cpp
index 10be390ecb..d4ef45ffb7 100644
--- a/yt/yt/client/federated/unittests/cache_ut.cpp
+++ b/yt/yt/client/federated/unittests/cache_ut.cpp
@@ -13,7 +13,8 @@ using namespace NYT::NApi;
////////////////////////////////////////////////////////////////////////////////
-TEST(TFederatedClientsCacheTest, GetSameClient) {
+TEST(TFederatedClientsCacheTest, GetSameClient)
+{
SetEnv("YT_TOKEN", "AAAA-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
auto cache = CreateFederatedClientsCache("my_bundle");
auto client1 = cache->GetClient("localhost");
diff --git a/yt/yt/client/hedging/cache.h b/yt/yt/client/hedging/cache.h
index e635e80b2a..8ec59fb2ae 100644
--- a/yt/yt/client/hedging/cache.h
+++ b/yt/yt/client/hedging/cache.h
@@ -11,8 +11,12 @@
namespace NYT::NClient::NHedging::NRpc {
+////////////////////////////////////////////////////////////////////////////////
+
using NCache::TConfig;
using NCache::TClustersConfig;
using NCache::CreateClientsCache;
+////////////////////////////////////////////////////////////////////////////////
+
} // namespace NYT::NClient::NHedging::NRpc