def reduce(iterator, out, params): # there should be a discodb writer of some sort from discodb import DiscoDB, kvgroup DiscoDB(kvgroup(iterator)).dump(out)
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)