private void inventorySwapReserveFiles(File swapReserveDir) throws IOException {
    File[] fileSizeDirs = swapReserveDir.listFiles(FILE_SIZE_DIR_FILTER);
    if (fileSizeDirs == null) {
      throw new IOException("Error while listing directories in " + swapReserveDir.getAbsolutePath());
    }
    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 swap segment files in " + fileSizeDir.getAbsolutePath());
      }
      for (File reserveFile : reserveFilesForSize) {
        swapReserveFiles.add(sizeInBytes, reserveFile);
      }
    }
  }
Inventory existing swap segment directory and add entries to {@link #swapReserveFiles}
@param swapReserveDir the directory where swap segment files reside.
@throws IOException
ambry-store/src/main/java/com/github/ambry/store/DiskSpaceAllocator.java