indentation level fix

This commit is contained in:
Remzi Arpaci-Dusseau
2018-04-11 13:30:34 -05:00
parent b7eb7399b4
commit 0585c46c7a

View File

@@ -62,18 +62,18 @@ of occurrences of each word in a set of documents:
``` ```
map(String key, String value): map(String key, String value):
// key: document name // key: document name
// value: document contents // value: document contents
for each word w in value: for each word w in value:
EmitIntermediate(w, "1"); EmitIntermediate(w, "1");
reduce(String key, Iterator values): reduce(String key, Iterator values):
// key: a word // key: a word
// values: a list of counts // values: a list of counts
int result = 0; int result = 0;
for each v in values: for each v in values:
result += ParseInt(v); result += ParseInt(v);
print key, result; print key, result;
``` ```
What's fascinating about MapReduce is that so many different kinds of relevant What's fascinating about MapReduce is that so many different kinds of relevant
@@ -213,7 +213,7 @@ unsigned long MR_DefaultHashPartition(char *key, int num_buckets) {
unsigned long hash = 5381; unsigned long hash = 5381;
int c; int c;
while ((c = *key++) != '\0') while ((c = *key++) != '\0')
hash = hash * 33 + c; hash = hash * 33 + c;
return hash % num_buckets; return hash % num_buckets;
} }
``` ```