Lab-2: Word Count with MapReduce

Due: 11-1-2021 23:59 (UTC+8)

Introduction

Getting started

Please back up your lab1 solution before progressing the steps below:

In the first place, please remember to save your lab1 solution:

Then, pull from the repository:

Then, switch to the lab2 branch:

Merge with lab1, and solve conflicts on your own (mainly in fuse.cc and chfs_client.cc):

After merging all conflicts, you should be able to compile the new project successfully:

Please make sure there is no error during make.

Distributed File Server

In lab1, you have implemented a file system named ChFS on a single machine. In lab2, your objective is to extend it to a distributed file server with RPC.

Luckily, most of your jobs have been done in lab1. You now can use extent service provided by extent_server through RPC in extent_client.

You'd better test your code with the previous test suit before any progress.

Using the RPC library

Hints

Grading

To grade this part of lab, a test script grade.sh is provided. Here's a successful grading.

Notice that a non-RPC version may also pass the tests, but RPCs will be checked against in actual grading. So please refrain yourself from doing so :D

MapReduce

(Reference: MIT 6.824 Distributed Systems)

In this lab, you are asked to build a MapReduce framework.

You will implement a worker process that calls Map and Reduce functions and handles reading and writing files, and a coordinator process that hands out tasks to workers and copes with failed workers.

You can refer to the MapReduce paper for more details (Note that this lab uses "coordinator" instead of the paper's "master").

There are four files added for this part: mr_protocol.h, mr_sequential.cc, mr_coordinator.cc, mr_worker.cc.

Task 1

Task 2

Hints

Grading

After you have implement part1 & part2, run the grading script:

We will test your MapReduce following the evaluation criteria above.

Handin Procedure

After all above done:

That should produce a file called lab2.tgz in the directory. Change the file name to your student id:

Then upload lab2_[your student id].tgz file to Canvas before the deadline.

You'll receive full credits if your code passes the same tests that we gave you, when we run your code on our machines.