mr

package
v1.0.12-0...-16f252f Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCancelWithNil  = errors.New("mapreduce cancelled with nil")
	ErrReduceNoOutput = errors.New("reduce not writing value")
)

Functions

func Finish

func Finish(fns ...func() error) error

func FinishVoid

func FinishVoid(fns ...func())

func Map

func Map(generate GenerateFunc, mapper MapFunc, opts ...Option) chan interface{}

func MapReduce

func MapReduce(generate GenerateFunc, mapper MapperFunc, reducer ReducerFunc, opts ...Option) (interface{}, error)

func MapReduceVoid

func MapReduceVoid(generator GenerateFunc, mapper MapperFunc, reducer VoidReducerFunc, opts ...Option) error

func MapReduceWithSource

func MapReduceWithSource(source <-chan interface{}, mapper MapperFunc, reducer ReducerFunc,
	opts ...Option) (interface{}, error)

func MapVoid

func MapVoid(generate GenerateFunc, mapper VoidMapFunc, opts ...Option)

Types

type GenerateFunc

type GenerateFunc func(source chan<- interface{})

type MapFunc

type MapFunc func(item interface{}, writer Writer)

type MapperFunc

type MapperFunc func(item interface{}, writer Writer, cancel func(error))

type Option

type Option func(opts *mapReduceOptions)

func WithWorkers

func WithWorkers(workers int) Option

type ReducerFunc

type ReducerFunc func(pipe <-chan interface{}, writer Writer, cancel func(error))

type VoidMapFunc

type VoidMapFunc func(item interface{})

type VoidReducerFunc

type VoidReducerFunc func(pipe <-chan interface{}, cancel func(error))

type Writer

type Writer interface {
	Write(v interface{})
}

Jump to

Keyboard shortcuts

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