Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 24 lines (18 sloc) 0.493 kb
"""
Example of two iterations in one Dumbo program.
"""
def mapper1(key,value):
for word in value.split(): yield word,1
def mapper2(key,value):
for letter in key: yield letter,1
def reducer1(key,values):
count = sum(values)
if count > 1: yield key,count
def reducer2(key,values):
yield key,sum(values)
if __name__ == "__main__":
import dumbo
job = dumbo.Job()
job.additer(mapper1,reducer1,reducer2)
job.additer(mapper2,reducer2,reducer2)
job.run()
Jump to Line
Something went wrong with that request. Please try again.