MIT 6.824 Lab1 the first hint

  • 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。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值