Пример #1
0
 def reduce(iterator, out, params):
     # there should be a discodb writer of some sort
     from discodb import DiscoDB, kvgroup
     DiscoDB(kvgroup(iterator)).dump(out)
Пример #2
0
 def _reduce(iterator, out, params):
     from discodex.mapreduce.func import filterchain, funcify, kvgroup
     filterfn = filterchain(funcify(name) for name in params.reducefilters)
     for k_vs in kvgroup(iterator):
         for k, v in filterfn(k_vs):
             out.add(k, v)