go_mapreduce
go_mapreduce copied to clipboard
A simple MapReduce implementation in Google Go.
go_mapreduce
A simple MapReduce implementation in Go using channels and generics.
This is a learning project for understanding Go channels and MapReduce basics. Not intended for production use.
Installation
go get github.com/dbravender/go_mapreduce
Usage
import "github.com/dbravender/go_mapreduce/mapreduce"
result := mapreduce.MapReduce(mapper, reducer, inputChan, poolSize)
mapper:func(In, chan<- Mid)- processes each input, sends result to channelreducer:func(<-chan Mid, chan<- Out)- aggregates mapper outputsinputChan:<-chan In- input items to processpoolSize:int- max concurrent mappers
Example
See cmd/wordcount/main.go for a word counting example.
go run ./cmd/wordcount
License
MIT