gomapr

package module
v0.0.0-...-cd37691 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2014 License: MIT Imports: 4 Imported by: 1

README

gomapr

In-process MapReduce for Golang

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EndOfEmit = errors.New("Nothing left to emit")
)

Functions

This section is empty.

Types

type Event

type Event interface{}

type MapReduce

type MapReduce interface {
	Emit() (Event, error)
	Map(Event) (ReduceKey, Partial)
	Reduce(ReduceKey, []Partial) (ReduceKey, Partial)
}

type Partial

type Partial interface{}

type ReduceKey

type ReduceKey interface{}

type Result

type Result struct {
	Key   ReduceKey
	Value Partial
}

type ResultSlice

type ResultSlice []*Result

A sortable slice of results (sortable only for int64 values).

func (ResultSlice) Len

func (r ResultSlice) Len() int

func (ResultSlice) Less

func (r ResultSlice) Less(i, j int) bool

func (ResultSlice) Swap

func (r ResultSlice) Swap(i, j int)

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Contains configuration for a MapReduce task.

func NewRunner

func NewRunner(mr MapReduce, mappers int, reduceFactor float64) *Runner

func (*Runner) Groups

func (r *Runner) Groups() map[ReduceKey]Partial

Returns the map containing all groups. Only safe to call after the task has completed.

func (*Runner) Results

func (r *Runner) Results() ResultSlice

Returns the slice containing all groups. Only safe to call after the task has completed.

func (*Runner) Run

func (r *Runner) Run()

Starts the MapReduce task.

func (*Runner) RunSynchronous

func (r *Runner) RunSynchronous()

Runs MapReduce synchronously.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL