Documentation ¶
Index ¶
- Constants
- func DPrintf(format string, a ...interface{}) (n int, err error)
- func DoMap(JobNumber int, fileName string, nreduce int, Map func(string) *list.List)
- func DoReduce(job int, fileName string, nmap int, Reduce func(string, *list.List) string)
- func MapName(fileName string, MapJob int) string
- func MergeName(fileName string, ReduceJob int) string
- func ReduceName(fileName string, MapJob int, ReduceJob int) string
- func Register(master string, me string)
- func RemoveFile(n string)
- func RunSingle(nMap int, nReduce int, file string, Map func(string) *list.List, ...)
- func RunWorker(MasterAddress string, me string, MapFunc func(string) *list.List, ...)
- type DoJobArgs
- type DoJobReply
- type JobType
- type KeyValue
- type MapReduce
- func (mr *MapReduce) CleanupFiles()
- func (mr *MapReduce) CleanupRegistration()
- func (mr *MapReduce) KillWorkers() *list.List
- func (mr *MapReduce) Merge()
- func (mr *MapReduce) Register(args *RegisterArgs, res *RegisterReply) error
- func (mr *MapReduce) Run()
- func (mr *MapReduce) RunMaster() *list.List
- func (mr *MapReduce) RunWorker(w string)
- func (mr *MapReduce) Shutdown(args *ShutdownArgs, res *ShutdownReply) error
- func (mr *MapReduce) Split(fileName string)
- func (mr *MapReduce) StartRegistrationServer()
- type RegisterArgs
- type RegisterReply
- type ShutdownArgs
- type ShutdownReply
- type Worker
- type WorkerInfo
Constants ¶
View Source
const Debug = 0
Debug is here for Debugging
Variables ¶
This section is empty.
Functions ¶
func RemoveFile ¶
func RemoveFile(n string)
Types ¶
type DoJobReply ¶
type DoJobReply struct {
OK bool
}
type MapReduce ¶
type MapReduce struct { MasterAddress string DoneChannel chan bool // Map of registered workers that you need to keep up to date Workers map[string]*WorkerInfo // contains filtered or unexported fields }
MapReduce contains information about the Map Reduce job
func InitMapReduce ¶
InitMapReduce initiates map reduce structure
func MakeMapReduce ¶
MakeMapReduce creates map reduce structure and runs registration server
func (*MapReduce) CleanupFiles ¶
func (mr *MapReduce) CleanupFiles()
func (*MapReduce) CleanupRegistration ¶
func (mr *MapReduce) CleanupRegistration()
func (*MapReduce) KillWorkers ¶
KillWorkers clean up all workers by sending a Shutdown RPC to each one of them Collect the number of jobs each work has performed.
func (*MapReduce) Merge ¶
func (mr *MapReduce) Merge()
Merge the results of the reduce jobs XXX use merge sort
func (*MapReduce) Register ¶
func (mr *MapReduce) Register(args *RegisterArgs, res *RegisterReply) error
func (*MapReduce) Run ¶
func (mr *MapReduce) Run()
Run jobs in parallel, assuming a shared file system
func (*MapReduce) Shutdown ¶
func (mr *MapReduce) Shutdown(args *ShutdownArgs, res *ShutdownReply) error
func (*MapReduce) StartRegistrationServer ¶
func (mr *MapReduce) StartRegistrationServer()
type RegisterArgs ¶
type RegisterArgs struct {
Worker string
}
type RegisterReply ¶
type RegisterReply struct {
OK bool
}
type ShutdownArgs ¶
type ShutdownArgs struct { }
type ShutdownReply ¶
type Worker ¶
type Worker struct { Reduce func(string, *list.List) string Map func(string) *list.List // contains filtered or unexported fields }
func (*Worker) DoJob ¶
func (wk *Worker) DoJob(arg *DoJobArgs, res *DoJobReply) error
The master sent us a job
func (*Worker) Shutdown ¶
func (wk *Worker) Shutdown(args *ShutdownArgs, res *ShutdownReply) error
The master is telling us to shutdown. Report the number of Jobs we have processed.
type WorkerInfo ¶
type WorkerInfo struct {
// contains filtered or unexported fields
}
WorkerInfo contains infomation about workers
Click to show internal directories.
Click to hide internal directories.