Documentation ¶
Index ¶
- Constants
- func CallExample()
- func CallReportTask(task Task) error
- func DoMapTask(mapf func(string, string) []KeyValue, task Task)
- func DoReduceTask(reducef func(string, []string) string, task Task)
- func IntermediateFileName(mapTaskId int, reduceTaskId int) string
- func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string)
- type ByKey
- type ExampleArgs
- type ExampleReply
- type KeyValue
- type Master
- type ReportTaskArgs
- type ReportTaskReply
- type RequestTaskArgs
- type RequestTaskReply
- type Task
Constants ¶
View Source
const ( Initializing = iota MapPhase ReducePhase TearDown )
Master.state for this lab, map all before reduce
View Source
const ( MapTask = iota ReduceTask )
Task.TaskType
View Source
const ( UnScheduled = iota InProgress Done )
Task.State
View Source
const ( Idle = iota WorkAssigned NoMoreWork )
RequestTaskReply.WorkerNextState
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 IntermediateFileName ¶
Types ¶
type ExampleArgs ¶
type ExampleArgs struct {
X int
}
example to show how to declare the arguments and reply for an RPC.
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) ReportTask ¶
func (m *Master) ReportTask(args *ReportTaskArgs, reply *ReportTaskReply) error
func (*Master) RequestTask ¶
func (m *Master) RequestTask(args *RequestTaskArgs, reply *RequestTaskReply) error
type ReportTaskArgs ¶
type ReportTaskArgs struct {
Task Task
}
args and reply for CallReportTask RPC
type ReportTaskReply ¶
type ReportTaskReply struct { }
type RequestTaskReply ¶
Click to show internal directories.
Click to hide internal directories.