aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhiddenpath <hiddenpath@yandex-team.com>2025-03-25 15:34:35 +0300
committerhiddenpath <hiddenpath@yandex-team.com>2025-03-25 15:51:29 +0300
commite3fd8dfac36fb164abdd8b5219b148c6c9d15766 (patch)
treedc7333ee5c52fcb5fd7f42e3982130bbb5235fff
parent57c8fd26cffde1b13b7aae3eede09c4e6678d805 (diff)
downloadydb-e3fd8dfac36fb164abdd8b5219b148c6c9d15766.tar.gz
Split YT_PROXY_ROLE into http and rpc options
commit_hash:cc2686061c43671c755570899d39e082199e6879
-rw-r--r--yt/cpp/mapreduce/client/client.cpp8
-rw-r--r--yt/cpp/mapreduce/http/context.cpp2
-rw-r--r--yt/cpp/mapreduce/http/context.h2
-rw-r--r--yt/cpp/mapreduce/interface/config.cpp6
-rw-r--r--yt/cpp/mapreduce/interface/config.h10
5 files changed, 19 insertions, 9 deletions
diff --git a/yt/cpp/mapreduce/client/client.cpp b/yt/cpp/mapreduce/client/client.cpp
index 7e9ebd94599..8c6cd72cf77 100644
--- a/yt/cpp/mapreduce/client/client.cpp
+++ b/yt/cpp/mapreduce/client/client.cpp
@@ -1568,9 +1568,11 @@ TClientContext CreateClientContext(
SetupClusterContext(context, serverName);
- if (context.Config->ProxyRole && context.Config->Hosts == "hosts") {
- context.ProxyRole = context.Config->ProxyRole;
- context.Config->Hosts = "hosts?role=" + *context.ProxyRole;
+ if (context.Config->HttpProxyRole && context.Config->Hosts == DefaultHosts) {
+ context.Config->Hosts = "hosts?role=" + context.Config->HttpProxyRole;
+ }
+ if (context.Config->RpcProxyRole) {
+ context.RpcProxyRole = context.Config->RpcProxyRole;
}
if (context.UseTLS || options.UseCoreHttpClient_) {
diff --git a/yt/cpp/mapreduce/http/context.cpp b/yt/cpp/mapreduce/http/context.cpp
index 531950c39e4..05dbce0a2e3 100644
--- a/yt/cpp/mapreduce/http/context.cpp
+++ b/yt/cpp/mapreduce/http/context.cpp
@@ -14,7 +14,7 @@ bool operator==(const TClientContext& lhs, const TClientContext& rhs)
lhs.UseTLS == rhs.UseTLS &&
lhs.TvmOnly == rhs.TvmOnly &&
lhs.ProxyAddress == rhs.ProxyAddress &&
- lhs.ProxyRole == rhs.ProxyRole;
+ lhs.RpcProxyRole == rhs.RpcProxyRole;
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/cpp/mapreduce/http/context.h b/yt/cpp/mapreduce/http/context.h
index 4559cfd5875..20c8eb55ce3 100644
--- a/yt/cpp/mapreduce/http/context.h
+++ b/yt/cpp/mapreduce/http/context.h
@@ -22,7 +22,7 @@ struct TClientContext
bool UseTLS = false;
TConfigPtr Config = TConfig::Get();
TMaybe<TString> ProxyAddress;
- TMaybe<TString> ProxyRole;
+ TMaybe<TString> RpcProxyRole;
};
bool operator==(const TClientContext& lhs, const TClientContext& rhs);
diff --git a/yt/cpp/mapreduce/interface/config.cpp b/yt/cpp/mapreduce/interface/config.cpp
index 8a579c6a321..bc517eaea21 100644
--- a/yt/cpp/mapreduce/interface/config.cpp
+++ b/yt/cpp/mapreduce/interface/config.cpp
@@ -26,6 +26,7 @@
namespace NYT {
+const TString DefaultHosts = "hosts";
const TString DefaultRemoteTempTablesDirectory = "//tmp/yt_wrapper/table_storage";
const TString DefaultRemoteTempFilesDirectory = "//tmp/yt_wrapper/file_storage";
@@ -191,7 +192,7 @@ void TConfig::LoadTimings()
void TConfig::Reset()
{
- Hosts = GetEnv("YT_HOSTS", "hosts");
+ Hosts = GetEnv("YT_HOSTS", DefaultHosts);
Pool = GetEnv("YT_POOL");
Prefix = GetEnv("YT_PREFIX");
ApiVersion = GetEnv("YT_VERSION", "v3");
@@ -199,7 +200,8 @@ void TConfig::Reset()
LogPath = GetEnv("YT_LOG_PATH");
LogUseCore = GetBool("YT_LOG_USE_CORE", false);
- ProxyRole = GetEnv("YT_PROXY_ROLE");
+ HttpProxyRole = GetEnv("YT_HTTP_PROXY_ROLE");
+ RpcProxyRole = GetEnv("YT_RPC_PROXY_ROLE");
ContentEncoding = GetEncoding("YT_CONTENT_ENCODING");
AcceptEncoding = GetEncoding("YT_ACCEPT_ENCODING");
diff --git a/yt/cpp/mapreduce/interface/config.h b/yt/cpp/mapreduce/interface/config.h
index dd08ae62a3d..d6108915f7c 100644
--- a/yt/cpp/mapreduce/interface/config.h
+++ b/yt/cpp/mapreduce/interface/config.h
@@ -17,6 +17,7 @@ namespace NYT {
////////////////////////////////////////////////////////////////////////////////
+extern const TString DefaultHosts;
extern const TString DefaultRemoteTempTablesDirectory;
extern const TString DefaultRemoteTempFilesDirectory;
@@ -89,8 +90,13 @@ struct TConfig
TString LogPath;
THashSet<TString> LogExcludeCategories = {"Bus", "Net", "Dns", "Concurrency"};
- // NB: If the "Hosts" config option is set, it is assumed to take priority over the proxy role.
- TString ProxyRole;
+ /// @brief Represents the role involved in HTTP proxy configuration.
+ ///
+ /// @note If the "Hosts" configuration option is specified, it is given priority over the HTTP proxy role.
+ TString HttpProxyRole;
+
+ /// @brief Represents the role involved in RPC proxy configuration.
+ TString RpcProxyRole;
///
/// For historical reasons mapreduce client uses its own logging system.