- One way to get started is to modify mr/worker.go's Worker() to send an RPC to the master asking for a task. Then modify the master to respond with the file name of an as-yet-unstarted map task. Then modify the worker to read that file and call the application Map function, as in mrsequential.go.
- 意思就是让你在mr/worker.go下写CallGetTask向mr/coordinator.go中GetTask获取一个任务,进行执行。
- 简化任务细节,在mr/rpc.go定义好CallGetTask的传参struct Args,定义好GetTask回复给CallGetTask的struct Reply
- mr/coordinator.go下定义一个Task struct,一个元素,Name string,用于定义task name,给CallGetTask传回任务名称
- 最后将mr/worker.go中的CallGetTask在mr/worker.go中的Worker方法中执行
- terminal输入bash test-mr.sh,最后结果
CallGetTask and GetTask methods
总结,其实第一个提示需要你做的就是一个worker向coordinator调用rpc服务,不过我还仅仅只实现了一个简单的小demo。