MCPcopy Create free account
hub / github.com/catboost/catboost / GetContextState

Method GetContextState

library/cpp/par/par_context.cpp:435–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433 }
434
435 bool TContextDistributor::GetContextState(int hostId, const THashMap<int, int>& envId2Version, THashMap<int, TIntrusivePtr<TContextDataHolder>>* res) {
436 CHROMIUM_TRACE_FUNCTION();
437 TGuard<TMutex> g(Sync);
438 res->clear();
439 for (THashMap<int, int>::const_iterator z = envId2Version.begin(); z != envId2Version.end(); ++z) {
440 int envId = z->first;
441 int version = z->second;
442 Y_ASSERT(EnvId2Info.find(envId) != EnvId2Info.end());
443 const TFullCtxInfo& ctx = EnvId2Info[envId];
444 const TCtxDataPart& dataPart = ctx.Data[hostId];
445 TContextDataHolder* info = dataPart.Info.Get();
446 if (!info || dataPart.Version != version)
447 return false;
448 (*res)[envId] = info;
449 }
450 return true;
451 }
452
453 const TVector<int>& TContextDistributor::GetComputer2HostId(int envId) {
454 Y_ASSERT(EnvId2Info.find(envId) != EnvId2Info.end());

Callers 2

TGlobalUserContextMethod · 0.45
LaunchRequestMethod · 0.45

Calls 5

clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected