lab2 - JAWolfe04/CS5590-Lab-1 GitHub Wiki

TASK 1

Introduction:

This lab task is to find Facebook common friends using spark.

Objective The usecase we are using is A-> BCD, B->ACDE, C->ABDE, D->ABCE, E->BCD. In map phase we will find common friends of the two people. Combine them based on the mutual key and then reduce them to get the common friend list.

Workflow Firstly we will create a mapper class. Every line of the file is split accordingly"",Where the first component is source or base user and the rest is know as users friends list.

Now, we will use reducer class where the data is combined based on the keys like (A,B)OR(B,C) and the friends list is generated. Finally we will come up with a commons friends list(A,B)

Finally, Main class will be used as driver to set mapper class and reducer class which produce the output file by taking the input file.

Conclusion: We use this Mapreduce to find mutual friends of two friends when their list of friends are combined together and filter using reduce.