[][src]Trait efflux::mapper::Mapper

pub trait Mapper {
    fn setup(&mut self, _ctx: &mut Context) { ... }
fn map(&mut self, key: usize, value: &[u8], ctx: &mut Context) { ... }
fn cleanup(&mut self, _ctx: &mut Context) { ... } }

Trait to represent the mapping 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 Mapper.

fn map(&mut self, key: usize, value: &[u8], ctx: &mut Context)

Mapping handler for the current Mapper.

The default implementation is to simply emit each key/value pair as they are received, without any changes. As such, this is where most developers will immediately begin to change things.

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

Cleanup handler for the current Mapper.

Loading content...

Implementors

impl<M> Mapper for M where
    M: FnMut(usize, &[u8], &mut Context), 
[src]

Enables raw functions to act as Mapper types.

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

Mapping 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...