MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / run

Method run

example/E04-MapReduce.cpp:65–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63class ReduceGNode : public GNode {
64public:
65 CStatus run() override {
66 int total = 0;
67 auto param = CGRAPH_GET_GPARAM_WITH_NO_EMPTY(NumsGParam, PARAM_KEY);
68 for (int j = 0; j < MAX_NUM; j++) {
69 int num = 0;
70 for (int i = 0; i < MAP_SIZE; i++) {
71 num += param->map_results_[i][j];
72 }
73 total += num;
74 printf(" num [%d] appear [%d] times\n", j, num);
75 }
76
77 printf("total num is [%d]. \n", total);
78 return CStatus();
79 }
80};
81
82

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected