Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TaskCompleted ¶
func TaskCompleted(task *Task)
Types ¶
type ExampleArgs ¶
type ExampleArgs struct {
X int
}
type ExampleReply ¶
type ExampleReply struct {
Y int
}
type Master ¶
type Master struct { TaskQueue chan *Task // 等待执行的task TaskMeta map[int]*MasterTask // 当前所有task的信息 MasterPhase State // Master的阶段 NReduce int InputFiles []string Intermediates [][]string // Map任务产生的R个中间文件的信息 }
func MakeMaster ¶
create a Master. main/mrmaster.go calls this function. nReduce is the number of reduce tasks to use.
func (*Master) AssignTask ¶
func (m *Master) AssignTask(args *ExampleArgs, reply *Task) error
master等待worker调用
func (*Master) Done ¶
main/mrmaster.go calls Exit() periodically to find out if the entire job has finished.
func (*Master) TaskCompleted ¶
func (m *Master) TaskCompleted(task *Task, reply *ExampleReply) error
type MasterTask ¶
type MasterTask struct { TaskStatus MasterTaskStatus StartTime time.Time TaskReference *Task }
type MasterTaskStatus ¶
type MasterTaskStatus int
const ( Idle MasterTaskStatus = iota InProgress Completed )
Click to show internal directories.
Click to hide internal directories.