I receive an iterator as argument and I would like to iterate on values twice.
public void reduce(Pair key, Iterator
Notice: if you use the cache list to cache the item, you should clone the item first then add to the cache. Otherwise you will find all the item is the same in the cache.
The situation is caused by the memory optimization of the MapReduce, In the reduce method, the Iterable reuse the item instance, for more detail can find here