void MapReduce::print(int proc, int nstride, int kflag, int vflag) void MapReduce::print(char *file, int fflag, int proc, int nstride, int kflag, int vflag)
This calls the print() method of a MapReduce object. The first variant prints out the KeyValue or KeyMultiValue pairs to the screen. The second variant prints to one or more files. This can be useful for debugging purposes.
If proc < 0, then all processors print their information, one processor at a time. If proc >= 0, then only the specified proc prints its information.
For printing to files, if fflag = 0, then all processors print in succession to the names file. If fflag = 1, then each processor writes to file.P, where P = 0 to Nprocs-1.
Each processor prints every Nth of its pairs, where N = nstride. Thus if nstride = 1, all pairs are printed.
The kflag and vflag setting control the format of the printed output. Only a limited set of choices is available. If these choices do not match the format of your keys and values, you will need to pass your data to map() or reduce() function you write yourself to print them. These can be invoked by the map() or reduce() methods.
These are the recognized kflag and vflag settings:
For example, using kflag = 1 and vflag = 7, would be appropriate for keys that are 32-bit integers, and values that are a pair of 64-bit integers.
For KeyMultiValue pairs, the vflag setting is used to format each output value in the multi-value.
Related methods: collate()