An exception is thrown here. Here is the code from SVN.
public RawComparator getOutputKeyComparator() {
Class<? extends RawComparator> theClass = getClass("mapred.output.key.comparator.class",
null, RawComparator.class);
if (theClass != null)
return ReflectionUtils.newInstance(theClass, this);
return WritableComparator.get(getMapOutputKeyClass().asSubclass(WritableComparable.class));
}
If the property is mapred.output.key.comparator.classnot defined in JobConf, then the key must implement the WritableComparable interface. The ByteBuffer class does not implement the WritableComparable interface, therefore an exception.
BTW, WritableComparable - - Writable Comparable.