With a bit more debugging I may have partially answered question (3) for
myself.
When I run a Hadoop job other than that called by "hadoop fs -text", an
ItemSet key is created by the org.apache.hadoop.ioWritableComparator.newKey
method, which looks like this:
public WritableComparable newKey() {
return ReflectionUtils.newInstance(keyClass, null);
}
Here keyClass is equal to ItemSet.class. Compare this to the call in the
TextRecordInputStream constructor.
key =
ReflectionUtils.newInstance(r.getKeyClass().asSubclass(WritableComparable.class),
getConf());
This does look related to
HADOOP-4466<https://issues.apache.org/jira/browse/HADOOP-4466>,
but that is listed as fixed in 0.19.0.