Reduce() method

The following are characteristics of the reduce function, including examples of the input and output and the action the reduce method performs.

  • Input: URL and a list of counts of visits of this page.
  • Output: A (URL, total count of visits) pair.
  • Action: Sums all counts that were output for each URL.

Input data

URL | LIST OF COUNTS
--------------+--------------------
ibm.com | {1,1,1,1,1,1}
noname.org | {1,1,1,1}

Output data

URL | TOTAL_COUNT
------------+-------------
ibm.com | 6
noname.org | 4