private void inventoryStoreReserveFiles(File storeReserveDir, String storeId) throws IOException {
    File[] fileSizeDirs = storeReserveDir.listFiles(FILE_SIZE_DIR_FILTER);
    if (fileSizeDirs == null) {
      throw new IOException("Error while listing directories in " + storeReserveDir.getAbsolutePath());
    }
    ReserveFileMap sizeToFileMap = storeReserveFiles.getOrDefault(storeId, new ReserveFileMap());
    for (File fileSizeDir : fileSizeDirs) {
      long sizeInBytes = getFileSizeForDirName(fileSizeDir.getName());
      File[] reserveFilesForSize = fileSizeDir.listFiles(RESERVE_FILE_FILTER);
      if (reserveFilesForSize == null) {
        throw new IOException("Error while listing store reserve files in " + fileSizeDir.getAbsolutePath());
      }
      for (File reserveFile : reserveFilesForSize) {
        sizeToFileMap.add(sizeInBytes, reserveFile);
      }
    }
    storeReserveFiles.put(storeId, sizeToFileMap);
  }
Inventory existing store reserve directories and add entries to {@link #storeReserveFiles}
@param storeReserveDir the directory where store reserve files reside.
@param storeId the id of store which files in this directory belong to.
@throws IOException
ambry-store/src/main/java/com/github/ambry/store/DiskSpaceAllocator.java