mapreduce

package
v0.0.0-...-7b8ce9a Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeDatabases

func MergeDatabases(urls []string, path string, temp string) (*sql.DB, error)

func SplitDatabase

func SplitDatabase(source, outputDir, outputPattern string, m int) ([]string, error)

Types

type Interface

type Interface interface {
	Map(key, value string, output chan<- Pair) error
	Reduce(key string, values <-chan string, output chan<- Pair) error
}

type MapTask

type MapTask struct {
	M, R       int    // total number of map and reduce tasks
	N          int    // map task number, 0-based
	SourceHost string // address of host with map input file
}

func (*MapTask) Process

func (task *MapTask) Process(tempdir string, client Interface) error

MapTask.Process

type Pair

type Pair struct {
	Key   string
	Value string
}

type ReduceTask

type ReduceTask struct {
	M, R        int      // total number of map and reduce tasks
	N           int      // reduce task number, 0-based
	SourceHosts []string // addresses of map workers
}

func (*ReduceTask) Process

func (task *ReduceTask) Process(tempdir string, client Interface) error

ReduceTask.Process

Jump to

Keyboard shortcuts

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