aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-11-20 00:04:16 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-11-20 00:15:13 +0300
commit2d7f47ec6d7a64db0d99e6c70f8515eeae364c07 (patch)
treea1862c6d7bc3e5e11cc844b2e5672574f5907081
parent5d885b87d95d69c68611be5aef800f5ff90f42a8 (diff)
downloadydb-2d7f47ec6d7a64db0d99e6c70f8515eeae364c07.tar.gz
Intermediate changes
commit_hash:032737595139b2cf9c9ffdb1c8fd20846852fc6d
-rw-r--r--yt/yt/client/cache/rpc.cpp6
-rw-r--r--yt/yt/client/cache/rpc.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/yt/yt/client/cache/rpc.cpp b/yt/yt/client/cache/rpc.cpp
index da0200d5fc..025d223acf 100644
--- a/yt/yt/client/cache/rpc.cpp
+++ b/yt/yt/client/cache/rpc.cpp
@@ -68,12 +68,12 @@ NApi::IClientPtr CreateClient(TStringBuf clusterUrl)
return CreateClient(clusterUrl, NApi::GetClientOptionsFromEnvStatic());
}
-NApi::IClientPtr CreateClient(TStringBuf cluster, TStringBuf proxyRole)
+NApi::IClientPtr CreateClient(TStringBuf cluster, std::optional<TStringBuf> proxyRole)
{
auto config = New<NApi::NRpcProxy::TConnectionConfig>();
config->ClusterUrl = ToString(cluster);
- if (!proxyRole.empty()) {
- config->ProxyRole = ToString(proxyRole);
+ if (proxyRole && !proxyRole->empty()) {
+ config->ProxyRole = ToString(*proxyRole);
}
config->Postprocess();
return CreateClient(config);
diff --git a/yt/yt/client/cache/rpc.h b/yt/yt/client/cache/rpc.h
index c2a844bb50..06cb3815e2 100644
--- a/yt/yt/client/cache/rpc.h
+++ b/yt/yt/client/cache/rpc.h
@@ -27,7 +27,7 @@ NApi::IClientPtr CreateClient(const NApi::NRpcProxy::TConnectionConfigPtr& confi
NApi::IClientPtr CreateClient(TStringBuf clusterUrl);
//! Allows to specify proxyRole as dedicated option.
-NApi::IClientPtr CreateClient(TStringBuf cluster, TStringBuf proxyRole);
+NApi::IClientPtr CreateClient(TStringBuf cluster, std::optional<TStringBuf> proxyRole);
//! Shortcut to create client with default config and options from env variables (use env:YT_PROXY as serverName).
NApi::IClientPtr CreateClient();