Documentation ¶
Index ¶
- func FilterOutDuplicates(out chan<- Value, in <-chan KeyValue)
- func FilterOutUniques(out chan<- Value, in <-chan KeyValue)
- func Map(in <-chan Value, mapFn MapFn) <-chan KeyValue
- func Pipeline(pairs ...MapReducePair) <-chan Value
- func Reduce(in <-chan KeyValue, reduceFn ReduceFn) <-chan Value
- type KVType
- type Key
- type KeyType
- type KeyValue
- type MapFn
- type MapReducePair
- type ReduceFn
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterOutDuplicates ¶
FilterOutDuplicates is a standard reducer that drops values with duplicate keys sending out only unique matches.
func FilterOutUniques ¶
FilterOutUniques is a standard reducer that drops values with unique keys sending out the rest of the values.
func Map ¶
Map run provided Key/Value generator in a separate go-routine. It returns channel of KeyValue values.
func Pipeline ¶
func Pipeline(pairs ...MapReducePair) <-chan Value
Pipeline builds a pipeline by chaining together provided Map/Reducer pairs. It returns a <-chan of Value.
Types ¶
type Key ¶
type Key interface {
Key() KeyType
}
Key interface is there to make sure that the value can be used in go built-in map as a key.
type KeyType ¶
type KeyType string
func KeyTypeFromInt ¶
func KeyTypeFromInt64 ¶
func KeyTypeFromString ¶
type KeyValue ¶
KeyValue interface describes objects produced by Map and used by Reduce as its input stream
type MapFn ¶
MapFn provided by the client code. It is responsible to perform actual work and send it to the out channel as KeyValue tuple.
type MapReducePair ¶
MapReducePair is a necessary type for pipeline builder