Question: MapReduce lab(JAVA) Your task is to analyze a large collection of 100 text files and compute the aggregate word count. Eg. suppose you have 2

MapReduce lab(JAVA)

Your task is to analyze a large collection of 100 text files and compute the aggregate word count.

Eg. suppose you have 2 text files:

file1.txt

A dog barks at the sun.

file2.txt

The sun rises over a village.

Then the aggregate word count is:

a -> 2
dog -> 1
barks ->1
sun->2

(so on and so forth)

Step 1

Use the text files provided in the archive. Download and unzip them in your project root.

Step 2

Use a single thread (main thread) to parse all the text files and create the aggregate word count (use a Map to store the word count.

Step 3

Modify the previous solution to parse the text files in parallel. Create multiple worker threads that each compute the word count for a subset of the text files (eg worker 1 computes for file1,2,3, worker 2 for file4,5,6....). After all workers finish their work the main thread collects their individual word count and aggregates it into a single word count (a single map).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!