7. Map <Only value> Map takes as input a function and a sequence of values. It then applies the function to each value in the sequence func Map (func,values) applied values values
15. Map map(String key, String value): // key: document name // value: document contents for each word w in value: EmitIntermediate(w, "1");
16. Reduce reduce(String key, Iterator values): // key: a word // values: a list of counts int result = 0; for each v in values: result +=ParseInt(v); Emit(AsString(result));
23. <Foolish,1> <Hungry,1> <Stay,2> <Don’t,1> <settle,1> <Foolish,1> <Hungry,1> <Stay,2> <Don’t,1> <settle,1> (7) All map tasks and reduce tasks have been completed master wakes up the user program -> return Result
24. Map map = function () { for (var key in this) { emit(key, {count:1}); }
25. Reduce reduce = function (key, emits) { total = 0; for (vari in emits) { total += emits[i].count; } return {count:total};