aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.com>2025-03-02 13:51:05 +0300
committerbabenko <babenko@yandex-team.com>2025-03-02 14:06:42 +0300
commit6678165e016ba474f1b8dd6d49af92b0d46350b9 (patch)
tree3c2c518de46ea7af84f72095178455dad1a99fc8
parentcc146d6998417dbfbfcdce7c65f522e276b44af0 (diff)
downloadydb-6678165e016ba474f1b8dd6d49af92b0d46350b9.tar.gz
Merge EProxyType and EProxyKind
commit_hash:89c30066a27f224f5135879027b1ebab9cb47715
-rw-r--r--yt/yt/client/api/public.h2
-rw-r--r--yt/yt/client/driver/etc_commands.cpp9
-rw-r--r--yt/yt/client/driver/etc_commands.h2
-rw-r--r--yt/yt/client/driver/proxy_discovery_cache.cpp16
-rw-r--r--yt/yt/client/driver/proxy_discovery_cache.h2
-rw-r--r--yt/yt/client/security_client/public.h6
6 files changed, 16 insertions, 21 deletions
diff --git a/yt/yt/client/api/public.h b/yt/yt/client/api/public.h
index d289f6c9b7..20cfb6a553 100644
--- a/yt/yt/client/api/public.h
+++ b/yt/yt/client/api/public.h
@@ -84,7 +84,7 @@ DEFINE_ENUM(ETransactionCoordinatorPrepareMode,
((Late) (1))
);
-DEFINE_ENUM(EProxyType,
+DEFINE_ENUM(EProxyKind,
((Http) (1))
((Rpc) (2))
((Grpc) (3))
diff --git a/yt/yt/client/driver/etc_commands.cpp b/yt/yt/client/driver/etc_commands.cpp
index c1267fdcdb..debe2a3ffc 100644
--- a/yt/yt/client/driver/etc_commands.cpp
+++ b/yt/yt/client/driver/etc_commands.cpp
@@ -408,8 +408,9 @@ void TExecuteBatchCommand::DoExecute(ICommandContextPtr context)
void TDiscoverProxiesCommand::Register(TRegistrar registrar)
{
- registrar.Parameter("type", &TThis::Type)
- .Default(EProxyType::Rpc);
+ registrar.Parameter("kind", &TThis::Kind)
+ .Alias("type")
+ .Default(EProxyKind::Rpc);
registrar.Parameter("role", &TThis::Role)
.Default(DefaultRpcProxyRole);
registrar.Parameter("address_type", &TThis::AddressType)
@@ -423,11 +424,11 @@ void TDiscoverProxiesCommand::Register(TRegistrar registrar)
void TDiscoverProxiesCommand::DoExecute(ICommandContextPtr context)
{
TProxyDiscoveryRequest request{
- .Type = Type,
+ .Kind = Kind,
.Role = Role,
.AddressType = AddressType,
.NetworkName = NetworkName,
- .IgnoreBalancers = IgnoreBalancers
+ .IgnoreBalancers = IgnoreBalancers,
};
const auto& proxyDiscoveryCache = context->GetDriver()->GetProxyDiscoveryCache();
diff --git a/yt/yt/client/driver/etc_commands.h b/yt/yt/client/driver/etc_commands.h
index 789f8690d4..f51670a95e 100644
--- a/yt/yt/client/driver/etc_commands.h
+++ b/yt/yt/client/driver/etc_commands.h
@@ -230,7 +230,7 @@ public:
static void Register(TRegistrar registrar);
private:
- NApi::EProxyType Type;
+ NApi::EProxyKind Kind;
std::string Role;
NApi::NRpcProxy::EAddressType AddressType;
std::string NetworkName;
diff --git a/yt/yt/client/driver/proxy_discovery_cache.cpp b/yt/yt/client/driver/proxy_discovery_cache.cpp
index a9612bb359..e025f59105 100644
--- a/yt/yt/client/driver/proxy_discovery_cache.cpp
+++ b/yt/yt/client/driver/proxy_discovery_cache.cpp
@@ -26,7 +26,7 @@ using namespace NApi::NRpcProxy;
TProxyDiscoveryRequest::operator size_t() const
{
return MultiHash(
- Type,
+ Kind,
Role,
AddressType,
NetworkName,
@@ -37,8 +37,8 @@ TProxyDiscoveryRequest::operator size_t() const
void FormatValue(TStringBuilderBase* builder, const TProxyDiscoveryRequest& request, TStringBuf /*spec*/)
{
- builder->AppendFormat("{Type: %v, Role: %v, AddressType: %v, NetworkName: %v, IgnoreBalancers: %v}",
- request.Type,
+ builder->AppendFormat("{Kind: %v, Role: %v, AddressType: %v, NetworkName: %v, IgnoreBalancers: %v}",
+ request.Kind,
request.Role,
request.AddressType,
request.NetworkName,
@@ -97,7 +97,7 @@ private:
TYPath path;
try {
- path = GetProxyRegistryPath(request.Type) + "/@";
+ path = GetProxyRegistryPath(request.Kind) + "/@";
} catch (const std::exception& ex) {
YT_LOG_ERROR(ex, "Failed to get proxy registry path");
return MakeFuture<std::optional<TProxyDiscoveryResponse>>(ex);
@@ -130,7 +130,7 @@ private:
TYPath path;
try {
- path = GetProxyRegistryPath(request.Type);
+ path = GetProxyRegistryPath(request.Kind);
} catch (const std::exception& ex) {
YT_LOG_ERROR(ex, "Failed to get proxy registry path");
return MakeFuture<TProxyDiscoveryResponse>(ex);
@@ -168,12 +168,12 @@ private:
}
- static TYPath GetProxyRegistryPath(EProxyType type)
+ static TYPath GetProxyRegistryPath(EProxyKind type)
{
switch (type) {
- case EProxyType::Rpc:
+ case EProxyKind::Rpc:
return RpcProxiesPath;
- case EProxyType::Grpc:
+ case EProxyKind::Grpc:
return GrpcProxiesPath;
default:
THROW_ERROR_EXCEPTION("Proxy type %Qlv is not supported",
diff --git a/yt/yt/client/driver/proxy_discovery_cache.h b/yt/yt/client/driver/proxy_discovery_cache.h
index 9564dbdf67..814e440bd4 100644
--- a/yt/yt/client/driver/proxy_discovery_cache.h
+++ b/yt/yt/client/driver/proxy_discovery_cache.h
@@ -14,7 +14,7 @@ namespace NYT::NDriver {
struct TProxyDiscoveryRequest
{
- NApi::EProxyType Type;
+ NApi::EProxyKind Kind = NApi::EProxyKind::Rpc;
std::string Role = NApi::DefaultRpcProxyRole;
NApi::NRpcProxy::EAddressType AddressType = NApi::NRpcProxy::DefaultAddressType;
std::string NetworkName = NApi::NRpcProxy::DefaultNetworkName;
diff --git a/yt/yt/client/security_client/public.h b/yt/yt/client/security_client/public.h
index 2bb6eaeffb..420aaab50b 100644
--- a/yt/yt/client/security_client/public.h
+++ b/yt/yt/client/security_client/public.h
@@ -76,12 +76,6 @@ YT_DEFINE_ERROR_ENUM(
((IrreversibleAclModification) (909))
);
-// NB: Changing this list requires reign promotion.
-DEFINE_ENUM(EProxyKind,
- ((Http) (1))
- ((Rpc) (2))
-);
-
DEFINE_ENUM(EAccessControlObjectNamespace,
(AdminCommands)
);