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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started