Documentation ¶
Index ¶
- func CallExample()
- func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string)
- type ExampleArgs
- type ExampleReply
- type KeyValue
- type Master
- func (m *Master) Done() bool
- func (m *Master) Example(args *ExampleArgs, reply *ExampleReply) error
- func (m *Master) RegWorker(args *RegisterArgs, reply *RegisterReply) error
- func (m *Master) ReportTask(args *ReportTaskArgs, reply *ReportTaskReply) error
- func (m *Master) ReqTask(args *ReqTaskArgs, reply *ReqTaskReply) error
- type RegisterArgs
- type RegisterReply
- type ReportTaskArgs
- type ReportTaskReply
- type ReqTaskArgs
- type ReqTaskReply
- type Task
- type TaskState
- type TaskType
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.
示例函数,没有使用
Types ¶
type ExampleArgs ¶
type ExampleArgs struct {
X int
}
type ExampleReply ¶
type ExampleReply struct {
Y int
}
type Master ¶
type Master struct {
// contains filtered or unexported fields
}
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) RegWorker ¶
func (m *Master) RegWorker(args *RegisterArgs, reply *RegisterReply) error
func (*Master) ReportTask ¶
func (m *Master) ReportTask(args *ReportTaskArgs, reply *ReportTaskReply) error
func (*Master) ReqTask ¶
func (m *Master) ReqTask(args *ReqTaskArgs, reply *ReqTaskReply) error
type RegisterArgs ¶
type RegisterArgs struct { }
type RegisterReply ¶
type RegisterReply struct {
WorkerId int
}
type ReportTaskArgs ¶
type ReportTaskReply ¶
type ReportTaskReply struct { }
type ReqTaskArgs ¶
type ReqTaskArgs struct {
WorkerId int
}
type ReqTaskReply ¶
type ReqTaskReply struct {
Task *Task
}
Click to show internal directories.
Click to hide internal directories.