mr

package
v0.0.0-...-703eda3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

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

func NewCoordinator

func NewCoordinator(numberOfMapWorker int, numberOfReduceWorker int) *Coordinator

func (*Coordinator) LoadWorkloads

func (c *Coordinator) LoadWorkloads(workloads []FileInfo) *Coordinator

func (*Coordinator) RegisterMapFn

func (c *Coordinator) RegisterMapFn(fn Mapfn) *Coordinator

func (*Coordinator) RegisterReduceFn

func (c *Coordinator) RegisterReduceFn(fn Reducefn) *Coordinator

func (*Coordinator) Run

func (c *Coordinator) Run() error

type FileInfo

type FileInfo struct {
	Filename string
	Contents []byte
}

type KVPair

type KVPair struct {
	Key   string
	Value string
}

type MTask

type MTask struct {
	ID      int
	Payload FileInfo
}

type Mapfn

type Mapfn = func(string, string) []KVPair

type RTask

type RTask struct {
	Key   string
	Value []string
}

type Reducefn

type Reducefn = func(string, []string) string

Jump to

Keyboard shortcuts

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