[][src]Function map_reduce_omri::run_map_reduce_framework

pub fn run_map_reduce_framework<K1, V1, K2, V2, K3, V3>(
    map: fn(_: K1, _: V1, emit: &mut dyn FnMut(K2, V2)),
    reduce: fn(_: K2, _: Vec<V2>, emit: &mut dyn FnMut(K3, V3)),
    items_vec: Vec<(K1, V1)>,
    number_of_threads: i32,
    chunk_size: usize
) -> Vec<(K3, V3)> where
    K1: Send + PartialOrd + 'static,
    V1: Send + 'static,
    K2: Send + PartialOrd + 'static + Eq + Hash + Clone + Debug,
    V2: Send + 'static + Display + Debug,
    K3: Send + PartialOrd + 'static,
    V3: Send + 'static, 

this is a multi-threaded map-reduce implementation, as described in wikipedia: https://en.wikipedia.org/wiki/MapReduce

to use this, you need to implement map and reduce functions as in the signature, and pass them as parameters, together with the input items vector.

the map and reduce functions does not return anything, but emit there output using the "emit" function.