throw new FileNotFoundException("Error loading metadata for index file: " + fileKey);
}
else if (fileMetadata.getSize() <= fileMetadata.getBufferSize()) {
//files smaller than chunkSize don't need a readLock
IndexInputContext iic = new IndexInputContext(chunksCache, fileKey, fileMetadata, null);
return new SingleChunkIndexInput(iic);
}
else {
boolean locked = readLocks.acquireReadLock(name);
if (!locked) {
// safest reaction is to tell this file doesn't exist anymore.