diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-21 23:16:28 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-21 23:28:51 +0300 |
commit | f5eb715f103692e7c7536e13bef3f281fd78e5e7 (patch) | |
tree | ec69e25f95342837a42d3ef5f42d6a0da410260e | |
parent | ced0661d4db52616fff44357124c3728d810bbe6 (diff) | |
download | ydb-f5eb715f103692e7c7536e13bef3f281fd78e5e7.tar.gz |
Intermediate changes
-rw-r--r-- | yt/yt/core/concurrency/unittests/scheduler_ut.cpp | 12 | ||||
-rw-r--r-- | yt/yt/core/tracing/config.cpp | 2 | ||||
-rw-r--r-- | yt/yt/core/tracing/config.h | 6 | ||||
-rw-r--r-- | yt/yt/core/tracing/public.h | 2 | ||||
-rw-r--r-- | yt/yt/core/tracing/trace_context.cpp | 14 | ||||
-rw-r--r-- | yt/yt/core/tracing/trace_context.h | 4 | ||||
-rw-r--r-- | yt/yt/library/program/config.cpp | 12 | ||||
-rw-r--r-- | yt/yt/library/program/config.h | 21 | ||||
-rw-r--r-- | yt/yt/library/program/helpers.cpp | 12 |
9 files changed, 32 insertions, 53 deletions
diff --git a/yt/yt/core/concurrency/unittests/scheduler_ut.cpp b/yt/yt/core/concurrency/unittests/scheduler_ut.cpp index 80bf31e597..9424918fa0 100644 --- a/yt/yt/core/concurrency/unittests/scheduler_ut.cpp +++ b/yt/yt/core/concurrency/unittests/scheduler_ut.cpp @@ -1042,15 +1042,15 @@ TEST_W(TSchedulerTest, TraceDisableSendBaggage) parentContext->PackBaggage(parentBaggage); auto parentBaggageString = ConvertToYsonString(parentBaggage); - auto originalConfig = GetTracingConfig(); + auto originalConfig = GetTracingTransportConfig(); auto guard = Finally([&] { - SetTracingConfig(originalConfig); + SetTracingTransportConfig(originalConfig); }); { - auto config = New<TTracingConfig>(); + auto config = New<TTracingTransportConfig>(); config->SendBaggage = true; - SetTracingConfig(std::move(config)); + SetTracingTransportConfig(std::move(config)); NTracing::NProto::TTracingExt tracingExt; ToProto(&tracingExt, parentContext); auto traceContext = TTraceContext::NewChildFromRpc(tracingExt, "Span"); @@ -1060,9 +1060,9 @@ TEST_W(TSchedulerTest, TraceDisableSendBaggage) } { - auto config = New<TTracingConfig>(); + auto config = New<TTracingTransportConfig>(); config->SendBaggage = false; - SetTracingConfig(std::move(config)); + SetTracingTransportConfig(std::move(config)); NTracing::NProto::TTracingExt tracingExt; ToProto(&tracingExt, parentContext); auto traceContext = TTraceContext::NewChildFromRpc(tracingExt, "Span"); diff --git a/yt/yt/core/tracing/config.cpp b/yt/yt/core/tracing/config.cpp index 42eee6b053..fc32a1437e 100644 --- a/yt/yt/core/tracing/config.cpp +++ b/yt/yt/core/tracing/config.cpp @@ -4,7 +4,7 @@ namespace NYT::NTracing { //////////////////////////////////////////////////////////////////////////////// -void TTracingConfig::Register(TRegistrar registrar) +void TTracingTransportConfig::Register(TRegistrar registrar) { registrar.Parameter("send_baggage", &TThis::SendBaggage) .Default(true); diff --git a/yt/yt/core/tracing/config.h b/yt/yt/core/tracing/config.h index b8dc889ee4..9221ea9fad 100644 --- a/yt/yt/core/tracing/config.h +++ b/yt/yt/core/tracing/config.h @@ -8,18 +8,18 @@ namespace NYT::NTracing { //////////////////////////////////////////////////////////////////////////////// -class TTracingConfig +class TTracingTransportConfig : public NYTree::TYsonStruct { public: bool SendBaggage; - REGISTER_YSON_STRUCT(TTracingConfig); + REGISTER_YSON_STRUCT(TTracingTransportConfig); static void Register(TRegistrar registrar); }; -DEFINE_REFCOUNTED_TYPE(TTracingConfig) +DEFINE_REFCOUNTED_TYPE(TTracingTransportConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/tracing/public.h b/yt/yt/core/tracing/public.h index f6e8d090b5..6ced43f6b8 100644 --- a/yt/yt/core/tracing/public.h +++ b/yt/yt/core/tracing/public.h @@ -16,7 +16,7 @@ class TTracingExt; DECLARE_REFCOUNTED_CLASS(TTraceContext) -DECLARE_REFCOUNTED_CLASS(TTracingConfig) +DECLARE_REFCOUNTED_CLASS(TTracingTransportConfig) DECLARE_REFCOUNTED_CLASS(TAllocationTags) diff --git a/yt/yt/core/tracing/trace_context.cpp b/yt/yt/core/tracing/trace_context.cpp index 7712c0b8da..fd82e5e245 100644 --- a/yt/yt/core/tracing/trace_context.cpp +++ b/yt/yt/core/tracing/trace_context.cpp @@ -78,22 +78,22 @@ void SetGlobalTracer(const ITracerPtr& tracer) //////////////////////////////////////////////////////////////////////////////// -struct TTracingConfigSingleton +struct TTracingConfigStorage { - TAtomicIntrusivePtr<TTracingConfig> Config{New<TTracingConfig>()}; + TAtomicIntrusivePtr<TTracingTransportConfig> Config{New<TTracingTransportConfig>()}; }; -static TTracingConfigSingleton* GlobalTracingConfig() +static TTracingConfigStorage* GlobalTracingConfig() { - return LeakySingleton<TTracingConfigSingleton>(); + return LeakySingleton<TTracingConfigStorage>(); } -void SetTracingConfig(TTracingConfigPtr config) +void SetTracingTransportConfig(TTracingTransportConfigPtr config) { GlobalTracingConfig()->Config.Store(std::move(config)); } -TTracingConfigPtr GetTracingConfig() +TTracingTransportConfigPtr GetTracingTransportConfig() { return GlobalTracingConfig()->Config.Acquire(); } @@ -627,7 +627,7 @@ void ToProto(NProto::TTracingExt* ext, const TTraceContextPtr& context) if (auto endpoint = context->GetTargetEndpoint()){ ext->set_target_endpoint(endpoint.value()); } - if (GetTracingConfig()->SendBaggage) { + if (GetTracingTransportConfig()->SendBaggage) { if (auto baggage = context->GetBaggage()) { ext->set_baggage(baggage.ToString()); } diff --git a/yt/yt/core/tracing/trace_context.h b/yt/yt/core/tracing/trace_context.h index 9db890d695..957e6d45a2 100644 --- a/yt/yt/core/tracing/trace_context.h +++ b/yt/yt/core/tracing/trace_context.h @@ -42,8 +42,8 @@ ITracerPtr GetGlobalTracer(); //////////////////////////////////////////////////////////////////////////////// -void SetTracingConfig(TTracingConfigPtr config); -TTracingConfigPtr GetTracingConfig(); +void SetTracingTransportConfig(TTracingTransportConfigPtr config); +TTracingTransportConfigPtr GetTracingTransportConfig(); //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/library/program/config.cpp b/yt/yt/library/program/config.cpp index bff7c7ddc3..9e9437bddb 100644 --- a/yt/yt/library/program/config.cpp +++ b/yt/yt/library/program/config.cpp @@ -6,14 +6,6 @@ using namespace NYTree; //////////////////////////////////////////////////////////////////////////////// -void TRpcConfig::Register(TRegistrar registrar) -{ - registrar.Parameter("tracing", &TThis::Tracing) - .Default(); -} - -//////////////////////////////////////////////////////////////////////////////// - void THeapSizeLimit::Register(TRegistrar registrar) { registrar.Parameter("container_memory_ratio", &TThis::ContainerMemoryRatio) @@ -95,7 +87,7 @@ void TSingletonsConfig::Register(TRegistrar registrar) .DefaultCtor([] () { return NLogging::TLogManagerConfig::CreateDefault(); }); registrar.Parameter("jaeger", &TThis::Jaeger) .DefaultNew(); - registrar.Parameter("rpc", &TThis::Rpc) + registrar.Parameter("tracing_transport", &TThis::TracingTransport) .DefaultNew(); registrar.Parameter("tcmalloc", &TThis::TCMalloc) .DefaultNew(); @@ -135,7 +127,7 @@ void TSingletonsDynamicConfig::Register(TRegistrar registrar) .DefaultNew(); registrar.Parameter("jaeger", &TThis::Jaeger) .DefaultNew(); - registrar.Parameter("rpc", &TThis::Rpc) + registrar.Parameter("tracing_transport", &TThis::TracingTransport) .DefaultNew(); registrar.Parameter("tcmalloc", &TThis::TCMalloc) .Optional(); diff --git a/yt/yt/library/program/config.h b/yt/yt/library/program/config.h index a5432c284e..10b6fd5b06 100644 --- a/yt/yt/library/program/config.h +++ b/yt/yt/library/program/config.h @@ -2,6 +2,8 @@ #include "public.h" +#include <yt/yt/core/tracing/config.h> + #include <yt/yt/core/ytree/yson_struct.h> #include <yt/yt/core/ytalloc/config.h> @@ -32,21 +34,6 @@ namespace NYT { //////////////////////////////////////////////////////////////////////////////// -class TRpcConfig - : public NYTree::TYsonStruct -{ -public: - NTracing::TTracingConfigPtr Tracing; - - REGISTER_YSON_STRUCT(TRpcConfig); - - static void Register(TRegistrar registrar); -}; - -DEFINE_REFCOUNTED_TYPE(TRpcConfig) - -//////////////////////////////////////////////////////////////////////////////// - class THeapSizeLimit : public virtual NYTree::TYsonStruct { @@ -147,7 +134,7 @@ public: NProfiling::TSolomonExporterConfigPtr SolomonExporter; NLogging::TLogManagerConfigPtr Logging; NTracing::TJaegerTracerConfigPtr Jaeger; - TRpcConfigPtr Rpc; + NTracing::TTracingTransportConfigPtr TracingTransport; TTCMallocConfigPtr TCMalloc; TStockpileConfigPtr Stockpile; bool EnableRefCountedTrackerProfiling; @@ -175,7 +162,7 @@ public: NRpc::TDispatcherDynamicConfigPtr RpcDispatcher; NLogging::TLogManagerDynamicConfigPtr Logging; NTracing::TJaegerTracerDynamicConfigPtr Jaeger; - TRpcConfigPtr Rpc; + NTracing::TTracingTransportConfigPtr TracingTransport; TTCMallocConfigPtr TCMalloc; NYson::TProtobufInteropDynamicConfigPtr ProtobufInterop; diff --git a/yt/yt/library/program/helpers.cpp b/yt/yt/library/program/helpers.cpp index 8160cac9b3..6ac1113327 100644 --- a/yt/yt/library/program/helpers.cpp +++ b/yt/yt/library/program/helpers.cpp @@ -212,8 +212,8 @@ void ConfigureSingletons(const TSingletonsConfigPtr& config) NProfiling::EnablePerfCounters(); - if (auto tracingConfig = config->Rpc->Tracing) { - NTracing::SetTracingConfig(tracingConfig); + if (auto tracingConfig = config->TracingTransport) { + NTracing::SetTracingTransportConfig(tracingConfig); } ConfigureTCMalloc(config->TCMalloc); @@ -257,10 +257,10 @@ void ReconfigureSingletons(const TSingletonsConfigPtr& config, const TSingletons NRpc::TDispatcher::Get()->Configure(config->RpcDispatcher->ApplyDynamic(dynamicConfig->RpcDispatcher)); - if (dynamicConfig->Rpc->Tracing) { - NTracing::SetTracingConfig(dynamicConfig->Rpc->Tracing); - } else if (config->Rpc->Tracing) { - NTracing::SetTracingConfig(config->Rpc->Tracing); + if (dynamicConfig->TracingTransport) { + NTracing::SetTracingTransportConfig(dynamicConfig->TracingTransport); + } else if (config->TracingTransport) { + NTracing::SetTracingTransportConfig(config->TracingTransport); } if (dynamicConfig->TCMalloc) { |