Documentation
¶
Index ¶
- func CallExample()
- func CheckWorkerAlive(m *Master)
- func DoMap(id int, filename string, nslot int, mapf func(string, string) []KeyValue)
- func DoReduce(id int, filename string, nslot int, reducef func(string, []string) string)
- func MapAllComplete(m *Master) (completed bool)
- func ReduceAllComplete(m *Master) (completed bool)
- func RegisterMyself() int
- func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string)
- type ExampleArgs
- type ExampleReply
- type KeyValue
- type Master
- type RegisterArgs
- type RegisterReply
- type ReturnCode
- type ScheduleTaskArgs
- type ScheduleTaskReply
- type TaskQueue
- type WorkerState
- type WorkerStatus
- type WorkerTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallExample ¶
func CallExample()
example function to show how to make an RPC call to the master.
the RPC argument and reply types are defined in rpc.go.
func CheckWorkerAlive ¶
func CheckWorkerAlive(m *Master)
func MapAllComplete ¶
func ReduceAllComplete ¶
func RegisterMyself ¶
func RegisterMyself() int
Types ¶
type ExampleArgs ¶
type ExampleArgs struct {
X int
}
type ExampleReply ¶
type ExampleReply struct {
Y int
}
type Master ¶
func MakeMaster ¶
create a Master. main/mrmaster.go calls this function. nReduce is the number of reduce tasks to use.
func (*Master) Done ¶
main/mrmaster.go calls Done() periodically to find out if the entire job has finished.
func (*Master) Example ¶
func (m *Master) Example(args *ExampleArgs, reply *ExampleReply) error
an example RPC handler.
the RPC argument and reply types are defined in rpc.go.
func (*Master) Register ¶
func (m *Master) Register(args *RegisterArgs, reply *RegisterReply) error
Your code here -- RPC handlers for the worker to call.
func (*Master) ScheduleTask ¶
func (m *Master) ScheduleTask(args *ScheduleTaskArgs, reply *ScheduleTaskReply) error
type RegisterReply ¶
type RegisterReply struct {
No int
}
type ReturnCode ¶
type ReturnCode int
const ( SUCCESS ReturnCode = 0 NO_MORE_TASK ReturnCode = 1 WAIT_FOR_TASK ReturnCode = 2 )
type ScheduleTaskArgs ¶
type ScheduleTaskArgs struct {
Id int
}
type ScheduleTaskReply ¶
type ScheduleTaskReply struct { Retcode ReturnCode Task WorkerTask File string NReduce int }
type WorkerState ¶
type WorkerState int
const ( WORKER_IDLE WorkerState = 0 WORKER_MAP_INPROGRESS WorkerState = 1 WORKER_COMPLETED WorkerState = 2 WORKER_REDUCE_INPROGRESS WorkerState = 3 )
type WorkerStatus ¶
type WorkerStatus struct {
// contains filtered or unexported fields
}
type WorkerTask ¶
type WorkerTask int
const ( TASK_NONE WorkerTask = 0 TASK_MAP WorkerTask = 1 TASK_REDUCE WorkerTask = 2 )
Click to show internal directories.
Click to hide internal directories.