Documentation ¶
Index ¶
- func CallExample()
- func DoMapTask(mapf func(string, string) []KeyValue, response *Task)
- func DoReduceTask(reducef func(string, []string) string, response *Task)
- func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string)
- type ExampleArgs
- type ExampleReply
- type KeyValue
- type Master
- type Phase
- type SortedKV
- type State
- type Task
- type TaskArgs
- type TaskMetaInfo
- type TaskMetaMap
- type Type
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 DoReduceTask ¶
执行reduce任务
Types ¶
type ExampleArgs ¶
type ExampleArgs struct {
X int
}
type ExampleReply ¶
type ExampleReply struct {
Y int
}
type Master ¶
type Master struct { // Your definitions here. ReducerNum int //reducer数目 TaskID int //task对应id SysPhase Phase //框架当前所处阶段 MapTaskChannel chan *Task //Map任务队列 ReduceTaskChannel chan *Task //Reduce任务队列 TaskMetaMap TaskMetaMap //全部任务元数据Map FileSlice []string //输入文件对应切片 }
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.
type Task ¶
Click to show internal directories.
Click to hide internal directories.