UserIdReputationEnrichmentMapper's map method:
String reputation = userIdToReputation.get(key.toString());
if (reputation != null) {
outkey.set(value.get() + "\t" + reputation);
output.collect(outkey, value);
}
the outputkey is userId\tReputation.
as the book sayed: Reducer code. This reducer implementation sums the values together and outputs this summation with the input key: user ID and reputation.
so the third line should be:
outkey.set(key.toString() + "\t" + reputation);
UserIdReputationEnrichmentMapper's map method:
String reputation = userIdToReputation.get(key.toString());
if (reputation != null) {
outkey.set(value.get() + "\t" + reputation);
output.collect(outkey, value);
}
the outputkey is userId\tReputation.
as the book sayed: Reducer code. This reducer implementation sums the values together and outputs this summation with the input key: user ID and reputation.
so the third line should be:
outkey.set(key.toString() + "\t" + reputation);