| 358 | }; |
| 359 | |
| 360 | void TContextDistributor::DeleteContextRawData(int envId, int hostId, bool keepContextOnMaster) { |
| 361 | CHROMIUM_TRACE_FUNCTION(); |
| 362 | WaitAllDistributionActivity(); // can wait more fine grained, but delay should not be much higher |
| 363 | |
| 364 | Y_ASSERT(EnvId2Info.find(envId) != EnvId2Info.end()); |
| 365 | TFullCtxInfo& dst = EnvId2Info[envId]; |
| 366 | |
| 367 | // free mem on slaves |
| 368 | if (QueryProc.Get()) { |
| 369 | TVector<char> cmd; |
| 370 | { |
| 371 | TContextFreeCmd freeCmd; |
| 372 | freeCmd.EnvId = envId; |
| 373 | SerializeToMem(&cmd, freeCmd); |
| 374 | } |
| 375 | |
| 376 | const TVector<int>& compList = dst.HostId2Computer[hostId]; |
| 377 | TIntrusivePtr<TFreeMemWait> fmw = new TFreeMemWait(compList.ysize()); |
| 378 | for (int i = 0; i < compList.ysize(); ++i) { |
| 379 | int compId = compList[i]; |
| 380 | TVector<char> tmp = cmd; |
| 381 | QueryProc->SendQuery(compId, "ctx_free", &tmp, fmw.Get(), i); |
| 382 | } |
| 383 | fmw->Wait(); |
| 384 | } |
| 385 | |
| 386 | // free mem on master |
| 387 | TCtxDataPart& part = dst.Data[hostId]; |
| 388 | TVector<TVector<char>>().swap(part.BinData); |
| 389 | if (!keepContextOnMaster) { |
| 390 | part.Info = nullptr; |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | void TContextDistributor::GetVersions(int envId, int* hostIdCount, THashMap<int, int>* envId2version) { |
| 395 | CHROMIUM_TRACE_FUNCTION(); |
no test coverage detected