private <K> NavigableMap<K, Long> loadIndexFile(
Configuration conf, Path path, Schema keySchema) throws IOException {
DatumReader<GenericRecord> datumReader = model.createDatumReader(
AvroKeyValue.getSchema(keySchema, Schema.create(Schema.Type.LONG)));
DataFileReader<GenericRecord> fileReader = new DataFileReader<GenericRecord>(
new FsInput(path, conf), datumReader);
NavigableMap<K, Long> index;
if (Schema.create(Schema.Type.STRING).equals(keySchema)) {
// Because Avro STRING types are mapped to the Java CharSequence class that does not
// mandate the implementation of Comparable, we need to specify a special