Documentation
¶
Index ¶
- func CallExample()
- func MapFinished(filename string, rpcID int)
- func ReduceFinished(taskNo int, rpcID int)
- func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string)
- type ExampleArgs
- type ExampleReply
- type KeyValue
- type KeyValues
- type MapFinishedArgs
- type MapFinishedReply
- type Master
- func (m *Master) Done() bool
- func (m *Master) Example(args *ExampleArgs, reply *ExampleReply) error
- func (m *Master) MapFinish(args *MapFinishedArgs, reply *MapFinishedReply) error
- func (m *Master) ReduceFinish(args *ReduceFinishedArgs, reply *ReduceFinishedReply) error
- func (m *Master) TaskAssign(args *TaskAssignArgs, reply *TaskAssignReply) error
- type ReduceFinishedArgs
- type ReduceFinishedReply
- type TaskAssignArgs
- type TaskAssignReply
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 MapFinished ¶
func ReduceFinished ¶
Types ¶
type ExampleArgs ¶
type ExampleArgs struct {
X int
}
type ExampleReply ¶
type ExampleReply struct {
Y int
}
type MapFinishedArgs ¶
type MapFinishedReply ¶
type MapFinishedReply struct{}
type Master ¶
type Master struct { MapperTask map[string]int MapFinished int ReducerTask map[int]int ReduceFinished int // contains filtered or unexported fields }
Master FileMap: filename -> unstarted:0 / working:1
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) MapFinish ¶
func (m *Master) MapFinish(args *MapFinishedArgs, reply *MapFinishedReply) error
func (*Master) ReduceFinish ¶
func (m *Master) ReduceFinish(args *ReduceFinishedArgs, reply *ReduceFinishedReply) error
func (*Master) TaskAssign ¶
func (m *Master) TaskAssign(args *TaskAssignArgs, reply *TaskAssignReply) error
type ReduceFinishedArgs ¶
type ReduceFinishedReply ¶
type ReduceFinishedReply struct{}
type TaskAssignArgs ¶
type TaskAssignArgs struct{}
type TaskAssignReply ¶
func TaskRequest ¶
func TaskRequest() *TaskAssignReply
Click to show internal directories.
Click to hide internal directories.