Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER THE PART THAT IS BOLB. FROM 2 REDUCERS. Problem 2. (WordCount Example) Please design the mapper and reducer for the WordCount problem. WordCount

PLEASE ANSWER THE PART THAT IS BOLB. FROM 2 REDUCERS.

Problem 2. (WordCount Example) Please design the mapper and reducer for the WordCount problem.

WordCount problem: Given an input text file, count the frequency of each word in the file.

Please design the input and output pairs for the Mapper and Reducer.

Mapper

Reducer

Input

Output

We get the WordCount.jar file by using the above design. It only contains Mapper and Reducer. There is no Combiner and Partitioner in this program.

Please illustrate how the WordCount.jar program works on the following dataset. This text file only contains one line.

the sound sounds sound. it is the right right, right?

Suppose we run the WordCount.jar program on this file. Suppose that the space symbol, ., ,, and ? are all used for separating the words. The outputs of the Mapper are

< the , >

< sound , >

< sounds , >

< sound , >

< it , >

< is , >

< the , >

< right , >

< right , >

< right , >

The outputs of the reducer are

Are the results sorted alphabetically? When was it sorted?

Answer:

Suppose the chuck size is 64MB. How many mappers and reducers are used? Why?

Answer:

Suppose we want to use 2 reducers. How to do that in the .java file?

Answer:

Suppose the key-value pairs with the keys the, sound, is are processed by reducer 1. Suppose the key-value pairs with the keys it, right, sounds are processed by reducer 2. Please determine the outputs of the two reducers.

Reducer 1

Reducer 2

From the above results, we can see that

1. Are the records in the output file of one reducer sorted?

Answer:

2. Are the records in the output file of Reducer 1 greater alphabetically than those in the output file of Reducer 2?

Answer:

If we want that the answer to the second question is Yes, how can we design MapReduce program?

Answer:

Please design your partitioner with the following boundary:

If the first letter of a word is less than s, this word belongs to partition 1; otherwise, this word belongs to partition 2. What are the partitions in the above example?

Partition 1

Partition 2

What are the outputs of reducer 1 and 2?

Reducer 1

Reducer 2

Suppose we add the combiner to the program. Can we use the code for the reducer as the combiner?

Answer:

Will the combiner helps improve the computing efficiency and why?

Answer:

How many combiners do we have?

Answer:

Please Indicate the output of the combiner.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning PostgreSQL On The Cloud Simplifying Database As A Service On Cloud Platforms

Authors: Baji Shaik ,Avinash Vallarapu

1st Edition

1484234464, 978-1484234464

More Books

Students also viewed these Databases questions