hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Pennebaker <apenneba...@42six.com>
Subject MapReduce Tutorial tweak
Date Tue, 27 Aug 2013 15:16:02 GMT
In https://hadoop.apache.org/docs/stable/mapred_tutorial.html#Source+Code,
line 16 declares:

private Text word = new Text();

...

But only lines 22 and 23 use this, and only to pass the value along to
output:

word.set(tokenizer.nextToken());
output.collect(word, one);

Wouldn't this be better expressed as:

(no private Text word)

...

output.collect(tokenizer.nextToken(), one);

?

Mime
View raw message