code: public IndexRecord getIndexInformation(String mapId, int reduce,
        Path fileName) throws IOException {
  
      IndexInformation info = cache.get(mapId);
  
      if (info == null) {
        info = readIndexFileToCache(fileName, mapId);
      } else {
        synchronized (info) {
          while (null == info.mapSpillRecord) {
            try {
              info.wait();
            } catch (InterruptedException e) {
              throw new IOException("Interrupted waiting for construction", e);
            }
          }
        }
        LOG.debug("IndexCache HIT: MapId " + mapId + " found");
      }
  
      if (info.mapSpillRecord.size() == 0 ||
          info.mapSpillRecord.size() < reduce) {
        throw new IOException("Invalid request " +
          " Map Id = " + mapId + " Reducer = " + reduce +
          " Index Info Length = " + info.mapSpillRecord.size());
      }
      return info.mapSpillRecord.getIndex(reduce);
    }
docs: This method gets the index information for the given mapId and reduce.
  It reads the index file into cache if it is not already present.
  @param mapId
  @param reduce
  @param fileName The file to read the index information from if it is not
  already present in the cache
  @return The Index Information
  @throws IOException