terasort

package
v0.0.0-...-180b4dd Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MapPhase    JobPhase = 1
	ReducePhase          = 2

	TmpFilePrefix = "mr-"
	FilePerm      = 0755
)
View Source
const (
	TeraGenNumber         = 8 << 20
	TerasortMapTaskNum    = 10
	TerasortReduceTaskNum = 10
	StringLength          = 8 - 1
)

system config

View Source
const (
	DefaultBufferSize = 16 << 20
)
View Source
const (
	WorkerChanSize = 200
)

Variables

This section is empty.

Functions

func Call

func Call(srv, rpcname string, args, reply interface{}) error

Call is RPC call helper

Types

type DoTaskArg

type DoTaskArg struct {
	JobName       string
	Phase         JobPhase
	TaskNo        int
	OtherPhaseNum int
}

type DoTaskReply

type DoTaskReply struct {
}

type FileBuffer

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

buffered IO

func NewFileBuffer

func NewFileBuffer(filename string, align, size int) (*FileBuffer, error)

func (*FileBuffer) Destroy

func (fb *FileBuffer) Destroy()

func (*FileBuffer) Get

func (fb *FileBuffer) Get() ([]byte, error)

type JobPhase

type JobPhase int

type Master

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

func NewMaster

func NewMaster(address, rootDir string) *Master

func (*Master) RPCRegisterWorker

func (m *Master) RPCRegisterWorker(args RegisterWorkerArg, reply *RegisterWorkerReply) error

func (*Master) Shutdown

func (m *Master) Shutdown()

Shutdown shuts down master

func (*Master) TeraGen

func (m *Master) TeraGen(filename string) error

generate input file, one string per line

func (*Master) TeraHeader

func (m *Master) TeraHeader(num int, checksum int) string

func (*Master) TeraSort

func (m *Master) TeraSort(in, out string) error

do the sort

type RegisterWorkerArg

type RegisterWorkerArg struct {
	Address string
}

type RegisterWorkerReply

type RegisterWorkerReply struct {
}

type SetConfigArg

type SetConfigArg struct {
	Key   string
	Value string
}

type SetConfigReply

type SetConfigReply struct {
}

type Worker

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

func NewWorker

func NewWorker(address, master string, rootDir string) *Worker

func (*Worker) RPCDoTask

func (wk *Worker) RPCDoTask(args DoTaskArg, reply *DoTaskReply) error

do map task or do reduce task

func (*Worker) RPCSetConfig

func (wk *Worker) RPCSetConfig(args SetConfigArg, reply *SetConfigReply) error

func (*Worker) Shutdown

func (wk *Worker) Shutdown()

Jump to

Keyboard shortcuts

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