COMPUTER FUNDAMENTALS

EMERGING TRENDS IN COMPUTING

CLOUD COMPUTING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Consider the pseudo-code for MapReduce’s WordCount example (not shown here). Let’s now assume that you want to determine the average amount of words per sentence. Which part of the (pseudo-)code do you need to adapt?
A
Only map()
B
Only reduce()
C
map() and reduce()
D
The code does not have to be changed.
Explanation: 

Detailed explanation-1: -The text from the input text file is tokenized into words to form a key value pair with all the words present in the input text file. The key is the word from the input file and value is ‘1’. This is how the MapReduce word count program executes and outputs the number of occurrences of a word in any given input file.

Detailed explanation-2: -(e) [1 point] True or false: Each mapper/reducer must generate the same number of output key/value pairs as it receives on the input. SOLUTION: False. Mappers and reducers may generate any number of key/value pairs (including zero).

There is 1 question to complete.