diff options
| author | ubyte <[email protected]> | 2026-07-20 14:05:46 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-07-20 16:05:46 +0500 |
| commit | c83752fba3519ae6bd1036c6c8b62899de4f72bd (patch) | |
| tree | 9af324f63024ce32e18d855d6d5fe71c275cacee | |
| parent | 097f4a8c731660395630f7a9d785c2aa63c10db0 (diff) | |
return joined list of services (#46793)
KIKIMR-16431
| -rw-r--r-- | ydb/core/driver_lib/run/kikimr_services_initializers.cpp | 23 | ||||
| -rw-r--r-- | ydb/core/driver_lib/run/ya.make | 1 |
2 files changed, 21 insertions, 3 deletions
diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp index b6679a5f584..fe1e6570650 100644 --- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp +++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp @@ -272,6 +272,7 @@ #include <ydb/core/graph/api/service.h> #include <ydb/core/graph/api/shard.h> +#include <library/cpp/containers/absl/btree_set.h> #include <library/cpp/logger/global/global.h> #include <library/cpp/logger/log.h> @@ -1887,6 +1888,22 @@ TGRpcServicesInitializer::TGRpcServicesInitializer( , Factories(factories) {} +static void JoinServicesListTo(TVector<TString>& dst, const NKikimrConfig::TGRpcConfig& config) { + if ((config.ServicesSize() == 0 || config.ServicesEnabledSize() == 0) + && config.ServicesDisabledSize() == 0) { // sets are disjoint + dst.insert(dst.end(), config.GetServices().begin(), config.GetServices().end()); + dst.insert(dst.end(), config.GetServicesEnabled().begin(), config.GetServicesEnabled().end()); + return; + } + absl::btree_set<TString> resultSet; + resultSet.insert(config.GetServices().begin(), config.GetServices().end()); + resultSet.insert(config.GetServicesEnabled().begin(), config.GetServicesEnabled().end()); + for (const auto& service : config.GetServicesDisabled()) { + resultSet.erase(service); + } + dst.insert(dst.end(), resultSet.begin(), resultSet.end()); +} + void TGRpcServicesInitializer::InitializeServices(NActors::TActorSystemSetup* setup, const NKikimr::TAppData* appData) { @@ -1971,7 +1988,7 @@ void TGRpcServicesInitializer::InitializeServices(NActors::TActorSystemSetup* se stringsFromProto(desc->AddressesV4, config.GetPublicAddressesV4()); stringsFromProto(desc->AddressesV6, config.GetPublicAddressesV6()); - desc->ServedServices.insert(desc->ServedServices.end(), config.GetServices().begin(), config.GetServices().end()); + JoinServicesListTo(desc->ServedServices, config); if (config.HasEndpointId()) { desc->EndpointId = config.GetEndpointId(); } @@ -1988,7 +2005,7 @@ void TGRpcServicesInitializer::InitializeServices(NActors::TActorSystemSetup* se stringsFromProto(desc->AddressesV6, config.GetPublicAddressesV6()); desc->TargetNameOverride = config.GetPublicTargetNameOverride(); - desc->ServedServices.insert(desc->ServedServices.end(), config.GetServices().begin(), config.GetServices().end()); + JoinServicesListTo(desc->ServedServices, config); if (config.HasEndpointId()) { desc->EndpointId = config.GetEndpointId(); } @@ -2018,7 +2035,7 @@ void TGRpcServicesInitializer::InitializeServices(NActors::TActorSystemSetup* se stringsFromProto(desc->AddressesV4, sx.GetPublicAddressesV4()); stringsFromProto(desc->AddressesV6, sx.GetPublicAddressesV6()); - desc->ServedServices.insert(desc->ServedServices.end(), sx.GetServices().begin(), sx.GetServices().end()); + JoinServicesListTo(desc->ServedServices, sx); if (sx.HasEndpointId()) { desc->EndpointId = sx.GetEndpointId(); } diff --git a/ydb/core/driver_lib/run/ya.make b/ydb/core/driver_lib/run/ya.make index 7206f44b8d2..ad8c280ef8f 100644 --- a/ydb/core/driver_lib/run/ya.make +++ b/ydb/core/driver_lib/run/ya.make @@ -26,6 +26,7 @@ SRCS( PEERDIR( contrib/libs/protobuf + library/cpp/containers/absl library/cpp/getopt/small library/cpp/logger library/cpp/malloc/api |
