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)
def results(self): from discodex.mapreduce.func import filterchain, funcify, kvgroup filterfn = filterchain(funcify(name) for name in self.resultsfilters) results = result_iterator(self.wait(), reader=self.result_reader) return filterfn(results)
def map(entry, params): from discodex.mapreduce.func import filterchain, funcify filterfn = filterchain(funcify(name) for name in params.mapfilters) return filterfn(entry)