private void inventoryExistingReserveFiles() throws IOException {
    File[] allFiles = reserveDir.listFiles();
    if (allFiles == null) {
      throw new IOException("Error while listing directories in " + reserveDir.getAbsolutePath());
    }
    for (File file : allFiles) {
      String storeId = getStoreIdForDirName(file.getName());
      if (file.isDirectory() && storeId != null) {
        inventoryStoreReserveFiles(file, storeId);
      } else if (file.isDirectory() && file.getName().equals(SWAP_DIR_NAME)) {
        inventorySwapReserveFiles(file);
      } else {
        // if it is neither store reserved segment directory nor swap segment directory, then delete it.
        Utils.deleteFileOrDirectory(file);
      }
    }
  }
Inventory existing reserve directories and add entries to {@link #storeReserveFiles} and {@link #swapReserveFiles}
The hierarchy of reserve pool on a single disk is as follows.
<pre>
--- reserve_pool
      |--- reserve_store_1
      |              |--- reserve_size_2147483648
      |
      |--- reserve_store_2
                     |--- reserve_size_2147483648
      ...
      |--- reserve_store_n
      |              |--- reserve_size_2147483648
      |
      |--- reserve_swap (# shared by all stores on same disk)
                     |--- reserve_size_2147483648
                     |--- reserve_size_8589934592
</pre>
ambry-store/src/main/java/com/github/ambry/store/DiskSpaceAllocator.java