On Fri, 5 Aug 2011 08:50:02 +0800 (CST), "Daniel,Wu" <hadoop...@163.com> wrote: > The book also > mentioned the value if mutable, I think the key might also be mutable, > means as we loop each value in iterable<NullWritable>, the content of the > key object is reset.
The "mutability" of the value is one of the weirdnesses of Hadoop you have to get used to, and one of the few times it becomes important that Java object semantics are pointer semantics. Anyway, it wouldn't surprise me if the key were also replaced on iteration, but I'd have to dig into the Hadoop code to check on that. Or you could!