| 62 | return hasDataCount; |
| 63 | } |
| 64 | void DoneReduceTask() { |
| 65 | if (AtomicAdd(ReduceReqCount, -1) != 0) |
| 66 | return; |
| 67 | if (AtomicCas(&CurrentState, -1, 0)) { |
| 68 | if (!RemapTable.empty()) { |
| 69 | int reduceResultCount = RemapTable.ysize(); |
| 70 | for (int i = 0; i < reduceResultCount; ++i) |
| 71 | ResultData[i].swap(ResultData[RemapTable[i]]); |
| 72 | ResultData.resize(reduceResultCount); |
| 73 | } |
| 74 | |
| 75 | PAR_DEBUG_LOG << "Done reduce tasks" << Endl; |
| 76 | CompleteNotify->MRCommandComplete(false, &ResultData); |
| 77 | CompleteNotify = nullptr; |
| 78 | } |
| 79 | } |
| 80 | void DistrCmdComplete(int reqId, TVector<char>* res) override { |
| 81 | if (res) |
| 82 | res->swap(ResultData[reqId]); |