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

Method MRCommandComplete

library/cpp/par/par_util.cpp:31–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 ECurrentCommand State;
30
31 void MRCommandComplete(bool isCanceled, TVector<TVector<char>>* res) override {
32 CHROMIUM_TRACE_FUNCTION();
33 if (isCanceled) {
34 DCNotify->DistrCmdComplete(ReqId, nullptr);
35 return;
36 }
37 if (State == FIRST_MAP) {
38 TJobDescription fmJob;
39 fmJob.SetCurrentOperation(FinalMapSerialized);
40 for (int i = 0; i < res->ysize(); ++i)
41 fmJob.AddQuery(-1, &(*res)[i]);
42 if (Op == RR_MAPREDUCE)
43 fmJob.MergeResults();
44
45 State = REMOTE_MAP;
46 Ctx->Run(&fmJob, this);
47
48 } else if (State == REMOTE_MAP) {
49 TVector<char> dcRes;
50 if (Op == RR_MAP) {
51 SerializeToMem(&dcRes, *res);
52 } else {
53 Y_ASSERT(res->ysize() == 1);
54 dcRes.swap((*res)[0]);
55 }
56 DCNotify->DistrCmdComplete(ReqId, &dcRes);
57 } else
58 Y_ASSERT(0);
59 }
60 TGUID GetMasterQueryId() override {
61 return DCNotify->GetDistrCmdMasterQueryId();
62 }

Callers

nothing calls this directly

Calls 8

SerializeToMemFunction · 0.85
SetCurrentOperationMethod · 0.80
MergeResultsMethod · 0.80
DistrCmdCompleteMethod · 0.45
ysizeMethod · 0.45
AddQueryMethod · 0.45
RunMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected