worker

package
v0.0.0-...-26feacf Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValueList

type KeyValueList []storage.KeyValue

func (KeyValueList) Len

func (kvs KeyValueList) Len() int

func (KeyValueList) Less

func (kvs KeyValueList) Less(i, j int) bool

func (KeyValueList) Swap

func (kvs KeyValueList) Swap(i, j int)

type ServiceConfig

type ServiceConfig struct {
	ID                 string            `json:"id"`
	MasterGRPCEndpoint string            `json:"master_grpc_endpoint"`
	S3                 *storage.S3Config `json:"s3"`
	DumpRootPath       string            `json:"dump_root_path"`
}

ServiceConfig defines worker config.

type WorkerService

type WorkerService struct {
	MapFun    func(string, string) []storage.KeyValue
	ReduceFun func(string, []string) string

	StopSig chan struct{}

	Storage storage.Persister
	// contains filtered or unexported fields
}

func NewWorkerService

func NewWorkerService(conf *ServiceConfig,
	mapf func(string, string) []storage.KeyValue,
	reducef func(string, []string) string,
) *WorkerService

func (*WorkerService) Start

func (w *WorkerService) Start() error

Start starts mapreduce worker node service.

func (*WorkerService) Stop

func (w *WorkerService) Stop() error

Stop stops mapreduce worker node service.

Jump to

Keyboard shortcuts

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