A sample input file is given below. Each line corresponds to a point-of-interest (POI), which contains a keyword, coordinate values x and y
Individual Assignment
Please submit your assignment in Blackboard
and follow our requirements in Section 2.
A sample input file is given below. Each line corresponds to a point-of-interest (POI), which contains a keyword, coordinate values x and y (separated by white space).
park 3 5
lake 2 3 mall 1 4 park 2 4 lake 9 8 mall 2 7 |
We measure the distance between two points p1=(x1,y1) and p2=(x2,y2) by:
dist(p1, p2) = Ö(x1 – x2)2 + (y1 – y2)2
Each keyword k is associated with a group G(k) of points.
[Example] The group of “park” contains two points: (3,5) and (2,4).
There are 2 questions in this programming assignment.
You should write a MapReduce program to solve each of them.
Input: the sample input above
Output:
lake 5.5 5.5
mall 1.5 5.5
park 2.5 4.5
Input: the sample input above
Output:
lake 8.602
mall 3.162
park 1.414
<YourStudentID> // your folder name, [Example] 19001234g
— Q1.java // source file for question 1
— Q1.jar // jar file for question 1, compiled and archived from Q1.java
— Q2.java // source file for question 2
— Q2.jar // jar file for question 2, compiled and archived from Q2.java
bin/hadoop jar Q1.jar Q1 <input path> <output path>
bin/hadoop jar Q2.jar Q2 <input path> <output path>
-Google drive:
-The Y drive in COMP Lab: Y:\Subject\COMP5434
Note: These files will get expired on November 7!
20 marks will be given if your program can be compiled.
-for each .java file, 10 marks
80 marks will be given if your program is correct. We will test the correctness of your program by using 8 test cases (4 for each sub-question).
-For each test case, 10 marks
Notice this is an individual assignment. Plagiarism will result in 0 mark!