mapreduce

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMappers   = 100
	DefaultReducers  = 2
	DefaultShufflers = 2
	DefaultBulkSize  = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity interface{}

type MapReduce

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

func NewMapReduce

func NewMapReduce(r *bulkreader.BulkReader) *MapReduce

func (*MapReduce) Process

func (mr *MapReduce) Process(ctx context.Context) (resErr error)

func (*MapReduce) WithMapper

func (mr *MapReduce) WithMapper(mapper Mapper) *MapReduce

func (*MapReduce) WithReducer

func (mr *MapReduce) WithReducer(reducer Reducer) *MapReduce

func (*MapReduce) WithsShuffler

func (mr *MapReduce) WithsShuffler(shuffler Shuffler) *MapReduce

type Mapper

type Mapper interface {
	Map(context.Context, <-chan []string, chan<- Entity) error
}

type Reducer

type Reducer interface {
	Reduce(context.Context, <-chan []Entity) error
}

type Shuffler

type Shuffler interface {
	Shuffle(context.Context, <-chan Entity, chan<- []Entity) error
}

Jump to

Keyboard shortcuts

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