Iterator<K> iter = CompositePathIterable.create(fs, p, a).iterator();
while (iter.hasNext()) {
parts.add((K) new AvroKey<K>(iter.next()));
}
} else {
WritableDeepCopier wdc = new WritableDeepCopier(keyClass);
SeqFileReaderFactory<K> s = new SeqFileReaderFactory<K>(keyClass);
Iterator<K> iter = CompositePathIterable.create(fs, p, s).iterator();
while (iter.hasNext()) {
parts.add((K) wdc.deepCopy((Writable) iter.next()));
}
}
Collections.sort(parts, comparator);
return parts.toArray((K[])Array.newInstance(keyClass, parts.size()));
}