| 46 | Ready.Signal(); |
| 47 | } |
| 48 | void Run(TLocalDataBuffer* writeBuffer, TRemoteQueryProcessor* queryProc, |
| 49 | TVector<TVector<char>>* result) { |
| 50 | CHROMIUM_TRACE_FUNCTION(); |
| 51 | Ready.Reset(); |
| 52 | |
| 53 | int localCompId = queryProc ? queryProc->GetCompId() : -1; |
| 54 | AtomicAdd(ReqCount, 1); |
| 55 | for (THashMap<int, TWBCopyCompInfo>::iterator i = RequestHash.begin(); i != RequestHash.end(); ++i) { |
| 56 | TWBCopyCompInfo& info = i->second; |
| 57 | int compId = i->first; |
| 58 | if (compId == localCompId) { |
| 59 | for (int j = 0; j < info.Data.ysize(); ++j) { |
| 60 | writeBuffer->GetData(info.Data[j], &Result[info.OriginalPlace[j]], TLocalDataBuffer::DO_COPY); |
| 61 | } |
| 62 | } else { |
| 63 | TVector<char> buf; |
| 64 | SerializeToMem(&buf, info.Data); |
| 65 | AtomicAdd(ReqCount, 1); |
| 66 | queryProc->SendQuery(compId, "wb_copy", &buf, this, compId); |
| 67 | } |
| 68 | } |
| 69 | if (AtomicAdd(ReqCount, -1) == 0) |
| 70 | Ready.Signal(); |
| 71 | Ready.Wait(); |
| 72 | |
| 73 | result->swap(Result); |
| 74 | } |
| 75 | }; |
| 76 | |
| 77 | void CollectData(const TVector<TDataLocation>& data, TVector<TVector<char>>* res, |
no test coverage detected