first commit
parent
39d57ac19d
commit
a975411c49
Binary file not shown.
|
@ -13,7 +13,7 @@ cd main
|
||||||
go run mrcoordinator.go pg-*.txt
|
go run mrcoordinator.go pg-*.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
然后再另一个窗口运行
|
然后在另一个窗口运行
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cd main
|
cd main
|
||||||
|
@ -27,4 +27,4 @@ wc.so是用户编写生成的动态库,用于执行Map和Reduce任务
|
||||||
```shell
|
```shell
|
||||||
cd main
|
cd main
|
||||||
sh test-mr.sh
|
sh test-mr.sh
|
||||||
```
|
```
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
修改的文件包括/mr下的三个文件
|
||||||
|
|
||||||
|
- `coordinator.go` 用于协调worker的工作
|
||||||
|
- `worker.go` 通过RPC向coordinator请求任务,执行Map或者Reduce任务
|
||||||
|
- `rpc.go` 定义了RPC的接口
|
||||||
|
|
||||||
|
使用方法:
|
||||||
|
|
||||||
|
运行
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd main
|
||||||
|
go run mrcoordinator.go pg-*.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
然后再另一个窗口运行
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd main
|
||||||
|
go run mrworker.go wc.so
|
||||||
|
```
|
||||||
|
|
||||||
|
wc.so是用户编写生成的动态库,用于执行Map和Reduce任务
|
||||||
|
|
||||||
|
测试程序
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd main
|
||||||
|
sh test-mr.sh
|
||||||
|
```
|
Loading…
Reference in New Issue