|
185 | 185 | #include <ydb/core/tx/conveyor/service/service.h> |
186 | 186 | #include <ydb/core/tx/conveyor/usage/config.h> |
187 | 187 | #include <ydb/core/tx/conveyor/usage/service.h> |
| 188 | +#include <ydb/core/tx/priorities/usage/config.h> |
| 189 | +#include <ydb/core/tx/priorities/usage/service.h> |
188 | 190 | #include <ydb/core/tx/limiter/service/service.h> |
189 | 191 | #include <ydb/core/tx/limiter/usage/config.h> |
190 | 192 | #include <ydb/core/tx/limiter/usage/service.h> |
@@ -2199,6 +2201,28 @@ void TCompDiskLimiterInitializer::InitializeServices(NActors::TActorSystemSetup* |
2199 | 2201 | } |
2200 | 2202 | } |
2201 | 2203 |
|
| 2204 | +TCompPrioritiesInitializer::TCompPrioritiesInitializer(const TKikimrRunConfig& runConfig) |
| 2205 | + : IKikimrServicesInitializer(runConfig) { |
| 2206 | +} |
| 2207 | + |
| 2208 | +void TCompPrioritiesInitializer::InitializeServices(NActors::TActorSystemSetup* setup, const NKikimr::TAppData* appData) { |
| 2209 | + NPrioritiesQueue::TConfig serviceConfig; |
| 2210 | + if (Config.HasCompPrioritiesConfig()) { |
| 2211 | + Y_ABORT_UNLESS(serviceConfig.DeserializeFromProto(Config.GetCompPrioritiesConfig())); |
| 2212 | + } |
| 2213 | + |
| 2214 | + if (serviceConfig.IsEnabled()) { |
| 2215 | + TIntrusivePtr<::NMonitoring::TDynamicCounters> tabletGroup = GetServiceCounters(appData->Counters, "tablets"); |
| 2216 | + TIntrusivePtr<::NMonitoring::TDynamicCounters> conveyorGroup = tabletGroup->GetSubgroup("type", "TX_COMP_PRIORITIES"); |
| 2217 | + |
| 2218 | + auto service = NPrioritiesQueue::TCompServiceOperator::CreateService(serviceConfig, conveyorGroup); |
| 2219 | + |
| 2220 | + setup->LocalServices.push_back(std::make_pair( |
| 2221 | + NPrioritiesQueue::TCompServiceOperator::MakeServiceId(NodeId), |
| 2222 | + TActorSetupCmd(service, TMailboxType::HTSwap, appData->UserPoolId))); |
| 2223 | + } |
| 2224 | +} |
| 2225 | + |
2202 | 2226 | TCompConveyorInitializer::TCompConveyorInitializer(const TKikimrRunConfig& runConfig) |
2203 | 2227 | : IKikimrServicesInitializer(runConfig) { |
2204 | 2228 | } |
|
0 commit comments