[][src]Trait efflux::reducer::Reducer

pub trait Reducer {
    fn setup(&mut self, _ctx: &mut Context) { ... }
fn reduce(&mut self, key: &[u8], values: &[&[u8]], ctx: &mut Context) { ... }
fn cleanup(&mut self, _ctx: &mut Context) { ... } }

Trait to represent the reduction stage of MapReduce.

All trait methods have sane defaults to match the Hadoop MapReduce implementation, allowing the developer to pick and choose what they customize without having to write a large amount of boilerplate.

Provided methods

fn setup(&mut self, _ctx: &mut Context)

Setup handler for the current Reducer.

fn reduce(&mut self, key: &[u8], values: &[&[u8]], ctx: &mut Context)

Reduction handler for the current Reducer.

The default implementation of this handler will emit each value against the key in the order they were received. This is typically the stage of interest for many MapReduce developers.

fn cleanup(&mut self, _ctx: &mut Context)

Cleanup handler for the current Reducer.

Loading content...

Implementors

impl<R> Reducer for R where
    R: FnMut(&[u8], &[&[u8]], &mut Context), 
[src]

Enables raw functions to act as Reducer types.

fn reduce(&mut self, key: &[u8], value: &[&[u8]], ctx: &mut Context)
[src]

Reduction handler by passing through the values to the inner closure.

fn setup(&mut self, _ctx: &mut Context)
[src]

fn cleanup(&mut self, _ctx: &mut Context)
[src]

Loading content...