| 239 | } |
| 240 | |
| 241 | TVector<int> TMaster::MakeHostIdMapping(int groupCount) { |
| 242 | int hostCount = GetSlaveCount(); |
| 243 | if (QueryProc.Get() == nullptr) |
| 244 | hostCount = groupCount; |
| 245 | Y_ABORT_UNLESS(groupCount <= hostCount, "enough hosts to represent all groups"); |
| 246 | TVector<int> res; |
| 247 | res.resize(hostCount); |
| 248 | for (int i = 0; i < hostCount; ++i) |
| 249 | res[i] = i % groupCount; |
| 250 | Shuffle(res.begin(), res.end()); |
| 251 | return res; |
| 252 | } |
| 253 | |
| 254 | int TMaster::GetSlaveCount() { |
| 255 | return ContextMaster->GetSlaveCount(); |